Skip to content

fix(a11y): add screen-reader headings for WCAG 2.4.6 (headings and labels) - #46395

Open
sadpandajoe wants to merge 7 commits into
masterfrom
ultraset-descriptive-page-headings-section-labels
Open

sadpandajoe wants to merge 7 commits into
masterfrom
ultraset-descriptive-page-headings-section-labels

Conversation

@sadpandajoe

Copy link
Copy Markdown
Member

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 — PageHeaderWithActions renders the chart/dashboard title as an editable input, the Home WelcomeContainer has none, and Chart Creation's only title is an <h3>.

This PR:

  • Adds a shared VisuallyHidden component (src/components/Accessibility) with an as prop, for content that is announced by assistive technology but not rendered visually.
  • Renders a visually hidden <h1> on Home ("Home"), Explore (the chart name, falling back to "Explore chart") and Dashboard (the dashboard title, falling back to "Dashboard").
  • Promotes Chart Creation's visible "Create a new chart" title from <h3> to <h1> (one heading, no hidden duplicate), styled with theme tokens to keep its previous size.
  • Adds visually hidden <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.
  • Scopes the two access-denial assertions in Chart.test.tsx to getAllByText, 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>:

Chart Creation after: "Create a new chart" title rendered as h1

Measured with getComputedStyle on 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:

  • Home: h1 "Home" (screen-reader-only)
  • Explore: h1 with the chart name (screen-reader-only)
  • Dashboard: h2 "Filters", h1 with the dashboard title, h2 "Dashboard content" (all screen-reader-only)
  • Dashboard with ?standalone=3: no accessible "Filters" heading (it sits in the hidden filter panel), h2 "Dashboard content"

TESTING INSTRUCTIONS

  1. Install a heading-outline tool (e.g. the HeadingsMap browser extension) or use a screen reader's headings list.
  2. Open the Home page: there is an h1 "Home".
  3. Open any chart in Explore: there is an h1 with the chart name.
  4. Open a dashboard with native filters and the vertical filter bar: there is an h1 with the dashboard title, a single h2 "Filters", and an h2 "Dashboard content".
  5. Switch the dashboard's filter bar to horizontal: still exactly one h2 "Filters".
  6. Open the same dashboard with ?standalone=3 (report mode, filter bar hidden): no "Filters" heading.
  7. Open Chart → + Chart (Create a new chart): the visible title "Create a new chart" is an h1 and looks the same as before.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
  • Introduces new feature or API
  • Removes existing feature or API
  • Notes:
    • Chart Creation's title is restyled with theme tokens (fontSizeLG, marginMD) to approximate the previous browser-default h3 size.
    • The dashboard h1 lives in the dashboard Header, so dashboards rendered with the header hidden (standalone/embedded, hideTitle) have no h1, as before.
    • Chart.test.tsx access-denial assertions use getAllByText(...).length > 0 because the chart name is now also in the hidden page heading.
    • The list pages (Dashboards, Charts, SQL Lab, Datasets) are not covered here.

🤖 Generated with Claude Code

…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>
@netlify

netlify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 71e5709
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6b0acd52752a8735d4645408
😎 Deploy Preview https://deploy-preview-46395--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the i18n Namespace | Anything related to localization label Nov 20, 2026
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.42%. Comparing base (a6662b6) to head (71e5709).
⚠️ Report is 2 commits behind head on master.

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     
Flag Coverage Δ
hive 33.63% <ø> (ø)
javascript 83.41% <100.00%> (+<0.01%) ⬆️
mysql 51.83% <ø> (ø)
postgres 51.85% <ø> (+<0.01%) ⬆️
presto 35.32% <ø> (ø)
python 88.81% <ø> (+<0.01%) ⬆️
sqlite 51.55% <ø> (ø)
unit 84.37% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codeant-ai-for-open-source

codeant-ai-for-open-source Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; standalone Explore is an embedded chart, so the host page owns the heading outline.

Assessed commit: 71e5709bc7b5

@aminghadersohi aminghadersohi left a comment

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.

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 richardfogaca left a comment

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.

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:

  1. 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.
  2. 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.

sadpandajoe and others added 3 commits November 25, 2026 13:24
…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

This branch has not been deployed

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

Labels

i18n Namespace | Anything related to localization size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants