Give the bills overview one focus ring and readable autopay rows

Merged
GA
2mo ago
+92-14

Problem

Focus (WCAG 2.4.7). Outside the DS::* components, nothing on the Bills overview carried focus-ring. The row link, the detection banner's "Review them", each notice's "Manage" and the breadcrumb's "Home" fell back to Chrome's blue default outline. On a row, that outline hugged the link box: square corners, touching the date and the amount. The page also had three text-link styles: blue with a hover underline, grey to black, and DS::Link's underline at rest.

Autopay rows (WCAG 1.4.3). Autopay rows receded through opacity-70 on the whole row. In light mode that took text-secondary from 4.7:1 to about 2.7:1.

Change

  • The banner's "Review them", each notice's "Manage" and the pulse's "View calendar" are now DS::Link's default text link. The page has one text-link style: text-link, underlined, text-sm, with the DS ring. These links were text-xs before.
  • The row link carries focus-ring with rounded-lg and outline-offset-4. The link has no padding of its own, so an inset ring (-outline-offset-2, as in #3877's Next up items) would sit on the text. Pushing it 4px out puts it in the row's 12–16px padding: clear of the text and still inside the row.
  • The breadcrumb link gets focus-ring rounded-sm. That partial is shared, so every page's breadcrumbs gain the ring. It only shows on keyboard focus.
  • Autopay rows lose the opacity. The name and amount use text-secondary, and the sublines keep theirs. The trailing portal icon is now full strength too.
  • The bill notes line moves from text-subdued (about 2.7:1 on white) to text-secondary on every row. It was the one text node that would still fail on an autopay row with notes.

Validation

  • New controller tests, both red before the change:
    • Focus sweep. Every a and summary in main on a seeded overview must carry focus-ring, and the three text links must be DS text links. The sweep is what found the breadcrumb. Removing focus-ring from the row link turns it red again.
    • Autopay row. No opacity-70. The name, amount and notes use text-secondary, and a regular row keeps text-primary.
  • Tab-walk probe (throwaway system test, light and dark, measured as computed outline styles). Stops showing Chrome's default outline: 16 of 44 → 0 on the full worklist, and 9 of 30 → 0 on the banner page. Every stop now shows the DS ring.
  • Composited contrast of every text node in the autopay rows, from computed colours with opacity applied:
    • Light: 2.71:1 → 4.74:1.
    • Dark: 6.2:1 → 11.5:1.
    • The only node under 4.5 is the aria-hidden avatar initial in dark (3.78:1). It is decorative and the same on every row.
  • Out of scope, flagged: text-success "Paid" (green-700, about 4.3:1) and text-destructive (red-500, about 3.95:1) are under 4.5:1 on white on every row. Both are token values, not row styling.
  • bin/rails test: 10431 runs. The only error is the month-start ReportsControllerTest third-currency test, which fails on main on the 1st and 2nd of the month and is fixed by #3902.
  • Bills system tests: declare_and_pay_bill_test errors on this machine on main too. It types a %m/%d/%Y date into a day-first Chrome locale, and the first commit of #3885 fixes it. The other bills system tests pass.
  • erb_lint, rubocop and brakeman are clean.

Screenshots

From the ticket 13 audit harness (seeded on 2026-09-16), before on main f50c67017.

Keyboard-focused row (rest / hover / focus / active):
Row focus

Autopay row:
Autopay row

Text links (rest / hover / focus):
Text links

Notices card:
Notices

This month, 1440 and 375:
This month

Overlaps

#3885 edits the row link line in _occurrence.html.erb, and #3901 the rail. Whichever lands second resolves the conflict.

Summary by CodeRabbit

  • Accessibility
    • Added focus indicators to breadcrumb links and bill-row links.
  • Visual Updates
    • Autopay rows remain fully visible, with secondary text styling for bill names and amounts. Regular bill details use primary text styling, and notes retain secondary styling.
    • Updated calendar, bill-management, and review links to use consistent design-system styling.