Skip to content

Conversation

@arthurgousset
Copy link
Collaborator

Summary

Fixes WCAG 1.3.1 (Info and Relationships) by adding descriptive aria-label attributes 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-label attributes 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: Added aria-label to sub-navigation <nav> and <ul role="menubar"> elements
  • Labels dynamically reflect the active main menu item (e.g., "Scuola sections", "Scuola categories")
  • No visual changes - purely accessibility enhancement

Test Plan

  • Verified fix locally with browser accessibility tools
  • Confirmed sub-navigation has aria-label="Scuola sections"
  • Confirmed menubar has aria-label="Scuola categories"
  • Tested keyboard navigation through menubar items
  • Verified navigation landmark can be distinguished from main site navigation

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)

Add descriptive aria-label attributes to the sub-navigation element
and its inner menubar to distinguish them from other navigation
landmarks on the page.

When a main menubar item (e.g., "Scuola") is active, a sub-menubar
appears below it. Previously, this created a third unlabeled navigation
landmark, making it difficult for screen reader users to identify its
purpose when navigating by landmarks.

Changes:
- Add aria-label="{item.label} sections" to sub-navigation element
- Add aria-label="{item.label} categories" to inner menubar
- Labels dynamically reflect the active main menu item

Impact:
Screen reader users can now distinguish the sub-navigation landmark
(e.g., "Scuola sections") from the main site navigation and quickly
locate category filtering options without exploring content.

Fixes WCAG 1.3.1 (Info and Relationships) - Level A
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.

2 participants