Skip to content

feat: add theme mode dropdown with sync and single modes - #25077

Closed
jaaydenh wants to merge 19 commits into
mainfrom
feat/theme-mode-dropdown-ui
Closed

jaaydenh wants to merge 19 commits into
mainfrom
feat/theme-mode-dropdown-ui

Conversation

@jaaydenh

@jaaydenh jaaydenh commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Part 2 of 2 part change. Part 1 #25076

Replaces the flat theme grid on the Appearance settings page with a
Theme mode dropdown that exposes 'Sync with system' and 'Single theme'
modes. Adds themeMode helpers, a usePreferredColorScheme hook, swatch
and preview components, plus optimistic-cache rollback in the
appearance mutation.

Includes incidental tritan palette refinements, AgentsPage diff CSS
touch-up, Storybook strict-mode import shuffle, and .gitattributes
whitespace rules carried over from the original branch's rebase.

Builds on the schema landed in #25076.

Produced with Coder Agents assistance.

Adds three new UserAppearanceSettings fields (theme_mode, theme_light,
theme_dark) on top of the existing theme_preference and terminal_font.
Replaces GetUserThemePreference and GetUserTerminalFont with a single
GetUserAppearanceSettings aggregate query. The PUT handler is wrapped
in db.InTx so sync-mode's mode + slot writes can never half-apply.
@jaaydenh jaaydenh self-assigned this May 8, 2026
@jaaydenh
jaaydenh force-pushed the feat/theme-mode-dropdown-ui branch from ee412f4 to ec11246 Compare May 8, 2026 12:50

@aslilac aslilac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

both of these PRs are pretty chonky, but over 2kloc added is way too much for one PR

document.querySelector("html")?.setAttribute("class", htmlClassName);

return (
<StrictMode>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why do agents keep trying to make this change for no reason? knock it off 😭

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

they will keep doing it because they are seeing this error, 'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.ts(2686)

@jaaydenh

Copy link
Copy Markdown
Collaborator Author

@aslilac I can look into breaking it up again, its already been 3 PRs so far maybe 4 will be enough.

Copy link
Copy Markdown
Collaborator Author

This has been split into smaller PRs for review:

  1. fix(site/src/pages/AgentsPage): theme diff changed-line backgrounds #25179, AgentsPage diff changed-line backgrounds.
  2. feat(site): add legacy auto sync helper and tritan cleanup #25180, legacy auto sync helper and tritan theme cleanup.
  3. feat(site): add theme mode frontend foundation #25181, theme mode frontend foundation, stacked on feat(site): add legacy auto sync helper and tritan cleanup #25180.
  4. fix: rollback appearance mutation cache updates #25182, appearance mutation rollback, stacked on feat: add theme_mode, theme_light, theme_dark to UserAppearanceSettings #25076.
  5. feat: add theme mode dropdown #25183, final theme mode dropdown wiring, isolated against helper base pr25077/05-theme-mode-dropdown-base until dependencies merge.

I am leaving this original PR open for now so the author can decide whether to close it or keep it as the tracking PR.

jaaydenh added a commit that referenced this pull request May 14, 2026
…gs (#25076)

Part 1: Backend portion of a change broken into 2 PRs.
Part 2: #25077 

Adds three new UserAppearanceSettings fields (theme_mode, theme_light,
theme_dark) on top of the existing theme_preference and terminal_font.
Replaces GetUserThemePreference and GetUserTerminalFont with a single
GetUserAppearanceSettings aggregate query. The PUT handler is wrapped in
db.InTx so sync-mode's mode + slot writes can never half-apply.
Base automatically changed from feat/theme-mode-api to main May 14, 2026 04:44
@jaaydenh jaaydenh closed this May 16, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators May 16, 2026
@github-actions
github-actions Bot deleted the feat/theme-mode-dropdown-ui branch November 12, 2026 00:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants