Skip to content

feat(viewer): accessibility pass — aria-current, copy-link SR feedback, named nav landmark (#544)#560

Merged
yumike merged 1 commit into
mainfrom
a11y-pass-544
Jun 22, 2026
Merged

feat(viewer): accessibility pass — aria-current, copy-link SR feedback, named nav landmark (#544)#560
yumike merged 1 commit into
mainfrom
a11y-pass-544

Conversation

@yumike

@yumike yumike commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Resolves the three grouped low-severity accessibility items in #544. All changes are additive ARIA/markup — existing visual cues are unchanged, no new dependencies.

Changes

  • aria-current on active nav & TOC itemsaria-current="page" on the active navigation link (NavItem.svelte) and aria-current="true" on the active "On this page" outline entry (TocSidebar.svelte). Screen readers now announce which page and heading you're on instead of relying on color alone. Inactive items omit the attribute entirely.
  • Copy-link screen-reader feedback — the comment "Copy link" button now announces success through a visually-hidden polite live region ("Link copied"), alongside the existing icon swap. Mirrors the existing comment-nav live-region pattern; no visible toast.
  • Named desktop nav landmark — the desktop navigation <nav> gains aria-label="Documentation", distinct from the breadcrumb, table-of-contents, and mobile-navigation landmarks (which are mutually exclusive with it in the a11y tree, so no same-name collision).

Tests

  • Component tests: TOC aria-current (active/inactive/none), and the copy-link announcement including its 1500ms auto-reset (deterministic via fake timers).
  • Playwright e2e: active-nav aria-current="page" (with a leaf-sibling negative control) and the named "Documentation" landmark.
  • Full viewer unit suite (561) and the affected e2e specs pass; svelte-check clean.

Closes #544

🤖 Generated with Claude Code

…k, named nav landmark (#544)

Three additive accessibility affordances in the viewer, all leaving the existing
visual cues in place:

- aria-current="page" on the active navigation link and aria-current="true" on
  the active "On this page" outline entry, so screen readers announce which page
  and heading you're on instead of relying on color alone. Inactive items omit
  the attribute entirely.
- The comment "Copy link" button now announces success through a visually-hidden
  polite live region ("Link copied"), in addition to the existing icon swap.
- The desktop navigation landmark gains an accessible name ("Documentation"),
  distinct from the breadcrumb, table-of-contents, and mobile-navigation
  landmarks (which are mutually exclusive with it in the a11y tree).

Tests: component tests for the TOC attribute and the copy-link announcement
(including its 1500ms auto-reset, via fake timers), plus Playwright e2e for the
active-nav aria-current and the named landmark.

Closes #544

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@yumike yumike merged commit 18a1256 into main Jun 22, 2026
18 checks passed
@yumike yumike deleted the a11y-pass-544 branch June 22, 2026 08:17
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.

Accessibility pass: aria-current on nav/TOC, copy-link SR feedback, named nav landmark

1 participant