From 14d7b43a8dd80e0f2bacdfa4e2e80de7a1771639 Mon Sep 17 00:00:00 2001 From: Fedo Hagge-Kubat Date: Mon, 2 Mar 2026 18:34:07 +0100 Subject: [PATCH 1/3] =?UTF-8?q?fix(a11y):=20WCAG=202.4.6=20=E2=80=94=20add?= =?UTF-8?q?=20descriptive=20headings=20and=20section=20labels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add visually-hidden h1 with dashboard name to Dashboard Header - Add visually-hidden h1 with chart name to Explore/Chart Header - Add visually-hidden h1 to Home page and ChartCreation page - Fix ChartCreation heading hierarchy (h3 → h2) - Add sr-only h2 section headings for Filters and Dashboard Content areas - All headings use clip/sr-only pattern for screen readers only Co-Authored-By: Claude Opus 4.6 --- .../DashboardBuilder/DashboardBuilder.tsx | 16 ++++++++++++++++ .../src/dashboard/components/Header/index.tsx | 13 +++++++++++++ .../components/ExploreChartHeader/index.tsx | 15 ++++++++++++++- .../src/pages/ChartCreation/index.tsx | 17 +++++++++++++++-- superset-frontend/src/pages/Home/index.tsx | 13 +++++++++++++ 5 files changed, 71 insertions(+), 3 deletions(-) diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx index a507c65318d..872f6c8d8a8 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx @@ -351,6 +351,18 @@ const StyledDashboardContent = styled.div<{ `} `; +const SrOnlyH2 = styled.h2` + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +`; + const ELEMENT_ON_SCREEN_OPTIONS = { threshold: [1], }; @@ -616,6 +628,8 @@ const DashboardBuilder = () => { return ( {isVerticalFilterBarVisible && ( + <> + {t('Filters')} { > {renderChild} + )} { {renderDraggableContent} + {t('Dashboard content')} {!editMode && !topLevelTabs && diff --git a/superset-frontend/src/dashboard/components/Header/index.tsx b/superset-frontend/src/dashboard/components/Header/index.tsx index 522a22f1eca..a478082edcc 100644 --- a/superset-frontend/src/dashboard/components/Header/index.tsx +++ b/superset-frontend/src/dashboard/components/Header/index.tsx @@ -177,6 +177,18 @@ const actionButtonsStyle = (theme: SupersetTheme) => css` } `; +const SrOnlyH1 = styled.h1` + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +`; + const StyledUndoRedoButton = styled(Button)` // TODO: check if we need this padding: 0; @@ -827,6 +839,7 @@ const Header = (): JSX.Element => { data-test-id={dashboardInfo.id} className="dashboard-header-container" > + {dashboardTitle || t('Dashboard')} css` color: ${theme.colorPrimaryText}; & > span[role='img'] { @@ -272,6 +284,7 @@ export const ExploreChartHeader: FC = ({ return ( <> + {sliceName || t('Explore chart')} ` font-size: ${fontSize}px; @@ -329,7 +341,8 @@ export class ChartCreation extends PureComponent< return ( -

{t('Create a new chart')}

+ {t('Create a new chart')} + {t('Choose a dataset')}} diff --git a/superset-frontend/src/pages/Home/index.tsx b/superset-frontend/src/pages/Home/index.tsx index e270fd9872c..a5cb4cc164a 100644 --- a/superset-frontend/src/pages/Home/index.tsx +++ b/superset-frontend/src/pages/Home/index.tsx @@ -76,6 +76,18 @@ interface LoadingProps { const DEFAULT_TAB_ARR = ['dashboards', 'charts']; +const SrOnlyH1 = styled.h1` + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +`; + const WelcomeContainer = styled.div` background: ${({ theme }) => theme.colorBgLayout}; .ant-row.menu { @@ -350,6 +362,7 @@ function Welcome({ user, addDangerToast }: WelcomeProps) { )} + {t('Home')} {WelcomeMessageExtension && } {WelcomeTopExtension && } {WelcomeMainExtension && } From 179d7b0d383948d274ae14855fc0f93260ccf374 Mon Sep 17 00:00:00 2001 From: Fedo Hagge-Kubat Date: Thu, 9 Apr 2026 21:19:18 +0200 Subject: [PATCH 2/3] fix(a11y): add Filters heading for both horizontal and vertical filter bar orientations --- .../components/DashboardBuilder/DashboardBuilder.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx index 872f6c8d8a8..a4fc9c5a4b2 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx @@ -521,10 +521,13 @@ const DashboardBuilder = () => { {!hideDashboardHeader && } {showFilterBar && filterBarOrientation === FilterBarOrientation.Horizontal && ( -