The Window Controls Overlay API applies a transparent overlay on
Windows, but not on Linux. This PR addresses this by capturing the area
underneath the overlay, averaging the color of the area, and setting
this as the overlay background color.
It will also detect whether to make the control symbols white or black,
depending on how dark the background color is.
On Linux, this will set both the background color and the symbol color,
on Windows it will just set the symbol color.
<img width="721" alt="image"
src="https://github.com/user-attachments/assets/e6f9f8f8-a49f-41b6-984e-09e7d52c631d">
This makes it possible to send wsh commands from wsh on a remote session
to wavesrv running locally. The exact behavior of running those commands
isn't implemented, but the underlying interface is added here.
This PR implements the [Window Controls Overlay
API](https://web.dev/articles/window-controls-overlay) to let us hide
the menu bar on Windows and Linux and directly embed the window controls
in our tab bar. With #239 merged, we no longer need the menu bar on
these platforms.
The overlaid window controls are transparent so they will take on the
background from the app. I've updated the tab bar to flow properly using
the API's CSS environment variables.
At some point, we may want to update the logic around the symbolColor so
that it can ensure a proper contrast between the background and the
symbols in the window controls. For now, setting them to white works for
all the backgrounds we currently support.
![image
(2)](https://github.com/user-attachments/assets/7610f10b-9696-435c-9a2d-a435bee9fadb)
https://github.com/user-attachments/assets/8d19b512-5281-42b9-8abb-ccb9b850061f
This simplifies the rect calculations by making the gap between pixels
into a padding applied directly to the leaf nodes. This means the gaps
won't be present in the overlay layer, so when dragging a node around it
is always over an OverlayNode and the pendingAction won't be unset.
Also simplifies onDrop handling
Adds a new setting that emulates the prefers-reduced-motion media query, allowing users to disable Wave animations without affecting other apps on their system. It also honors the prefers-reduced-motion query in case a system-level configuration is present.
This PR is a large refactoring of the layout code to move as much of the
layout state logic as possible into a unified model class, with atoms
and derived atoms to notify the display logic of changes. It also fixes
some latent bugs in the node resize code, significantly speeds up
response times for resizing and dragging, and sets us up to fully
replace the React-DnD library in the future.
This PR swaps usage of the `uuid` library for the built-in
`crypto.randomUUID` function, which is available in both NodeJS and the
browser. The built-in function is around 12x faster than the `uuid`
library. The strings produced by the built-in function are fully
compatible with the UUIDv4 standard, so it's an easy switch.
This PR adds back WebGL acceleration (enabled by default) for XTerm. It
also adds back link handling and adds a new option (disabled by default)
to open all links internally as a new web block.
---------
Co-authored-by: sawka <mike.sawka@gmail.com>