Skip to content

fix(electron): theme Windows titlebar overlay#16843

Open
Hona wants to merge 9 commits intoanomalyco:devfrom
Hona:fix/windows-electron-titlebar-theme
Open

fix(electron): theme Windows titlebar overlay#16843
Hona wants to merge 9 commits intoanomalyco:devfrom
Hona:fix/windows-electron-titlebar-theme

Conversation

@Hona
Copy link
Member

@Hona Hona commented Mar 10, 2026

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.

Hona added 3 commits March 10, 2026 13:15
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.
Copilot AI review requested due to automatic review settings March 10, 2026 03:19
@Hona Hona requested a review from adamdotdevin as a code owner March 10, 2026 03:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 setTitlebar API 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 Titlebar component 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
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
symbol: string
symbolColor: string

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +27
export type TitlebarTheme = {
color: string
symbol: string
mode: "light" | "dark"
}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants