The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 16:30 UTC
fix(web): preserve appearance mode when changing themes (#6343)
Exotic committed
Aug 12, 2026 at 23:43 UTC
9666b875164581b67e5d75cf26aa05753e83e49e
1 file changed
+4
apps/web/src/hooks/useTheme.ts
+4
@@ -473,6 +473,10 @@ export function useTheme() {
473
const setTheme = useCallback((next: Theme): boolean => {
474
if (typeof window === "undefined") return false;
475
try {
476
+ // Preserve the current mode before replacing a legacy or inferred theme
477
+ // preference. Otherwise a fresh System preference is re-inferred from
478
+ // the new theme's base appearance, which can switch a dark UI to light.
479
+ writeAppearanceModePreference(readAppearanceModePreference(getStored()));
480
// Choosing a whole theme replaces any automatic-mode mix. The mix is
481
// captured first so a failed preference write can put it back instead
482
// of erasing it or leaving it attached to the new theme.