Skip to content

fix(theme): appearance setting now reaches the overlay + macOS title bar - #1659

Merged
cjpais merged 6 commits into
cjpais:mainfrom
kud:fix/theme-overlay-and-macos-titlebar
Aug 10, 2026
Merged

fix(theme): appearance setting now reaches the overlay + macOS title bar#1659
cjpais merged 6 commits into
cjpais:mainfrom
kud:fix/theme-overlay-and-macos-titlebar

Conversation

@kud

@kud kud commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Before Submitting This PR

Please confirm you have done the following:

Human Written Description

After I added the appearance selector in #1599 and started using it day to day, I noticed the setting only looked half-applied: the recording overlay kept following my OS theme instead of the option I'd picked, and on macOS the window title bar stayed white even with Dark selected. It bothered me that the app didn't move as one, so I traced why the overlay and the native chrome weren't picking up the choice and fixed both so the whole thing stays consistent.

Related Issues/Discussions

Follow-up to #1599 (Light / Dark / System appearance selector).

Community Feedback

Bug fix / follow-up to a merged PR — no separate discussion. This corrects two gaps left by #1599.

Testing

Manual, macOS:

  • Set appearance to Dark on a Light-mode OS → settings content, overlay, and native title bar all go dark. Previously the overlay stayed light and the title bar stayed white.
  • Set to Light on a Dark-mode OS → symmetric result.
  • Set to System → both windows and the title bar follow the OS again (override released).
  • Switching the setting while the overlay is visible updates it live (via the new theme-changed event).

bun run lint, tsc --noEmit, and cargo fmt --check all clean. (Rust not compiled locally in this pass.)

Screenshots/Videos (if applicable)

AI Assistance

  • AI was used (please describe below)

If AI was used:

  • Tools used: Claude Code
  • How extensively: diagnosis of the two gaps and the implementation; description and testing notes drafted with AI, human description above written by the author.

@kud
kud marked this pull request as ready for review July 11, 2026 12:50
@kud
kud force-pushed the fix/theme-overlay-and-macos-titlebar branch from 364a2eb to 4361e7d Compare July 31, 2026 22:46
@cjpais

cjpais commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Are all of the changes explicitly needed? I believe the ones not related to the overlay are not

You can try the build on main to verify this. I would rather not add code, I know it's defensive in a way but I think it might be uncecessary on macOS

@kud

kud commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Good question, and no, they're not all the same thing. Splitting them:

Overlay (needed). The [data-theme] override blocks live in App.css, which only the settings window loads. RecordingOverlay.css imports styles/theme.css and nothing else, so the overlay never sees the override and just follows prefers-color-scheme. Moving the blocks into theme.css is what puts them in front of both windows. And since the overlay is its own webview with its own document, something has to set data-theme on it, hence the two lines in overlay/main.tsx plus the theme-changed event so it updates live rather than on next launch.

macOS title bar (the bit you're asking about). This one is a widened cfg, not new logic. On main apply_window_theme is gated to Windows, so on macOS nothing ever touches the app appearance. The main window is built with default decorations, so AppKit draws the title bar from NSApp.effectiveAppearance, which follows System Settings regardless of what the webview does. Set the OS to Light and Handy to Dark and you get a light title bar sitting on top of a dark app. That's true of 0.9.4 as shipped too, same gate.

Where I think you're right to poke at it: on macOS set_theme is [NSApp setAppearance:], so it's app-wide rather than title-bar-only. It also repaints the tray menu, native dialogs and scrollbars. I'd argue that's what picking "Dark" should mean, and System releases the override cleanly by setting a nil appearance, but it's broader than the PR title suggests and you should know that before taking it.

Happy either way though. I can drop those two lines and keep this PR purely about the overlay, then raise the title bar separately with before/after shots so you can judge it on its own merits. Just say which you'd prefer.

Separately, I've pushed a small fix: change_theme_setting was emitting the raw request string rather than the validated value, so an unknown theme would have reached the overlay unchecked while the settings window fell back to system. It now emits parsed.

@cjpais

cjpais commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Ugh I fucking hate reading AI generated text. Why even ask questions, it's hopeless. I just want a HUMAN RESPONSE

I'm not asking about the code. I'm asking about before and after testing. I don't want assumptions, I want testing. I want a human to validate. I want to be able to pick up a review with confidence before I even build the PR locally.

But I guess I just have to wade through nonsense. I should just shut my mouth and review on my own. This is useless

kud added a commit to kud/Handy that referenced this pull request Aug 6, 2026
kud added a commit to kud/Handy that referenced this pull request Aug 6, 2026
kud added a commit to kud/Handy that referenced this pull request Aug 6, 2026
kud added a commit to kud/Handy that referenced this pull request Aug 6, 2026
@kud

kud commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Sorry about the last comment. I did write it myself, but I ran it through AI to clean up my English, and it ended up reading like a bot wrote it.

I also misread what you were asking. I thought you wanted to know why those code changes were there, so I explained the code at length. You were asking me to test it and show you the result. Those are two different things.

And on the testing, I thought I simply couldn't build Handy. I'm on an Intel MacBook Pro and it dies with "ort does not provide prebuilt binaries for the target x86_64-apple-darwin", which I read as a dead end. It isn't. BUILD.md already covers it. I should have read it properly. Builds fine now.

So, macOS in Light mode, Handy set to Dark.

Before, on the current release build:

CleanShot 2026-08-07 at 00 11 34@2x CleanShot 2026-08-07 at 00 11 52@2x

After, this branch:

CleanShot 2026-08-07 at 00 14 14@2x CleanShot 2026-08-07 at 00 14 23@2x

Want the macOS part in a separate PR? I can take it out of this one.

I use Handy every day and I like it a lot, which is why I keep sending things. I'll write them properly from now on.

The [data-theme] override blocks lived in App.css, which only the settings
window loads. RecordingOverlay.css imports styles/theme.css alone, so the
overlay never saw them and followed prefers-color-scheme instead. Move the
blocks into theme.css, apply the stored theme in the overlay before render,
and emit a theme-changed event so it updates live.

Widen apply_window_theme from Windows-only to Windows and macOS. The main
window is built with default decorations, so on macOS AppKit paints the
title bar from NSApp.effectiveAppearance regardless of what the webview
does. System clears the override so both follow the OS again.
@kud
kud force-pushed the fix/theme-overlay-and-macos-titlebar branch from b4cbe62 to 3446410 Compare August 6, 2026 23:34
@cjpais
cjpais merged commit b50b52a into cjpais:main Aug 10, 2026
4 checks passed
@kud

kud commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

@cjpais Thank you CJ and sorry again. I will be more careful the next time I reply to you.

@kud
kud deleted the fix/theme-overlay-and-macos-titlebar branch August 11, 2026 10:07
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