There was a bug in Vite 6.0.1
(https://github.com/vitejs/vite/issues/18810) that was preventing NodeJS
libraries from being bundled in the main process. This meant that our
packaged app would refuse to run as it would be unable to find its Node
libraries.
This updates to Vite 6.0.2 to resolve this issue and also updates a few
other deps while we're at it.
Also removes the SASS modern-compiler config from our Vite config since
this is the default behavior in Vite 6.
closes#1373
This PR updates the window controls overlay code to remove the
dependency on `sharp`, which is a natively-compiled Node library that is
really hard to package for Electron given the way that we strip node
modules after bundling. I've replaced this with `pngjs`, which has a
smaller footprint and is still relatively fast (it doesn't need to be
perfect since it runs on the Node process instead of the browser
process).
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">
I'm updating the magnify button to be always visible and animate a
transition between being a "Magnify" button and a "Minimize" button.
This also cleans up some text shrinking behavior in the block frame
header so the end icons are always visible.
Also fixes some height discrepancies in the block frame header.
Also implements a `prefers-reduced-motion` query for the tilelayout and
block frame to ensure transitions are not set if the user does not want
them.
This was a weird one, apparently Storybook still uses CJS but Vite has fully deprecated CJS support. So we need to dynamically import the electron.vite.config.ts file for Storybook, but this breaks because Typescript doesn't resolve and properly compile the dynamic import. To get around this, I am using the `tsx` package, which can dynamically compile typescript imports.
This sets us back up to use Vite via the electron-vite package. This
will let us continue to build our testing suite on Vitest and take
advantage of Vite features like Hot Module Reloading, etc.
---------
Co-authored-by: sawka <mike.sawka@gmail.com>