fix(theme): live switch reskins every module + readable accent text - #6
Open
nseldeib wants to merge 1 commit into
Open
fix(theme): live switch reskins every module + readable accent text#6nseldeib wants to merge 1 commit into
nseldeib wants to merge 1 commit into
Conversation
Selecting a non-default theme left many modules rendering the default white card. Colors resolve through the static Palette (which reads ThemeStore.shared.current), but only the theme-observing screen roots re-ran their body on a switch — the page background retinted while leaf cards (whose data inputs were unchanged) kept their cached default-white render. - ContentView: key the visual subtree on themeStore.themeID so a live switch rebuilds every module; model/session live above the .id so app state survives. Follow the theme's color scheme instead of pinning .light, so system chrome matches the dark themes (Bolt/Orbit). - Add a per-theme `onAccent` token (white on the light themes, near-black on the dark themes whose accents are light) and replace hardcoded .white on brand/go/amber surfaces, so on-accent text always contrasts. Verified: swift build + 243 XCTests pass; live in-app switch (runtime themeID change) confirmed in the simulator to retint all modules with no default bleed-through. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Selecting a non-default theme left many Today (and other) modules still rendering the default white card — the theme didn't fully apply.
Root cause
Colors resolve through the static
Paletteenum, which readsThemeStore.shared.current. On a live switch only the theme-observing screen roots (Today, Settings, …) re-ran theirbody, so the page background retinted while leaf cards — whose data inputs were unchanged — kept their cached default-white render. Two smaller issues compounded it: the color scheme was hard-pinned to.light(wrong for the dark themes), and accent buttons/pills hardcoded white text (blends on the light accents of Bolt/Orbit).Fix
ContentView— key the visual subtree onthemeStore.themeID(.id(...)) so a live switch rebuilds every module;model/sessionlive above the.id, so app state survives. Follow the theme's color scheme instead of pinning.light, so system chrome (tab bar, keyboard, scroll backgrounds) matches the dark themes.onAccenttoken — one per theme (white on the light themes, near-black on the dark themes whose accents are light). Replaced hardcoded.whiteon brand/go/amber surfaces across 8 components so on-accent text always contrasts.Each theme is now a complete, self-consistent reskin — no default branding slips through, and colors are self-contained and readable (dark backgrounds get light text).
Verification
swift buildclean; 243 XCTests pass.themeIDchange (the exact code path a Settings tap runs) retinted all modules in place — white cards → dark cards, coral → teal, Buddy → Bolt mark, light → dark chrome — with no relaunch and no default bleed-through.🤖 Generated with Claude Code