Give Bills' Next up strip a focus ring and one padding scale

Merged
GA
2mo ago
+18-5

Problem

On the Bills overview, the month pulse card's "Next up" strip had three problems:

  • Keyboard focus: tabbing through the items or the "View calendar" link showed the browser's default outline, not the DS focus ring. On an item, that outline ran over the next item.
  • Bleed: each item had a -mx-2 bleed. In the phone scroll strip, that clipped the first item's hover tint and made the hover areas of neighbouring items overlap.
  • Two hover cues: the items showed both a tint and an underline on hover.

The pulse card (p-5) and the awaiting-review banner (px-4 py-3) also used different padding from the other bg-container section cards.

Change

  • Next up items and the "View calendar" link use focus-ring. On the items the ring is inset (-outline-offset-2), because on phones the strip is overflow-x-auto and would clip an outline drawn outside the item.
  • The items drop -mx-2 and keep px-2, so each item's text stays inset within its own tint. The text now sits 8px in from the "Next up" label.
  • The tint is the only hover cue. group-hover:underline on the name is gone.
  • The pulse card and the awaiting-review banner use p-4. Inset row groups (p-1) and inset notes (p-3) are unchanged.

Screenshots

Before on the left, after on the right.

Keyboard focus on the first Next up item (desktop, light)
focus

Pulse card, desktop (light / dark)
pulse desktop

Pulse card, 375px (light / dark)
pulse phone

Awaiting-review banner, desktop (light / dark)
banner desktop

Awaiting-review banner, 375px (light / dark)
banner phone

The screenshots come from a throwaway system test with fixture bills and the clock set to mid-month.

Validation

  • bin/rails test: 10329 runs, 0 failures, 0 errors.
  • test/controllers/bills_controller_test.rb: the month pulse test now asserts focus-ring on the Next up items and the calendar link, and that -mx-2 and group-hover:underline are gone. It fails on main.
  • Bills system tests (bills_mobile, find_my_bills, declare_and_pay_bill): all pass except declare_and_pay_bill_test's "declare rent…" test, which raises the same date-dependent RecordNotFound on main's views.
  • erb_lint and rubocop on the touched files: clean. Brakeman: no warnings. No JS changed, so Biome doesn't apply.

Checked the open bills PRs (#3664, #3666, #3663, #3624, #3751): none touch these two views.

Summary by CodeRabbit

  • Accessibility
    • Added visible focus indicators to the calendar and bill links in the monthly “Next up” section, making keyboard navigation easier.
    • Bill names no longer gain an underline when their link is hovered.
  • Style
    • Adjusted spacing in the monthly pulse section and the awaiting-review banner for a more consistent layout.