fix(menubar): add aria-labels to sub-navigation landmarks #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes WCAG 1.3.1 (Info and Relationships) by adding descriptive
aria-labelattributes to the sub-navigation landmark and menubar.Issue: When navigating the Scuola page, screen reader users encounter three navigation landmarks, but only one has a distinguishing label. The third navigation (sub-menubar showing "Per chi insegna", "Per chi studia", etc.) lacks programmatic identification, forcing users to explore each landmark's content to find the filtering options.
Solution: Added dynamic
aria-labelattributes to both the<nav>element (aria-label="{item.label} sections") and its child menubar (aria-label="{item.label} categories"), following the existing pattern used in the main navigation.Changes
src/components/menubar/menubar.tsx: Addedaria-labelto sub-navigation<nav>and<ul role="menubar">elementsTest Plan
aria-label="Scuola sections"aria-label="Scuola categories"Evidence
View before/after screenshots, accessibility trees, and test recordings:
https://app.workback.ai/dashboard/issue/162/
Before: Three navigation landmarks, only one labeled
After: Sub-navigation clearly identified as "Scuola sections" with menubar labeled "Scuola categories"
WCAG Reference: 1.3.1 Info and Relationships (Level A)