Skip to content

fix(a11y): WCAG 3.2.3 — add aria-labels to navigation landmarks#39244

Open
Aitema-gmbh wants to merge 2 commits intoapache:masterfrom
Aitema-gmbh:fix/wcag-3.2.3-consistent-navigation
Open

fix(a11y): WCAG 3.2.3 — add aria-labels to navigation landmarks#39244
Aitema-gmbh wants to merge 2 commits intoapache:masterfrom
Aitema-gmbh:fix/wcag-3.2.3-consistent-navigation

Conversation

@Aitema-gmbh
Copy link
Copy Markdown

SUMMARY

Implements WCAG 2.1 criterion 3.2.3 (Consistent Navigation, Level AA).

  • Add aria-label="Main navigation" to the primary header navigation (Menu.tsx)
  • Add aria-label="Page navigation" to the page-level sub-navigation (SubMenu.tsx)
  • Screen readers can now distinguish between navigation regions

TESTING INSTRUCTIONS

  1. Open any page with a screen reader
  2. Navigate by landmarks → "Main navigation" and "Page navigation" should be announced as distinct regions
  3. Verify both labels are present on all pages

ADDITIONAL INFORMATION

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 9, 2026

Code Review Agent Run #587846

Actionable Suggestions - 0
Additional Suggestions - 2
  • superset-frontend/src/features/home/Menu.tsx - 1
    • Hardcoded aria-label not translatable · Line 337-337
      The aria-label uses a hardcoded string, but per project standards, all user-facing text should be translatable. Other aria-labels in the codebase use t() for internationalization.
  • superset-frontend/src/features/home/SubMenu.tsx - 1
    • Missing translation for aria-label · Line 213-213
      The aria-label 'Page navigation' is a user-facing string for accessibility that should be wrapped with t() for internationalization, following rule [6516]. Other user-facing strings in this file, like tooltip titles, already use t().
      Code suggestion
       @@ -213,1 +213,1 @@
      -      <Row className="menu" role="navigation" aria-label="Page navigation">
      +      <Row className="menu" role="navigation" aria-label={t('Page navigation')}>
Review Details
  • Files reviewed - 2 · Commit Range: a70373a..a70373a
    • superset-frontend/src/features/home/Menu.tsx
    • superset-frontend/src/features/home/SubMenu.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot bot added change:frontend Requires changing the frontend design:accessibility Related to accessibility standards labels Apr 9, 2026
return (
<StyledHeader backgroundColor={props.backgroundColor}>
<Row className="menu" role="navigation">
<Row className="menu" role="navigation" aria-label="Page navigation">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The new aria-label is hardcoded in English, so it bypasses the app's i18n system and will be announced in the wrong language for non-English users. Wrap the label with the translation helper to keep accessibility text localized like other aria-label values in the codebase. [logic error]

Severity Level: Major ⚠️
- ❌ Home page sub-navigation landmark announced in English only.
- ⚠️ Inconsistent i18n for accessibility labels across UI.
Suggested change
<Row className="menu" role="navigation" aria-label="Page navigation">
<Row
className="menu"
role="navigation"
aria-label={t('Page navigation')}
>
Steps of Reproduction ✅
1. Configure a non-English locale in Superset so that localized UI strings are used; the
top navigation language controls are built from `useLanguageMenuItems` in
`superset-frontend/src/features/home/RightMenu.tsx:66-120`, which pulls labels from
`useLanguageMenuItems` in `superset-frontend/src/features/home/LanguagePicker.tsx:60-27`
where the aria-label itself is localized via `aria-label={t('Languages')}` at line 18.

2. Navigate to the Welcome (home) page rendered by
`superset-frontend/src/pages/Home/index.tsx:360-79`; this page renders the "Recents",
"Dashboards", "Charts", and "Saved queries" sections whose contents include the `SubMenu`
component.

3. Expand, for example, the "Dashboards" section so that `DashboardTable` mounts; in
`superset-frontend/src/features/home/DashboardTable.tsx:188-223` the component renders
`<SubMenu ... />`, which resolves to `SubMenuComponent` in
`superset-frontend/src/features/home/SubMenu.tsx:171-213`.

4. With a screen reader, navigate by landmarks on the loaded Home page: when the
navigation row rendered at `superset-frontend/src/features/home/SubMenu.tsx:213` (`<Row
className="menu" role="navigation" aria-label="Page navigation">`) is reached, the screen
reader announces the landmark as "Page navigation" in English, even though the surrounding
labels (e.g., tab labels localized with `t('Edited')`, `t('Created')` in
`ActivityTable.tsx:143-159`) respect the current locale; this contrast, along with other
localized aria-labels like `aria-label={t('Select color scheme')}` in
`plugins/plugin-chart-word-cloud/src/plugin/controls/ColorSchemeControl/index.tsx:318` and
`aria-label={t('Languages')}` in `LanguagePicker.tsx:18`, shows that this hardcoded
aria-label bypasses the established i18n pattern.
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/src/features/home/SubMenu.tsx
**Line:** 213:213
**Comment:**
	*Logic Error: The new `aria-label` is hardcoded in English, so it bypasses the app's i18n system and will be announced in the wrong language for non-English users. Wrap the label with the translation helper to keep accessibility text localized like other `aria-label` values in the codebase.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 9, 2026

Code Review Agent Run #8c37b6

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: a70373a..1360c8c
    • superset-frontend/src/features/home/Menu.tsx
    • superset-frontend/src/features/home/SubMenu.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend design:accessibility Related to accessibility standards size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant