🤖 feat: add auto theme preference that follows system theme#2460
🤖 feat: add auto theme preference that follows system theme#2460
Conversation
- Persist theme preference separately from resolved concrete theme so existing consumers keep receiving concrete values. - Add auto follow behavior in the renderer via prefers-color-scheme change listeners. - Expose Auto in settings, compact selector, command palette, and pre-hydration theme bootstrap; keep cycle/toggle manual-only. - Expand ThemeContext and command source tests for auto preference behavior.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 608080d738
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please take another look. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Add an Auto theme preference that follows the operating system light/dark setting and make Auto the default for users with no saved theme preference.
Background
Today the app only persisted concrete themes (
light,dark,flexoki-light,flexoki-dark) and resolved system theme only at startup. That meant users did not have an explicit “follow system” choice and the UI did not continue tracking OS theme changes while running.Implementation
ThemePreferencemodel withautoplus existing manual themes.themeexposed as a resolved concrete theme for existing consumers to avoid broad downstream breakage.ThemeContextusingmatchMedia('(prefers-color-scheme: light)')change listeners when preference isauto.matchMediavalue immediately, preventing a transient stale-theme flash.index.htmlto parse/normalizeautoand resolve to concrete light/dark before first paint.Autoto theme selection surfaces (settings + selector + command palette).Validation
bun test src/browser/contexts/ThemeContext.test.tsxbun test src/browser/utils/commands/sources.test.tsmake lintmake typecheckmake fmt-checkmake static-checkRisks
nativeThemestate to renderer via IPC.prefers-color-schemebehavior.Generated with
mux• Model:openai:gpt-5.3-codex• Thinking:xhigh• Cost:$0.00