Skip to content

fix(redesign): guard OS-light WCAG inks against explicit app-dark theme#588

Merged
HomenShum merged 2 commits into
mainfrom
fix/dark-theme-light-ink-guard
Jul 18, 2026
Merged

fix(redesign): guard OS-light WCAG inks against explicit app-dark theme#588
HomenShum merged 2 commits into
mainfrom
fix/dark-theme-light-ink-guard

Conversation

@HomenShum

Copy link
Copy Markdown
Owner

What

Examine-then-polish pass over the unified chat answer anatomy (canonical answer harness) before final presentation photos. Three root-caused fixes:

  1. Theme-mismatch ink bug (the big one). All eight @media (prefers-color-scheme: light) WCAG hardening blocks in primitives.css keyed off the OS scheme, but the app themes via data-redesign-theme. An OS-light user with the app toggled dark got near-black !important inks forced onto dark surfaces: invisible table headers ([class*="muted"] even matches Tailwind's bg-muted), unreadable code lines, vanished run-summary meta, silently darkened accent. Every selector in those blocks now carries :where(:not([data-redesign-theme="dark"])):where() adds zero specificity, so the light-mode cascade is byte-identical (verified by pixel-stable light captures).

  2. Markdown links rendered as terracotta pills. Streamdown links are <button class="text-primary underline">; the light block's [class*="primary"] substring shotgun force-filled them. Narrowed to bg-primary/rd-btn--primary + scoped link reset under .rd-answer-copy--markdown.

  3. Empty-quote evidence rows rendered an empty paragraph displacing the source label; quote now gated on content.

Evidence

docs/design/ui-contract/20260718-polish-chat-answer/ — before/after, light+dark, captured under the worst-case OS-light + app-dark combination that reproduces the bug. Dark before: table header + code line + run summary illegible. Dark after: all legible, accent restored.

Verification

  • npx tsc --noEmit — 0 errors
  • targeted suites (redesign + agents + convex/domains/redesign) — 505 passed, 0 failed
  • npx vite build — clean
  • No guard test pins the old selectors (grepped)

🤖 Generated with Claude Code

Three root-caused polish fixes found by examining the canonical answer
harness before presentation:

1. All eight @media (prefers-color-scheme: light) hardening blocks keyed
   off the OS scheme while the app themes via data-redesign-theme. An
   OS-light user with the app toggled dark received near-black !important
   inks on dark surfaces: invisible table headers ([class*="muted"] even
   matched Tailwind's bg-muted), unreadable code lines, vanished run-summary
   meta, darkened accent. Every selector in those blocks now carries
   :where(:not([data-redesign-theme="dark"])) - zero added specificity,
   so the light-mode cascade is byte-identical.

2. The light block's [class*="primary"] substring shotgun force-filled
   streamdown markdown links (<button class="text-primary underline">)
   into terracotta pills. Narrowed to bg-primary/rd-btn--primary and added
   a scoped link reset under .rd-answer-copy--markdown.

3. Evidence rows with an honestly-empty quote rendered an empty paragraph
   that displaced the source label; the quote is now gated on content.

Harness now imports the app Tailwind entry so captures show real chrome.
Evidence: docs/design/ui-contract/20260718-polish-chat-answer (before/after,
light+dark, captured under the worst-case OS-light + app-dark combination).

tsc clean, 505 targeted tests green, build clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@HomenShum
HomenShum enabled auto-merge (squash) July 18, 2026 22:17
@vercel

vercel Bot commented Jul 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
nodebench-ai Ready Ready Preview, Comment Jul 18, 2026 10:19pm

Request Review

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown

✅ Dogfood Visual QA Gate: PASSED

Check Status
Screenshots 7 captured (pass)
Walkthrough 9 chapters (pass)
Key Frames 9 extracted (pass)
Scribe Steps 8 how-to steps (pass)
Build success
Artifacts

Download the dogfood-evidence-8822ac8 artifact from the Actions tab for full screenshots, frames, and walkthrough video.


Generated by Dogfood QA Gate

@HomenShum
HomenShum merged commit 15b3cd5 into main Jul 18, 2026
17 checks passed
@HomenShum
HomenShum deleted the fix/dark-theme-light-ink-guard branch July 18, 2026 22:23
@github-actions

Copy link
Copy Markdown

Demo: walkthrough of the surfaces this PR changed is available as a workflow artifact (pr-demo-588) at https://github.com/HomenShum/NodeBenchAI/actions/runs/29663358190

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.

2 participants