Skip to content

fix(theme): buttons follow the theme, and system follows macOS - #20

Merged
jkyberneees merged 1 commit into
mainfrom
fix/theme-transitions
Nov 2, 2026
Merged

jkyberneees merged 1 commit into
mainfrom
fix/theme-transitions

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

The title bar buttons could look missing: they were drawn in the previous theme's colour.

  • Frozen transitions: a transition started by a theme change does not advance while WebKit is not rendering, so after a switch in a hidden or minimized window .icon-btn kept the old colour on the new background. setDocumentTheme now switches with all transitions off and commits styles before they return.
  • System theme in the Mac app: prefers-color-scheme follows the window and the window's appearance was always forced, so "system" read back the page's last choice. It now leaves window.appearance nil.

Checked in an on-screen WKWebView set up like the Mac window, before and after, with computed colours and snapshot pixels. Following macOS was simulated through NSApp.appearance; the OS setting itself was not flipped. The native toolbar was not captured in the light theme (no Screen Recording permission).

🤖 Generated with Claude Code

A transition started by a theme change does not advance while WebKit is not
rendering. After a switch in a hidden or minimized window the page was in the
new theme while the title bar buttons kept the old colour. Theme switches now
run with transitions off and commit their styles before they return.

In the Mac app "system" read back the page's own last choice, because
prefers-color-scheme follows the window and the window's appearance was always
forced. System now leaves the appearance unset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jkyberneees
jkyberneees merged commit 0ba3f3f into main Nov 2, 2026
4 of 5 checks passed
@jkyberneees
jkyberneees deleted the fix/theme-transitions branch November 2, 2026 20:56
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.

1 participant