Skip to content

feat(design-system): gate the dark: colour-override prohibition at zero (#264) - #1702

Merged
BigSimmo merged 3 commits into
mainfrom
claude/ds-a5-gate-ratchets
Aug 7, 2026
Merged

feat(design-system): gate the dark: colour-override prohibition at zero (#264)#1702
BigSimmo merged 3 commits into
mainfrom
claude/ds-a5-gate-ratchets

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Summary

  • Close the dark: colour-override prohibition (#264, design-system Track A5). GATES.md §3 listed it as planned with three live instances; a prohibition with no gate row is a suggestion, which is the failure mode that document exists to prevent. It is now implemented-blocking.
  • All three instances were the same shape — ring-1 ring-<colour>/20 dark:ring-<colour>/10 on a lux surface: panel in ui-primitives.tsx, the mobile FAB menu in dashboard-nav.tsx, and the PWA notice card. They are now --ring-highlight and --ring-glass, per-theme tokens carrying the value the override used to supply, so the utility no longer needs a variant. legacyPaletteUtilities (the ring-white/35 on the same PWA line) went to zero with them.
  • Both metrics are pinned at 0 in design-system-contract-baseline.json rather than ratcheted. The check asserts value <= baseline, so zero is a hard floor.
  • Docs updated to match: GATES.md §1 and §3, a dated evidence subsection in §4, and a TOKENS.md §5 row.

No visual change, measured rather than assumed. Tailwind emits color-mix(in oklab, <colour> N%, transparent) for ring-<colour>/N (verified by compiling Tailwind, not from memory), and mixing any colour with transparent yields that colour at alpha N regardless of colour space, so the token values are equivalent by construction. One trap worth recording: --ring-glass is deliberately literal white and not--neutral-0, which inverts to #060708 in dark — the obvious "use the token" refactor would have turned a white glass ring near-black in dark mode.

Deliberately not fixed here, triaged and rejected as unsafe for a minimal change: onePixelShadowSpreads (2) are 0 0 0 1px … inset border-substitutes whose conversion changes the box model, and rawColorLiterals (2) are a medication accent data fallback under a documented colour contract, not markup paint. Both remain ratcheted at their existing values.

RAG impact: no retrieval behaviour change — this touches two CSS custom properties, three class strings and documentation; nothing under src/lib/rag/**, clinical-search, retrieval-selection, ranking-config, answer-ranking, the eval harness or the golden fixture.

Verification

Baselined on the untouched base da66b283ebefore any edit, then re-run after:

  • npm run check:design-system-contract — exit 0. Before: legacy palette utilities 2; dark color overrides 3. After: legacy palette utilities 0; dark color overrides 0. Every other metric byte-identical, asserted programmatically before the baseline file was rewritten.
  • Mutation-verified the gate actually bites: reintroducing one dark:ring-white/10 fails with darkColorOverrides increased from 0 to 1, legacyPaletteUtilities increased from 0 to 1, plus both per-path assertions. Reverted.
  • npm run typecheck — exit 0
  • npm run lint — exit 0
  • npm run docs:check-links — exit 0, "docs link check passed: 1651 repo path references resolve."
  • npx prettier --check . — exit 0, "All matched files use Prettier code style!"
  • npx vitest run over every suite covering the changed surfaces — ckb-v2-token-contract, design-token-contract, theme, ui-primitives.dom, ui-v2-components.dom, ui-v2-answer-safety.dom, pwa-lifecycle.dom, tailwind-merge-config: Tests 99 passed (99) and Tests 139 passed (139), 238 total, zero failures.
  • Pre-edit baseline of the three known-on-Windows suites (HANDOVER §7): Tests 6 failed | 17 passed (23)pr-handoff-stop (5) and mode-nav-addon-slot (1). Unchanged by this diff, which touches neither a hook script nor any mode-nav path.

Verification not run: the full npm run test, and the reason is environmental rather than a pass I am claiming. Three separate infrastructure failures on this box, in order: run-heavy returned exit 75DATABASE_HEAVY_RUN_ADMISSION_BUSY (another worktree held the lease); a Node upgrade mid-run (24.18.0 → 24.19.0) killed a run and broke Prettier with "Could not determine Node.js install directory"; and the retry died at EPERM: operation not permitted, rename … clinical-kb-heavy-locks\…\owner.json before a single test executed. The first focused run also lost 4 of 8 files to [vitest-pool]: Timeout waiting for worker to respond; re-run with --no-file-parallelism they all pass, which is the known false-red-under-contention signature. CI's suite is the authority here. UI verification not run: Chromium under this contention produces false reds, not signal, and this change ships no visual delta by design.

Risk and rollout

  • Risk: low. Two new CSS custom properties, three class strings, one baseline file, and documentation. The visual equivalence is structural (mixing with transparent is colour-space-independent), not a judgement call, and the token contract suites pass.
  • Rollback: revert this commit. The tokens are additive and have no other consumers, so the revert restores the previous dark: variants exactly.
  • Provider or production effects: None. No OpenAI, Supabase, Railway or hosted-CI call was made.

Notes

🤖 Generated with Claude Code

…zero (#264)
GATES.md §3 listed "`dark:` colour override" as **planned** with three live
instances. A prohibition with no gate row is a suggestion, which is the failure
mode that document exists to prevent. This closes it.
All three instances were the same shape — `ring-1 ring-<colour>/20
dark:ring-<colour>/10` on a lux surface (`panel` in ui-primitives, the mobile FAB
menu in dashboard-nav, the PWA notice card). They are now `--ring-highlight` and
`--ring-glass`: per-theme tokens that carry the value the override used to
supply, so the utility no longer needs a variant. `legacyPaletteUtilities` (the
`ring-white/35` on the same PWA line) went to zero with them.
No visual change, and that is measured rather than assumed. Tailwind emits
`color-mix(in oklab, <colour> N%, transparent)` for `ring-<colour>/N`, and mixing
any colour with `transparent` yields that colour at alpha N regardless of colour
space, so the token values are equivalent by construction. `--ring-glass` is
deliberately literal white and NOT `--neutral-0`, which inverts to `#060708` in
dark and would have turned a white glass ring near-black.
Both metrics are pinned at 0 in the contract baseline rather than ratcheted. The
check asserts `value <= baseline`, so zero is a hard floor. Mutation-verified:
reintroducing one `dark:ring-white/10` fails with `darkColorOverrides increased
from 0 to 1` plus the matching per-path assertion. Every other metric was
asserted unchanged before the baseline was rewritten, so clearing one number
could not silently move another.
Deliberately not fixed here, having been triaged and rejected as unsafe for a
minimal change: `onePixelShadowSpreads` (2) are `0 0 0 1px … inset`
border-substitutes whose conversion changes the box model, and `rawColorLiterals`
(2) are a medication accent DATA fallback under a documented colour contract, not
markup paint.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@supabase

supabaseBot commented Aug 7, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitaiBot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in:24 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4c1d7625-f8bf-427e-a098-9c2e70483b4b

📥 Commits

Reviewing files that changed from the base of the PR and between ee6cc28 and 14aecca.

📒 Files selected for processing (7)
  • docs/design-system/GATES.md
  • docs/design-system/TOKENS.md
  • scripts/design-system-contract-baseline.json
  • src/app/globals.css
  • src/components/clinical-dashboard/dashboard-nav.tsx
  • src/components/pwa-lifecycle.tsx
  • src/components/ui-primitives.tsx

Comment @coderabbitai help to get the list of available commands.

@BigSimmo
BigSimmo enabled auto-merge (squash) August 7, 2026 15:22
@BigSimmo
BigSimmo merged commit 1797ba3 into mainAug 7, 2026
24 of 25 checks passed
@BigSimmo
BigSimmo deleted the claude/ds-a5-gate-ratchets branch August 7, 2026 15:38
Sign up for freeto 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

@BigSimmo