fix(electron): theme Windows titlebar overlay#16843
fix(electron): theme Windows titlebar overlay#16843Hona wants to merge 9 commits intoanomalyco:devfrom
Conversation
Keep the native Windows caption area aligned with the app theme in Electron, including live appearance and theme previews from settings.
Keep the native Windows caption area aligned with the app theme in Electron, including live appearance and theme previews from settings.
Keep the native Windows caption area aligned with the app theme in Electron, including live appearance and theme previews from settings.
There was a problem hiding this comment.
Pull request overview
Adjusts the Windows Electron titlebar overlay to stay visually consistent with the app’s current theme (including live previews), instead of falling back to the default/light caption styling.
Changes:
- Adds a
setTitlebarAPI to the Electron preload bridge and IPC layer. - Introduces Windows titlebar overlay helpers in the Electron main process and applies them to main/loading windows.
- Updates the app’s
Titlebarcomponent to observe theme/appearance changes and push the derived colors to Electron.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/desktop-electron/src/preload/types.ts | Adds TitlebarTheme type and setTitlebar to the exposed Electron API typing. |
| packages/desktop-electron/src/preload/index.ts | Wires api.setTitlebar() to an IPC invoke call. |
| packages/desktop-electron/src/main/windows.ts | Adds overlay computation + setTitlebar() and uses themed overlays when creating windows. |
| packages/desktop-electron/src/main/ipc.ts | Registers set-titlebar IPC handler and forwards to setTitlebar(). |
| packages/app/src/components/titlebar.tsx | Observes theme-related DOM changes and syncs computed colors to Electron on Windows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export type LinuxDisplayBackend = "wayland" | "auto" | ||
| export type TitlebarTheme = { | ||
| color: string | ||
| symbol: string |
There was a problem hiding this comment.
TitlebarTheme.symbol is used as the value for Electron's titleBarOverlay.symbolColor, so the field name is misleading (it reads like an icon/glyph rather than a color). Consider renaming this API field to symbolColor (and updating the corresponding uses) to better match Electron’s terminology and reduce confusion for API consumers.
| symbol: string | |
| symbolColor: string |
| export type TitlebarTheme = { | ||
| color: string | ||
| symbol: string | ||
| mode: "light" | "dark" | ||
| } |
There was a problem hiding this comment.
TitlebarTheme is re-declared here even though an equivalent type is already exported from ../preload/types and used by the IPC handler. To avoid the two definitions drifting over time, prefer importing that type (or moving the shared type to a single module) rather than duplicating it in multiple places.
…ss be the single fallback
Keep the native Windows caption area aligned with the app theme in Electron instead of falling back to the default light overlay. This also updates the titlebar during live appearance and theme previews in settings.