Skip to content

feat(theme): ship dark mode — gate off, system scheme followed on web and native, Appearance in Settings - #999

Merged
thinkclay merged 3 commits into
mainfrom
feat/ship-dark
Oct 6, 2026
Merged

thinkclay merged 3 commits into
mainfrom
feat/ship-dark

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Closes #840. Closes #970. Closes #967.

What ships

  • The gate comes off. isDarkModeEnabled() is true; system is the default, and the Appearance section of /dashboard/settings offers System / Light / Dark on the existing AppearanceThemeCard. The preference persists across reload (web) and relaunch (native). The marketing group stays light-only (Marketing pages render their light palette on the dark page ground #953), unchanged.
  • Web follows the OS without the half-dark page (Dark mode on web: SSR renders light and hydration keeps the server's styles, so the whole shell stays white #970). The OS scheme was read with matchMedia during render, so a dark-OS visitor hydrated against a server that can only say light; React regenerated the tree light while the provider's effect painted the ground dark. The scheme now starts as the server's light and moves to the real value in an effect after hydration, and follows the OS live. Measured before and after with a headless probe in both OS schemes: heading white on #16110d in both.
  • Native follows the OS again. InnerProvider pinned the native scheme with Appearance.setColorScheme(resolvedTheme) whenever the two disagreed; that override is per-process and outlived every JS reload, so a light set under an earlier preference kept useColorScheme() light for the rest of the session. System now clears the override ('unspecified'); only an explicit choice pins it, so alerts, keyboard and share sheet match the app.
  • Loading overlay (Loading overlay paints white before the theme resolves, and its label has no colour in dark #967) takes the themed ground and a themed label.
  • The dark sweep. 33 signed-in routes at 1440 and 390, headless Chromium in dark, every text node checked for contrast under 3:1 and every large light surface flagged. Fixed in this PR and in five @scaffald/ui releases underneath it (fix(button): the text and tonal variants read in dark ui#51–Refine dashboard news feed loading #55): pre-token hex literals across the profile forms, the vanity-URL and experience editors; columnsFromTanStack wrapping Office table cells in an uncoloured <Text> (black on the dark row); ATS admin columns memoised with [] so they kept the light first render; Button text and outline variants, selected Tabs, RichTextEditor, RadarChart and DeltaBadge on the light steps; community/job-card pills, links and the dispute tracker's tone map on light-only ramps.

Verification

  • Web: final sweep reports zero contrast or light-surface findings on the fixed routes. What remains and stays: the disabled "Save Changes" (white on primary[200], same in light — a ui filled/disabled finding, not dark), the disabled pagination ellipsis (exempt), and a mid-load capture of the phone Office route taken before the post-mount scheme flip.
  • Native: iPhone 17 Pro simulator, dev client. System follows the OS dark→light→dark live; Dark pins it; the preference and the session survive a relaunch; the Workers map renders dark on the classic style. Captures in docs/plans/redesign/shots-current/sim-dark--home.png and sim-dark--workers-map.png.
  • RELEASE-PROCESS.md gains "Open Home and the Workers map in dark appearance".
  • Unit: scf-core 778/778 (12 for the gate and resolver), ui 680/680, column adapter 6/6. Typecheck and literal ratchet clean (profile.hexColor ceiling 111 → 40).

Not done

  • The nightly Lighthouse and smoke jobs do not run both schemes. There is no nightly smoke job to extend; Lighthouse is untouched. Tracked separately if wanted.

Prepush

SKIP_PREPUSH=1: everything passed except the gated HTTP api tests, where 16 CCPA cases fail because the local edge runtime is serving another worktree's functions (the same environment failure as #989/#991 this week, per .githooks/README.md). Nothing in this PR touches the api.

🤖 Generated with Claude Code

thinkclay and others added 3 commits October 5, 2026 23:05
…he OS, Appearance in Settings

The build flag from #833 is gone: `isDarkModeEnabled()` is true, the
resolver defaults open, and the Appearance switch in the account menu
(#974) shows for everyone. Settings gains an Appearance section with the
three preview cards the ui package has carried since the tokens landed.

The blocking finding from the first dark pass (#970) was not a race and
not a stale consumer. With the OS in dark, `UniversalThemeProvider` read
`prefers-color-scheme` synchronously during render, so the client's first
render disagreed with the server's (which can only say light); React
regenerated the tree after the hydration mismatch and the regenerated tree
came out light, while InnerProvider's effect stamped `<html data-theme>`
dark and painted the body dark — a dark ground under a light shell, and
white names on light rows wherever something mounted late enough to read
the real value. Measured headless: OS dark rendered the ScreenHeader title
`#16110d` on white with `data-theme="dark"`; OS light with a stored dark
preference rendered it white on `#16110d`, because that path flips after
mount through state. The system scheme now starts as the server's light
and moves to the real value in an effect, like the stored preference
already did; it also follows the OS live. Same probe after: both cases
white on dark.

Also from that pass: the office ground was `colors.gray[50]` in a
module-level sheet (#970), and the two loading overlays' labels had no
colour, so "Loading…" was near-black on the dark ground (#967). The
overlay's first paint is light by design now — it is the server's render —
and lasts until hydration.

`DrawerFooter` goes: nothing rendered it since the account row took over
sign-out and the theme toggle. The release checklist asks for Home and
the Workers map in dark before a submit.

Closes #970, closes #967. Refs #840.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…k findings

On the simulator with the OS in dark and the preference on System, the app
rendered light. InnerProvider pinned the native scheme with
`Appearance.setColorScheme(resolvedTheme)` whenever the two disagreed, and
that override is per-process: a `light` set under an earlier preference
outlived every JS reload and kept `useColorScheme()` answering light. Now
System clears the override (`'unspecified'`) and only an explicit choice
pins it, so system surfaces — alerts, keyboard, share sheet — match the
app. Verified on an iPhone 17 Pro simulator: System follows the OS from
dark to light and back live, Dark pins it, the preference and session
survive a relaunch, and the Workers map renders dark (captures in
docs/plans/redesign/shots-current/sim-dark--*.png).

From the web dark sweep (33 routes at 1440 and 390, contrast-scanned):
the profile forms, the vanity-URL section and the experience editor
carried pre-token hex literals — `#414e62` slate on the dark card at
1.7:1, `#ffffff` cards under white text, Tailwind status greens and reds
— and go onto the tokens with the ramps' dark steps; the drawer's active
Notifications row and the news widget's link took `primary[600]` with no
dark step and read `text[theme].emphasis` now.

Refs #840.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…and the drawer

Second pass over the web dark sweep (#840), with four @scaffald/ui
releases underneath it (ui#51–#55: Button text and outline variants,
Table grid cells, RadarChart, DeltaBadge, RichTextEditor, selected Tabs):

- Office tables read black on the dark row. `columnsFromTanStack` wrapped
  every primitive cell in a react-native <Text> with no colour (added for
  the native stacked-view error, #768); the ui Table wraps primitives in
  its own themed <Text> on both paths now, so the adapter passes them
  through. The adapter test asserts the primitive comes back as itself.
- The ATS admin columns were memoised with `[]` while their cells read the
  theme, so they were built once — during the server's light first render
  — and stayed light. `t` is a dependency.
- Community "Joined"/"Verified" pills, job-card salary and match pills, the
  employer card's website link, the drawer's Edit profile link and the
  vanity-URL Edit link: light-only steps (success[600] on success[900] at
  2:1, primary[500]/[600] on the card at 2.6–2.8:1) step down the ramps or
  read text[theme].emphasis.
- The verification "Need help?" box and the dispute tracker's tone map
  used the 50/400/700 steps in both themes — a pale blue card on the dark
  page. Both read per theme now.

What the sweep still reports, and why it stays:
- "Save Changes" disabled: white on primary[200] at 1.74:1 — the ui
  filled/disabled treatment, the same in light; not a dark finding.
- Pagination "…" at 2:1 — disabled, exempt.
- A white off-canvas drawer and light "Loading…" text on the phone
  Office capture: taken mid-load, before the post-mount scheme flip of
  the #970 fix; the settled page is dark.

Refs #840.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@thinkclay
thinkclay merged commit 65e3634 into main Oct 6, 2026
10 checks passed
@thinkclay
thinkclay deleted the feat/ship-dark branch October 6, 2026 04:48
thinkclay added a commit that referenced this pull request Oct 6, 2026
… the cookie banner covering the phone frame (#1014)

* fix(audit): sweep both colour schemes, see clipped overflow, and stop the cookie banner covering the phone frame

The visual sweep for release 5 needs every route in light and dark at 1440
and 390. sweep-routes.mjs walked every route but only in light, waited a
fixed 1.5 s, and judged phone overflow by document width alone.
smoke-authed.mjs had the scheme pass and #998's ready-wait, but never set
cookie consent, so the banner covered the bottom fifth of every phone shot.

- lib/app-ready.mjs: one copy of the cookie-consent seed, #998's ready-wait,
  scheme parsing, and frame facts. Both scripts use it.
- sweep-routes.mjs: --scheme light|dark|both, colorScheme plus the stored
  preference, and the scheme in each filename. It expects light on the
  (public) group (LIGHT_ONLY_GROUP) and the requested theme everywhere else,
  checks the computed page ground as well as the data-theme stamp, and fails
  the run on a mismatch.
- `clipped`: visible elements whose right edge passes the viewport outside a
  horizontal scroller. hScroll misses content cut off by an overflow:hidden
  ancestor. On its first run it found the quiet-hours row on
  /dashboard/notifications/settings pushing "to" and the end field off-card.
- A page that half-loads and logs ERR_CONNECTION_* before the theme stamps
  is now the dead dev server (exit 97, #680), not a theme failure. The final
  exit goes through finish(), which re-checks the server.
- SWEEP_MODES=worker, for a seeded worker with no org.
- smoke-authed.mjs: seeds consent. The dark-pass hint no longer tells you to
  set EXPO_PUBLIC_DARK_MODE, which #999 removed. Headers no longer ask for
  `functions serve`; the stack serves `api` itself.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(audit): a tab strip 1px wider than the phone is not clipped content

The first full sweep flagged every Communities screen at 390: the folder-tab
strip measured 391px inside a horizontal scroller that overflowed by 1px, and
both the edge check and the scroller check used a 1px tolerance. Sub-pixel
rounding, not a cut. Any overflow-x: auto|scroll ancestor now exempts its
content, and the edge tolerance is 2px. Re-run: the four Communities false
positives are gone; EEO, Project hiring, HRIS, quiet hours and Connections'
Export CSV still flag, and each is a real cut in the capture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant