Skip to content

Give every website and book nav landmark a distinct, localizable label - #14813

Open
cwickham wants to merge 2 commits into
mainfrom
feature/nav-landmark-labels
Open

Give every website and book nav landmark a distinct, localizable label#14813
cwickham wants to merge 2 commits into
mainfrom
feature/nav-landmark-labels

Conversation

@cwickham

Copy link
Copy Markdown
Member

Description

Closes #14376.

Website and book pages emit up to six <nav> landmarks. Before this PR, only the breadcrumbs had a label, and it was hardcoded English (aria-label="breadcrumb"). Assistive technology listed the rest as identical "navigation" entries, and axe flagged the pages under landmark-unique.

This PR gives each landmark a distinct label from a new set of language keys:

Landmark Label
Navbar navigation-main-label ("Main")
Sidebar Adaptive: "Main" when the site has no navbar, "Section" when it has one
Secondary/mobile nav strip navigation-secondary-label ("Secondary")
Previous/next page nav navigation-page-label ("Page")
Breadcrumbs (both copies) navigation-breadcrumbs-label ("Breadcrumbs")
Table of contents aria-labelledby on its existing localized heading ("On this page") — no new key

Authors can override any key with language: metadata, per document or site-wide.

Label wording

The default labels do not contain the word "navigation". Screen readers announce the landmark role after the label, so a label like "Main navigation" reads as "Main navigation, navigation". The ARIA Authoring Practices Guide says not to use the role as part of the label, and the WAI page-structure tutorial uses the bare label "Main" for a nav region. VoiceOver testing confirmed the double announcement with the longer wording.

Design notes

  • The two breadcrumb copies share one label. They hold identical links, and only one is in the accessibility tree at a time (one shows at lg and up, the other below). The APG also asks identical navigation sets to share a label.
  • The secondary nav keeps a label distinct from the sidebar. Both are visible together when the mobile sidebar is open.
  • The TOC label reuses the visible heading via aria-labelledby, which is the pattern the WAI tutorial recommends. The TOC nav can also hold the Other Formats / code-links / other-links sections. The label stays acceptable: everything in that nav is page-scoped.
  • The TOC change also applies to revealjs (same partial pattern, toc-slide.html).

Out of scope

Documentation

No documentation PR: the only user-facing change is the new language keys, and the docs already refer users to _language.yml itself as the reference for available keys (Document Language).

Testing

  • New smoke-all tests assert every label, the adaptive sidebar branch (with and without navbar), a language: override, and a custom toc-title in both html and revealjs.
  • Verified axe landmark-unique passes on navbar-only, sidebar-only, navbar+sidebar, and book sites, at desktop and narrow viewports, including with the mobile sidebar open. Also reviewed the in-page report from axe: output: document on the rendered site. These browser checks were manual; this PR does not add a Playwright case for them.
  • Verified the VoiceOver landmark rotor lists each landmark with a distinct name.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Claude Code
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

#14376)

New language keys navigation-{main,section,secondary,page,breadcrumbs}-label
label the navbar, sidebar (adaptive), secondary nav, prev/next page nav, and
breadcrumbs; the TOC nav is labelled by its localized heading via
aria-labelledby (html + revealjs). Defaults omit the word "navigation" per the
APG landmark-regions practice, since screen readers announce the role after
the label.

Note: all-schema-definitions.json also picks up the lagged cache-globals
schema from #14735 (regenerated artifacts trail schema changes by one build).
@posit-snyk-bot

posit-snyk-bot commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cwickham
cwickham marked this pull request as ready for review August 26, 2026 18:06
@cwickham
cwickham requested a review from cderv August 26, 2026 18:06
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.

a11y: navbar and sidebar nav landmarks have no aria-label (landmark-unique)

2 participants