Skip to content

fix: dark-mode contrast for stock MUI components + self-explanatory spec tabs#9622

Merged
MarkusNeusinger merged 4 commits into
mainfrom
fix/dark-mode-spectabs
Jul 10, 2026
Merged

fix: dark-mode contrast for stock MUI components + self-explanatory spec tabs#9622
MarkusNeusinger merged 4 commits into
mainfrom
fix/dark-mode-spectabs

Conversation

@MarkusNeusinger

Copy link
Copy Markdown
Owner

Summary

  • Dark-mode contrast (audit 2026-07-08 High#4): the MUI palette is locked to light-mode hexes (decomposeColor rejects var(...) tokens — see palette.ts), so stock components rendered light-theme colors on dark backgrounds: unselected tab labels at ~2.1:1, near-invisible dividers, wrong skeleton/alert surfaces. MuiTab, MuiDivider, MuiSkeleton, and MuiAlert now carry styleOverrides wired to the CSS-var system (--ink-soft / --rule / --bg-elevated), and the two borderColor: 'divider' sx usages (SpecTabs, RelatedSpecs) use var(--rule).
  • Spec-detail tabs UX (High#5): index 0 starts open — Code tab on implementation pages, Spec tab on hub pages — instead of the all-collapsed start that hid the page's main content; the selected tab shows a small caret as the affordance for the click-to-collapse toggle; the quality tab reads "Quality 91" (short form "91" on xs) with an explanatory aria-label instead of an unexplained bare number.
  • Tabs a11y wiring (Low#1, same file): standard id/aria-controlsaria-labelledby pairing between tabs and panels via useId.
  • Tests: SpecTabs suite grown to 25 (default-open in both modes, collapse tracking, a11y pairing, labeled quality tab); two existing tests updated for the default-open behavior.

Note: default-opening the Code tab means tab_toggle open code is no longer fired for the initial state — expect the event mix on /plots analytics to shift toward close events for code.

Plan

agentic/audits/2026-07-08-product-ux.md (High#4, High#5, Low#1)

Test plan

  • yarn test (605 passed, SpecTabs 25/25), yarn type-check, yarn lint, yarn fm:check, yarn build — green
  • Browser, light + dark × desktop (~940px) + mobile (390px): unselected tab labels legible in dark; Code tab open by default with caret; tab switch moves the caret; second click collapses and fires tab_toggle close; quality tab shows "Quality 91" (desktop) / "★ 91" (mobile)
  • aria-selected/aria-controls/aria-labelledby verified in the live DOM

…pec tabs

MUI's palette must hold raw light-mode hexes (decomposeColor rejects CSS
vars), so stock components rendered light-theme colors on dark: unselected
tab labels at ~2.1:1, invisible dividers, wrong skeletons and alerts. MuiTab,
MuiDivider, MuiSkeleton and MuiAlert are now wired to the CSS-var system.

The spec-detail tabs also stop hiding the page's main content: index 0 (Code
in detail mode, Spec on hub pages) starts open, the selected tab shows a
collapse caret so the toggle behavior is discoverable, the quality tab reads
"Quality 91" with an explanatory aria-label instead of a bare number, and
tabs/panels got standard id/aria-controls wiring.

Audit 2026-07-08 High#4 + High#5 + Low#1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 9, 2026 22:01
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the frontend’s dark-mode visual consistency by routing a few stock MUI components through the app’s CSS-variable theme tokens, and refines the spec-detail tab UX/accessibility so the primary content is visible by default and tabs/panels have standard ARIA wiring.

Changes:

  • Add MUI styleOverrides for MuiTab, MuiDivider, MuiSkeleton, and MuiAlert to align stock components with the CSS-var theming system in dark mode.
  • Update SpecTabs to default-open index 0 (Code in detail mode / Spec in overview), add a caret affordance for the “click again to collapse” behavior, and wire id/aria-controlsaria-labelledby via useId.
  • Expand/update the SpecTabs test suite to cover default-open behavior, collapse tracking, and ARIA pairing.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
CHANGELOG.md Adds [Unreleased] entries for the dark-mode contrast fixes and SpecTabs UX/a11y updates.
app/src/theme/components.ts Adds component-level MUI theme overrides to use CSS vars for better dark-mode contrast.
app/src/sections/spec-detail/SpecTabs/SpecTabs.test.tsx Updates and grows tests for the new default-open, collapse, and ARIA behaviors.
app/src/sections/spec-detail/SpecTabs/md.tsx Extends TabPanel to support tab↔panel id wiring.
app/src/sections/spec-detail/SpecTabs/index.tsx Implements default-open tabs, caret affordance, and useId-based ARIA wiring; updates divider color token usage.
app/src/sections/spec-detail/RelatedSpecs.tsx Updates divider border color to the CSS-var rule token for dark-mode consistency.

Comment thread app/src/theme/components.ts
Comment thread app/src/sections/spec-detail/SpecTabs/md.tsx
…idden panels

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 9, 2026 22:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment on lines 19 to +20
<Collapse in={isOpen}>
<Box role="tabpanel" sx={{ pt: 2 }}>
<Box
Copilot AI review requested due to automatic review settings July 10, 2026 09:32
@MarkusNeusinger MarkusNeusinger merged commit b6ed976 into main Jul 10, 2026
10 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@MarkusNeusinger MarkusNeusinger deleted the fix/dark-mode-spectabs branch July 10, 2026 09:35
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