diff --git a/CHANGELOG.md b/CHANGELOG.md index e886e853..5bfc3363 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Stepping through comments with `n`/`p` is now re-announced to screen readers even when the move lands on the same position — e.g. wrapping around on a page with a single open comment, where the position text is identical each press. Previously the polite live region's text was unchanged, so NVDA/JAWS/VoiceOver stayed silent despite the move. - A reply draft typed into one comment thread no longer appears in every other thread. Drafts are now scoped to the thread they were written in: switching threads (with `n`/`p` or the prev/next buttons) shows each thread's own draft, an untouched thread stays empty, and returning to a thread restores the draft you left there. Drafts clear on submit and when you navigate to another page. - Comments from the previous page no longer briefly reappear after navigating to a page that shows none (e.g. Home): a now-superseded comment fetch that resolves after you've navigated away is dropped instead of repopulating the just-cleared list. Resolving or reopening a comment while a navigation is in flight likewise no longer writes the change into the next page's comment view. +- Accessibility: the active navigation link and the active "On this page" outline entry now expose `aria-current`, so screen readers announce which page and heading you're on (previously conveyed by color alone); copying a comment's share link is announced via a polite live region rather than only swapping the button icon; and the desktop navigation landmark now carries an accessible name ("Documentation"), distinct from the breadcrumb, table-of-contents, and mobile-navigation landmarks. ## [0.1.26] - 2026-06-21 diff --git a/packages/viewer/e2e/navigation.spec.ts b/packages/viewer/e2e/navigation.spec.ts index b6c0be26..b8a0e376 100644 --- a/packages/viewer/e2e/navigation.spec.ts +++ b/packages/viewer/e2e/navigation.spec.ts @@ -193,4 +193,22 @@ test.describe("Navigation", () => { await expect(aside.getByRole("link", { name: "Plugin Development" })).toBeVisible(); await expect(aside.getByRole("link", { name: "Advanced Topics" })).toBeVisible(); }); + + test("active nav link exposes aria-current=page", async ({ page }) => { + await page.goto("/getting-started/installation"); + + const aside = page.getByRole("complementary", { name: "Sidebar" }); + const active = aside.getByRole("link", { name: "Installation" }); + await expect(active).toHaveAttribute("aria-current", "page"); + + // A non-active leaf sibling under the same section must not carry it, + // confirming aria-current marks only the current page, not the whole branch. + const inactive = aside.getByRole("link", { name: "Configuration" }); + await expect(inactive).not.toHaveAttribute("aria-current", "page"); + }); + + test("desktop nav landmark has an accessible name", async ({ page }) => { + await page.goto("/"); + await expect(page.getByRole("navigation", { name: "Documentation" })).toBeVisible(); + }); }); diff --git a/packages/viewer/src/components/NavItem.svelte b/packages/viewer/src/components/NavItem.svelte index ebd5dde2..72e34fe3 100644 --- a/packages/viewer/src/components/NavItem.svelte +++ b/packages/viewer/src/components/NavItem.svelte @@ -46,6 +46,7 @@ {navigation.error} {:else if navigation.tree} -