Skip to content

fix(theme): live switch reskins every module + readable accent text - #6

Open
nseldeib wants to merge 1 commit into
mainfrom
fix/theme-live-switch-consistency
Open

fix(theme): live switch reskins every module + readable accent text#6
nseldeib wants to merge 1 commit into
mainfrom
fix/theme-live-switch-consistency

Conversation

@nseldeib

Copy link
Copy Markdown
Collaborator

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 Palette enum, which reads ThemeStore.shared.current. On a live switch only the theme-observing screen roots (Today, Settings, …) re-ran their body, 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 on themeStore.themeID (.id(...)) 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 (tab bar, keyboard, scroll backgrounds) matches the dark themes.
  • New onAccent token — one per theme (white on the light themes, near-black on the dark themes whose accents are light). Replaced hardcoded .white on 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 build clean; 243 XCTests pass.
  • Live in-app switch confirmed in the simulator: a runtime themeID change (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

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>
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
otterpace Ready Ready Preview, Comment Jul 16, 2026 3:12pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant