Adventures in building an OS
Introduction
Hey, I'm building something like an OS. As of March 2025 it looks like this, running a fancy vector drawing program:

It looks very similar to MacOS9, but it's not meant to be a 100% clone of it, and is not an emulator.
The OS is an interactive design experiment. It's mainly recreational: I wanted to create an environment that makes me happy... away from the productivity & cleanness nonsense, I want a colorful hi-tek over-the-top-digital-millennium OS to exist within... and to create 90s style designs for!
Note that this is a bit more than a web page that just looks like an OS. It runs applications which - through an API - use several services that the OS offers.
This system works locally in the browser: it's just an HTML page. Does not require even a local server to run. It's optimized for fully offline use.
The following articles are about various problems/learnings that came up while creating an OS, in no particular order.
The UX of non-annoying menus
Multi-level menus can be hard to navigate because of the increased mouse precision needed.
DRAMATIZATION:
Has this ever happened to you?

MacOS9 has the solution! - and I tried to replicate it with JS.
The trick is to introduce a slight delay before switching submenus, but with a smart twist. By the cursor position we can assume the user's intention, as illustrated below. The more the cursor is in the pink, the more generous is the delay:

This delayed action is implemented with JS using the setTimeout function.
Once it technically works, tweaking and testing is needed to finetune the effect. It shouldn't feel laggy, but significantly reduce the unwanted behavior. The correct solution will be unnoticable.
Results
Notice how the mouse movement isn't precise, yet the menu stays open when needed:

This method does not cause general menu lag. Notice how the delay is only introduced when hovering near the right edge of the menu:
