fix(web): preserve appearance mode when changing themes - #6343
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved 75081d7 Straightforward bug fix that preserves the user's appearance mode preference when switching themes. The change is small (one functional line), defensive in nature, and limited to UI theming logic with no security or infrastructure implications. You can customize Macroscope's approvability policy. Learn more. |
## What's Changed * fix(web): align update toast release notes link by @t3-code[bot] in pingdotgg/t3code#6322 * fix(web): render tooltips above dropdowns by @extoci in pingdotgg/t3code#6241 * fix(web): open modified PR clicks in browser by @t3-code[bot] in pingdotgg/t3code#6278 * Fix mobile command popover glass rendering by @juliusmarminge in pingdotgg/t3code#6370 * test(mobile): seed snoozed showcase threads by @PixPMusic in pingdotgg/t3code#5155 * fix(web): preserve appearance mode when changing themes by @extoci in pingdotgg/t3code#6343 * feat(connect): deregister account environments from any client by @StiensWout in pingdotgg/t3code#4844 * feat(web): pull request surfaces — filters & qualifiers, all-server listing, update branch, reactions, in-place editing, smarter diffs by @Bil0000 in pingdotgg/t3code#6039 **Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260812.1077...v0.0.34-nightly.20260812.1079 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260812.1079
What Changed
Keep the current System, Light, or Dark setting when the user selects another theme.
Why
On a new setup, System mode was used but not saved. When the user selected a theme, the app used that theme's default Light mode. This could change a dark app to light. The app now saves the current mode before it changes the theme.
UI Changes
No visual UI, motion, or interaction design changes. The existing theme picker now keeps the active appearance mode.
Checklist
Implemented with GPT-5.6 Sol via Codex in the T3 Code harness.
Note
Low Risk
Small, localized change to theme preference writes in
setTheme; no auth, security, or data-handling impact.Overview
Fixes a case where picking a new theme could flip a dark UI to light when System (or another mode) was active but not yet stored.
setThemenow writes the current appearance mode toTHEME_APPEARANCE_MODE_STORAGE_KEY(viareadAppearanceModePreference+writeAppearanceModePreference) before clearing theme halves and saving the new theme. That stops the app from re-inferring mode from the newly selected theme’s default appearance on the next apply.Reviewed by Cursor Bugbot for commit 75081d7. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix
useTheme.setThemeto preserve appearance mode when changing themesWhen changing themes, the previous appearance mode (light/dark) was being discarded and re-inferred from the new theme, causing unexpected switches. The fix reads the current appearance mode from storage and writes it back before applying the new theme preference in useTheme.ts.
Macroscope summarized 75081d7.