Skip to content

fix(gui): close the hover-state AA gap left by the contrast audit (#235) - #244

Merged
jcast90 merged 1 commit into
mainfrom
fix/a11y-hover-contrast
Jul 11, 2026
Merged

fix(gui): close the hover-state AA gap left by the contrast audit (#235)#244
jcast90 merged 1 commit into
mainfrom
fix/a11y-hover-contrast

Conversation

@jcast90

@jcast90 jcast90 commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Follow-up to #235. That PR is a real improvement and its resting-surface numbers all check out — I recomputed every pair with the WCAG 2.1 relative-luminance formula and they hold (in two cases it understated its own gain). But its audit only walked resting backgrounds.

The gap

text-muted (#5b6579) clears AA on paper-base at 5.57:1. Then .popover-item:hover swaps the ground out from under it:

.item-sub sits on Ratio AA (4.5:1)
paper-base #fbf9f4 (resting) 5.57:1
paper-hover #d8cfb0 (hovering) 3.76:1
paper-pressed #bdb088 (pressed) 2.72:1

So it fails AA precisely while the user is hovering to read it — the one moment it has to be legible.

To be fair to #235: it improved that spot enormously. The pre-audit value scored 1.98:1 there. This just finishes the job.

The fix

Adds --color-text-muted-strong (#3a4254), applied to .item-sub on :hover and :active:

Ratio AA
on paper-hover 6.45:1
on paper-pressed 4.66:1

It is the same hex the prefers-contrast: more tier already uses for muted, so no new color enters the palette — and scoping it to the interaction state keeps the three-tier text hierarchy intact at rest, rather than flattening .item-sub to text-primary.

Annotation corrections

Three comments were off. They pass either way, but an audit trail nobody can trust is worse than none:

  • tokens.css: attached-fg is 5.02:1, not 4.94:1. human-fg is 5.17:1, not 5.22:1.

  • tokens.json _meta.overrides read:

    repoPrimaryFg #a43c32 (was #e65a4f, 5.17:1 on -primaryBg)

    which parses as the old value scored 5.17:1. It scored 2.85:1 — 5.17:1 is the new one. This note exists specifically to stop someone re-deriving tokens from the handoff and silently reverting the a11y fix; as written it invited exactly that. Now spelled NEW (ratio) replaces OLD (ratio) with a PASS/FAIL on each.

Verified

  • GUI vitest: 53 passed
  • vite build: clean
  • prettier --check: clean
  • Every ratio recomputed from the hex values, not copied from the source PR.

🤖 Generated with Claude Code

#235 fixed contrast on resting surfaces and is a real improvement, but its
audit only walked resting backgrounds. `text-muted` (#5b6579) clears AA on
paper-base at 5.57:1 — and then `.popover-item:hover` swaps the ground to
paper-hover (#d8cfb0), where it drops to 3.76:1. paper-pressed (#bdb088) takes
it to 2.72:1.

So `.item-sub` fails AA precisely while the user is hovering to read it, which
is the one moment it has to be legible. (#235 still improved that spot a lot —
it was 1.98:1 before.)

Adds --color-text-muted-strong (#3a4254) and applies it to `.item-sub` on hover
and active: 6.45:1 and 4.66:1, both clear AA. It's the same hex the
prefers-contrast tier already uses for muted, so no new color enters the
palette.

Also corrects three annotations so the next audit can trust them:
  - tokens.css: attached-fg is 5.02:1, not 4.94:1; human-fg is 5.17:1, not 5.22:1.
  - tokens.json `_meta.overrides` read "repoPrimaryFg #a43c32 (was #e65a4f,
    5.17:1 on -primaryBg)", which parses as though the OLD value scored 5.17:1.
    It scored 2.85:1; 5.17:1 is the new one. That note exists specifically to
    stop someone re-deriving from the handoff and reverting the a11y fix — as
    written, it invited exactly that. Now spelled `NEW (ratio) replaces OLD
    (ratio)`, with both ratios and a PASS/FAIL on each.

Every ratio recomputed with the WCAG 2.1 relative-luminance formula.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@jcast90
jcast90 merged commit 7bd5a2f into main Jul 11, 2026
3 checks passed
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.

1 participant