Skip to content

fix: align docs search and repeated link accessible names #32

Description

@smiggleworth

Problem

Lighthouse 13.3.0 with axe-core 4.11.4 found two naming regressions on https://askrjs.com/docs/getting-started/.

1. Search trigger label mismatch

The docs search trigger renders visible text Search docs plus the visible shortcut ⌘ K, while its accessible name is forced to only Search docs with aria-label.

axe reports label-content-name-mismatch with serious impact because not all visible text inside the control is represented by its accessible name.

Source: src/pages/docs/search.tsx.

2. Identical "Overview" links have different purposes

The page exposes the same link text, Overview, for different destinations:

  • /docs/getting-started/overview
  • #overview
  • / from the site footer

axe reports identical-links-same-purpose with minor impact. The root footer link is the clearest ambiguity and should be named contextually, for example Home, rather than Overview.

Source: src/pages/site-footer.tsx and the docs navigation/TOC.

Required outcome

  • Keep the keyboard shortcut visible, but make it supplemental to the control name (for example, hide the shortcut glyph from the accessibility tree) or otherwise ensure the visible label and accessible name agree.
  • Give links with different destinations context-specific names so repeated visible text does not imply the same purpose.
  • Preserve the existing search dialog, focus, and Command/Control-K behavior.
  • Add focused semantic regression coverage where practical.

Acceptance criteria

  • The search trigger passes axe's label-content-name-mismatch rule and retains a concise accessible name.
  • The keyboard shortcut remains visible and functional.
  • The repeated-link audit passes with distinct, meaningful link names.
  • Search dialog keyboard/focus behavior remains unchanged on desktop and mobile.
  • A Lighthouse/axe rerun reports neither finding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fleaSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions