Skip to content

feat(theme): re-enable dark mode behind a dev toggle, add the dark smoke pass, audit the redesign tokens in dark #833

Closed

Description

@thinkclay

Part of the redesign roadmap (#622). Sprint 2. The #622 comments call this "the largest hole": three redesign PRs changed theme-dependent colours and none has ever rendered dark.

Today

  • packages/scf-core/provider/theme/UniversalThemeProvider.tsx:163-166 — const resolvedTheme = 'light' as 'light' | 'dark' with a TODO: re-enable when dark mode is ready; the real resolution is commented out beneath it.
  • features/drawer/DrawerFooter.tsx:3,17 — the toggle import and hook are commented out.
  • scripts/audit/smoke-authed.mjs:76-93 — explains, correctly, why it has no dark pass: nothing in the app can render dark.
  • The prototype is light-only. Dark is ours to design: the warm-stone ground inverts to a warm near-black (the design-system readme's "deep warm near-black a shade below --color-neutral-900"), hairlines become lighter-than-ground, the amber attention ramp needs its 400 step on dark, and the chart colours tokenised in fix(ats): remove placeholder legal copy from the hire flow, tokenise chart colours #626 have never been seen.

Change

Part 1 of 2 (part 2 ships it, sprint 3):

  1. Restore theme resolution, gated: system/dark honoured only when a dev-only flag (EXPO_PUBLIC_DARK_MODE=1, or the drawer toggle in __DEV__) is set; production stays light.
  2. smoke-authed.mjs gains the dark pass it was written to gain (:217-223 already asserts which theme rendered) and runs it against the redesigned screens.
  3. Audit packages/ui/src/tokens/colors.ts dark values for: bg/border on the warm ground, primary[400]/attention[400] contrast, MetricBlock deltas, Lane overdue rows, ScreenHeader tip, chart series. File one follow-up per screen that reads wrong; fix token-level problems here.

Acceptance

  • With the flag set, the app renders dark on web and native; without it, light — verified by computed background colour, not by eye
  • smoke-authed.mjs --scheme dark produces captures whose data-theme (or equivalent) reads dark
  • A dark capture of every screen touched in sprints 1–2 is attached, with a list of what is wrong per screen

Activity

  1. added
    redesign
    on Sep 17, 2026
  2. thinkclay commented on Sep 17, 2026

    @thinkclay
    ContributorAuthor

    Moved to the long tail, no milestone (2026-09-17): dark mode is a nice-to-have (Clay, 2026-09-17). Still valid as written; pick it up when a release has room.

  3. thinkclay commented on Oct 2, 2026

    @thinkclay
    ContributorAuthor

    Part 1 merged in #954 (main 3a6a9466d). Leaving this open — two acceptance boxes are genuinely outstanding, both blocked on a local Supabase (Docker):

    • smoke-authed.mjs --scheme dark is implemented but not run. The flag parsing and the theme assertion are exercised; the pass itself needs an authenticated session.
    • The per-screen dark captures are not done.

    What landed: the resolution gated on EXPO_PUBLIC_DARK_MODE=1, verified three ways by computed background colour (flag on + system + dark OS → dark; flag on + explicit light → light; flag off + dark OS + stored dark → light), and the token-level half of the audit.

    The audit scored all 320 foreground/background pairs in both themes. 17 fail in dark and pass in light, filed as:

    So the per-screen pass may add less than this issue assumed: the ground, not the screens, is where the failures turned out to live.

  4. thinkclay commented on Oct 5, 2026

    @thinkclay
    ContributorAuthor

    Second acceptance box is now ticked, with evidence. The capture stack is back (Docker was simply not running on 2 Oct; the real faults were elsewhere and are filed), and smoke-authed.mjs --scheme dark ran end to end against a local stack with the seeded office user:

    ✓ session minted for [email protected]
    ✓ desktop-dark ats-applications / ats-metrics / ats-checks-admin / dashboard
    ✓ mobile-dark  ats-applications / ats-metrics / ats-checks-admin / dashboard
    --- rendered themes ---   8  theme: dark
    

    The theme assertion added in #954 stayed silent — every route stamped data-theme="dark" — and 12 dark captures were written (4 routes × 2 viewports, plus board and move-menu views).

    Three things the pass surfaced on its way, all filed:

    Third box — a dark capture of every screen touched in sprints 1–2 with per-screen findings — is #840's job now that the pass works; this run covers the four ATS routes it was written for.

  5. thinkclay commented on Oct 6, 2026

    @thinkclay
    ContributorAuthor

    Superseded by #840, shipped in #999: the gate is gone rather than put behind a dev toggle, the dark pass ran as a headless 33-route contrast sweep (findings fixed in #999 and Scaffald/ui#51–#55), and the token audit's results are those fixes. Nothing from this issue is left to do.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrontendUXredesign

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions