Skip to content

fix(nav): the admin sidebar styled the current page without announcing it - #415

Merged
catomean merged 1 commit into
mainfrom
fix/admin-sidebar-aria-current
Aug 31, 2026
Merged

fix(nav): the admin sidebar styled the current page without announcing it#415
catomean merged 1 commit into
mainfrom
fix/admin-sidebar-aria-current

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

All three of AdminSidebar's link sites passed an active flag into navLinkClass('sidebar', active) and none set aria-current — so the highlight existed only for people who can see it. Every other nav surface here (NavItem, BottomNav, MobileMenuNav, Breadcrumbs, DashboardMobileNav) already announced it correctly.

Fixed at the SSOT, not the call sites

navLinkClass returns a className and nothing else, which is what made "styled but silent" easy to write: the styling decision and the announcement lived in different places, so they could drift. navLinkProps returns both, and spreading it means they can't:

<Link href={x} {...navLinkProps('sidebar', active)} />

Deliberately not a blanket sweep

navLinkClass has other callers — chip, tab and segmented shapes in Tabs, FilterBar, ApprovalTabs and LocaleSwitcher. Those are buttons and tab controls where aria-selected is the correct attribute, not aria-current. Converting them would have been wrong in more places than it fixed, so navLinkClass stays for those.

Tests

Five on the helper, including one asserting its className is byte-identical to what navLinkClass returns for every shape and both states — so this cannot quietly restyle anything.

Typecheck clean, lint clean, 47 tests pass across the design suites.

Found by a fleet-wide navigation audit across 20 repos, which found the same one-straggler shape in aoz-housing, fleetcrown and vitareba.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XeELB8b3N4JrT2asYL9WvE

…g it

All three of AdminSidebar's link sites passed an `active` flag into
`navLinkClass('sidebar', active)` and none set aria-current, so the highlight
existed only for people who can see it. Every other nav surface in this app —
NavItem, BottomNav, MobileMenuNav, Breadcrumbs, DashboardMobileNav — already
announced it correctly.

Fixed at the SSOT rather than at the three call sites. `navLinkClass` returns
a className and nothing else, which is what made "styled but silent" easy to
write: the styling decision and the announcement lived in different places, so
they could drift. `navLinkProps` returns both, and spreading it means they
cannot:

  <Link href={x} {...navLinkProps('sidebar', active)} />

Deliberately NOT applied to every navLinkClass caller. The chip, tab and
segmented shapes are buttons and tab controls where `aria-selected` is the
correct attribute, not `aria-current` — a blanket sweep would have been wrong
in more places than it fixed. navLinkClass stays for those.

Five tests on the helper, including one asserting its className is byte-identical
to what navLinkClass returns for every shape and both states, so this cannot
quietly restyle anything.

Found by a fleet-wide navigation audit across 20 repos, which found the same
one-straggler shape in aoz-housing, fleetcrown and vitareba.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XeELB8b3N4JrT2asYL9WvE
@catomean
catomean merged commit d1b118d into main Aug 31, 2026
8 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