Repository navigation
fix(a11y): add screen-reader headings for WCAG 2.4.6 (headings and labels) - #46395
sadpandajoe wants to merge 7 commits into
Conversation
…bels) Give Home, Explore, Dashboard and Chart Creation a level-one page heading, and label the dashboard filter bar and content area with level-two section headings, through a shared VisuallyHidden component with an `as` prop. Chart Creation promotes its visible title from h3 to h1 instead of adding a hidden duplicate. The Filters heading renders once per orientation and not when the filter bar is hidden (report mode). Co-authored-by: Fedo Hagge-Kubat <fedo.hagge-kubat@aitema.de> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #46395 +/- ##
=======================================
Coverage 86.42% 86.42%
=======================================
Files 3183 3184 +1
Lines 222606 222616 +10
Branches 52996 53003 +7
=======================================
+ Hits 192378 192389 +11
Misses 26758 26758
+ Partials 3470 3469 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aminghadersohi
left a comment
There was a problem hiding this comment.
The Chart Creation style change also strips padding from the chart-type gallery headings; two test assertions no longer check the visible title.
…ions Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
richardfogaca
left a comment
There was a problem hiding this comment.
Looks good to me. The heading conditions for the filter bar hold up in both orientations and in report mode, and the earlier comments on the gallery h3 padding and the Chart.test assertions are addressed in the latest commit.
Two optional thoughts, neither blocking:
- With the vertical filter bar, the "Filters" h2 comes before the dashboard h1 in DOM order. Not a 2.4.6 failure and you already call it out, but it could be worth a follow-up if there is a cheap way to put the h1 first.
- FilterPopoverContent and SecureExtraHints each carry their own copy of the visually-hidden CSS; they could move to the new VisuallyHidden component in a follow-up.
The failing unit-tests check looks unrelated (a Python test-collection error, no Python changes here), so a re-run or a merge from master should clear it.
…ading Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e-page-headings-section-labels # Conflicts: # superset-frontend/src/pages/Chart/Chart.test.tsx
SUMMARY
Supersedes #39241.
Home, Explore, Dashboard and Chart Creation expose no page-level
<h1>, and the dashboard filter bar and content area have no section headings, so screen-reader users cannot navigate these pages by heading (WCAG 2.1 SC 2.4.6, Headings and Labels). No specific introducing change identified: these surfaces never rendered headings —PageHeaderWithActionsrenders the chart/dashboard title as an editable input, the HomeWelcomeContainerhas none, and Chart Creation's only title is an<h3>.This PR:
VisuallyHiddencomponent (src/components/Accessibility) with anasprop, for content that is announced by assistive technology but not rendered visually.<h1>on Home ("Home"), Explore (the chart name, falling back to "Explore chart") and Dashboard (the dashboard title, falling back to "Dashboard").<h3>to<h1>(one heading, no hidden duplicate), styled with theme tokens to keep its previous size.<h2>"Filters" for the dashboard filter bar — exactly one in either orientation, and none when the filter bar is hidden (report mode) — and<h2>"Dashboard content" for the dashboard grid.Chart.test.tsxtogetAllByText, since the chart name is now also in the hidden page heading.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
The new headings are screen-reader-only; Chart Creation is the only visible change.
After — Chart Creation with the title as
<h1>:Measured with
getComputedStyleon a build of this branch (SQLite with the examples DB), the title renders at 16px with 20px top/bottom margins, versus 16.38px with 16.38px margins for the browser-default<h3>it replaces (weight 500 and the 12px bottom padding are unchanged).Heading outline observed on the same build:
h1"Home" (screen-reader-only)h1with the chart name (screen-reader-only)h2"Filters",h1with the dashboard title,h2"Dashboard content" (all screen-reader-only)?standalone=3: no accessible "Filters" heading (it sits in the hidden filter panel),h2"Dashboard content"TESTING INSTRUCTIONS
h1"Home".h1with the chart name.h1with the dashboard title, a singleh2"Filters", and anh2"Dashboard content".h2"Filters".?standalone=3(report mode, filter bar hidden): no "Filters" heading.h1and looks the same as before.ADDITIONAL INFORMATION
🤖 Generated with Claude Code