Repository navigation
fix(theme): keep the anonymous surface light so dark has no seam (#953) - #957
Merged
Merged
Conversation
Closes #953. Decision (Clay, 2026-10-02): marketing stays light, pin the ground. With dark on, the marketing pages rendered their own fixed palette on the app's near-black ground — measured on `/`: body `rgb(22,17,13)` with sections at `rgb(255,255,255)`, `rgb(3,69,80)` and `rgb(232,246,249)` straight out of `features/marketing/theme.ts`. That palette is deliberate, documented as such in the file, and the one exception pinned in the literal ratchet (#819), so it is not getting a dark counterpart. Pinned in `useThemeSetting`, which is the single place both readers go through: ThemeBridge, which drives @scaffald/ui's provider, and InnerProvider, which stamps `<html data-theme>` and the page background. Pinning only the background would have left themed components rendering dark on a light page — the seam moved rather than closed. **The whole `(public)` group, not just the five marketing screens.** It also holds public profiles, job pages, reviews and teams, and `(public)/_layout.tsx` mounts `MarketingNav` above every one of them. A dark job page under a light-palette nav is the same seam in a smaller frame, so the anonymous surface stays light and the theme starts at the app proper. `/` reports `[]` segments and is covered explicitly. Verified against the running app with the flag on, a stored `dark` preference and a dark OS — every one of these would have been dark before: / data-theme=light body rgb(255,255,255) /terms data-theme=light body rgb(255,255,255) /dashboard → /auth data-theme=dark body rgb(22,17,13) So the boundary holds in both directions: the app proper still goes dark. `isLightOnlySurface` takes the segments rather than calling `useSegments`, so it is testable without a router and only one caller is coupled to routing. It matches the group rather than a path substring — `['(protected)', 'public']` is not the public group. Per .radium/app-expo.md: `useThemeSetting` now re-runs on navigation, but the value handed to ThemeProvider is a string that only changes when crossing the boundary, so the 134-consumer re-render cascade that doc warns about is not widened. 2151 tests, 0 failures (scf-core 1286, ui 714, app 98, schemas 53). Co-Authored-By: Claude Opus 5 <[email protected]>
This was referenced Oct 5, 2026
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.
Closes #953. Your call on the issue: marketing stays light, pin the ground.
What was wrong
With dark on, the marketing pages rendered their own fixed palette on the app's near-black ground. Measured on
/:features/marketing/theme.tsis deliberately not theme-aware — the file says so, and it is the one exception pinned in the literal ratchet (#819). So it is not getting a dark counterpart; the ground stops going dark instead.Where it is pinned, and why there
In
useThemeSetting. That is the single place both readers go through —ThemeBridge, which drives@scaffald/ui's provider, andInnerProvider, which stamps<html data-theme>and the page background.Pinning only the background would have moved the seam rather than closed it: themed components inside would still have rendered dark on a light page.
The whole
(public)group, not just the five marketing screens(public)also holds public profiles, job pages, reviews and teams, and(public)/_layout.tsxmountsMarketingNavabove every one of them. A dark job page under a light-palette nav is the same seam in a smaller frame.So the anonymous surface stays light and the theme starts at the app proper. That is slightly wider than "the marketing pages", and deliberately so — flagging it because it is a scope judgement, not a mechanical consequence of the decision.
/reports[]segments and is covered explicitly.Verified against the running app
Flag on, stored preference
dark, OSprefers-color-scheme: dark. Every one of these rendered dark before this change:data-theme/lightrgb(255,255,255)/termslightrgb(255,255,255)/dashboard→/authdarkrgb(22,17,13)The boundary holds in both directions — the app proper still goes dark, which is the half that would have been easy to break silently.
Notes
isLightOnlySurfacetakes the segments rather than callinguseSegments, so it is testable without a router and only one caller is coupled to routing. It matches the group, not a path substring:['(protected)', 'public']is not the public group, and there is a test for that..radium/app-expo.md:useThemeSettingnow re-runs on navigation, but the value handed toThemeProvideris a string that only changes when crossing the boundary — so the 134-consumer re-render cascade that doc warns about is not widened.pnpm prepushgreen.With this, every token-level and structural item in the dark-mode work is done. What remains for #840 is the per-screen pass, which needs a local Supabase.
🤖 Generated with Claude Code