You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Aitema-gmbh (via GitHub)" <gi...@apache.org> on 2026/04/09 19:01:21 UTC
[PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Aitema-gmbh opened a new pull request, #39230:
URL: https://github.com/apache/superset/pull/39230
### SUMMARY
Implements WCAG 2.1 criterion 1.1.1 (Non-text Content, Level A).
- Add `aria-label` attributes to all icon-only buttons (Import, Edit, Delete, Favorites, Grid/List toggles)
- Add `role="img"`, `title`, and `aria-label` to chart SVG containers
- Set `aria-hidden="true"` on decorative status/error icons
- Add accessible names to alert status icons with tooltip labels
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — accessibility improvement, no visual changes
### TESTING INSTRUCTIONS
1. Open any dashboard or chart list page
2. Run axe DevTools → verify 0 violations for "Images must have alternate text" and "Buttons must have discernible text"
3. Navigate with screen reader → all icon buttons should announce their function
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
Part of a series of 16 individual WCAG 2.1 accessibility PRs. See also #38342 for the combined PR.
Funded by IMTB.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39230:
URL: https://github.com/apache/superset/pull/39230#issuecomment-4216763547
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "Aitema-gmbh (via GitHub)" <gi...@apache.org>.
Aitema-gmbh commented on code in PR #39230:
URL: https://github.com/apache/superset/pull/39230#discussion_r3232525865
##########
superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx:
##########
@@ -79,7 +79,7 @@ const ShareSqlLabQuery = ({
margin-right: 0;
}
`}
- icon={<Icons.LinkOutlined iconSize="m" />}
+ icon={<Icons.LinkOutlined iconSize="m" aria-hidden="true" />}
Review Comment:
Addressed in 196ed7c6 — removed aria-hidden so Icons.LinkOutlined exposes its auto-generated accessible name via BaseIcon. Resolving — thanks for the catch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #39230:
URL: https://github.com/apache/superset/pull/39230#discussion_r3060081302
##########
superset-frontend/src/features/alerts/components/AlertStatusIcon.test.tsx:
##########
@@ -0,0 +1,77 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { render, screen } from 'spec/helpers/testing-library';
+import AlertStatusIcon from './AlertStatusIcon';
+import { AlertState } from '../types';
+
+test('renders visually-hidden screen-reader text for Success state (alert)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Success} isReportEnabled={false} />,
+ );
+ expect(
+ screen.getByText('Alert triggered, notification sent'),
+ ).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Success state (report)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Success} isReportEnabled />,
+ );
+ expect(screen.getByText('Report sent')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Working state (alert)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Working} isReportEnabled={false} />,
+ );
+ expect(screen.getByText('Alert running')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Error state (report)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Error} isReportEnabled />,
+ );
+ expect(screen.getByText('Report failed')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Noop state', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Noop} isReportEnabled={false} />,
+ );
+ expect(screen.getByText('Nothing triggered')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Grace state', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Grace} isReportEnabled={false} />,
+ );
+ expect(
+ screen.getByText('Alert Triggered, In Grace Period'),
+ ).toBeInTheDocument();
+});
+
+test('sr-only span is visually hidden via CSS clip', () => {
+ const { container } = render(
+ <AlertStatusIcon state={AlertState.Success} isReportEnabled={false} />,
+ );
+ const srSpan = container.querySelector('span > span:last-child');
+ expect(srSpan).toBeInTheDocument();
+ // The span should have clip-based hiding styles applied via emotion/css
+ expect(srSpan).toHaveTextContent('Alert triggered, notification sent');
Review Comment:
**Suggestion:** The test named "visually hidden via CSS clip" never validates visual hiding; it only checks text content, so it will still pass if the sr-only styles are accidentally removed. Query the screen-reader text directly and assert that it is not visible to ensure the accessibility behavior is actually enforced. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ AlertStatusIcon sr-only text may become visually exposed.
- ⚠️ A11y regression in alerts status UI may escape tests.
```
</details>
```suggestion
const srSpan = screen.getByText('Alert triggered, notification sent');
expect(srSpan).toBeInTheDocument();
expect(srSpan).not.toBeVisible();
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Open the component implementation at
`superset-frontend/src/features/alerts/components/AlertStatusIcon.tsx:121-132`, where the
inner `<span>` containing `lastStateConfig.label` is styled with clip-based "sr-only" CSS
via the `css` prop (absolute positioning, 1px size, `clip: rect(0, 0, 0, 0)`, etc.).
2. Open the corresponding test file
`superset-frontend/src/features/alerts/components/AlertStatusIcon.test.tsx` and locate the
test `sr-only span is visually hidden via CSS clip` at lines 69–76; note that it queries
`container.querySelector('span > span:last-child')` and asserts only that the element
exists and has the expected text content, without asserting any visibility or style
properties.
3. Simulate a regression by removing or commenting out the sr-only CSS in
`AlertStatusIcon.tsx` (lines 121–132), for example by replacing the `css={css\`...\`}`
block on the inner `<span>` with `css={undefined}` so that the label span is no longer
visually clipped/hidden but remains in the DOM.
4. Run the frontend Jest tests for `AlertStatusIcon.test.tsx` (the file imports
`render`/`screen` from `spec/helpers/testing-library`, which is wired into the Jest test
harness); observe that the `sr-only span is visually hidden via CSS clip` test still
passes because it only checks that the screen-reader text `'Alert triggered, notification
sent'` is present in the DOM, not that it is visually hidden, confirming the logic gap
described in the suggestion.
```
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/features/alerts/components/AlertStatusIcon.test.tsx
**Line:** 73:76
**Comment:**
*Logic Error: The test named "visually hidden via CSS clip" never validates visual hiding; it only checks text content, so it will still pass if the sr-only styles are accidentally removed. Query the screen-reader text directly and assert that it is not visible to ensure the accessibility behavior is actually enforced.
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.
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39230&comment_hash=129abe58f36a809d05e4ff9530473fff016c6e5a08b571451de8a9a7f7deff96&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39230&comment_hash=129abe58f36a809d05e4ff9530473fff016c6e5a08b571451de8a9a7f7deff96&reaction=dislike'>👎</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "Aitema-gmbh (via GitHub)" <gi...@apache.org>.
Aitema-gmbh commented on code in PR #39230:
URL: https://github.com/apache/superset/pull/39230#discussion_r3232530777
##########
superset-frontend/src/components/Chart/Chart.test.tsx:
##########
@@ -71,6 +71,38 @@ test('shows backend error instead of loading spinner when datasource is still a
).toBeInTheDocument();
});
+test('chart container has role="img" and aria-label with vizType when no slice_name', () => {
+ render(
+ <Chart
+ {...baseProps}
+ chartStatus="success"
+ queriesResponse={[{ data: [{ value: 1 }] }]}
+ />,
+ );
+
+ const container = screen.getByRole('img');
+ expect(container).toBeInTheDocument();
+ expect(container).toHaveAttribute('aria-label', 'table chart');
+});
Review Comment:
Addressed in 09113cb8 — replaced getByRole('img') with getByLabelText so the tests verify accessible name without coupling to the role landing on the outer wrapper. Resolving — thanks for the catch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #39230:
URL: https://github.com/apache/superset/pull/39230#discussion_r3060087026
##########
superset-frontend/src/components/Chart/Chart.tsx:
##########
@@ -425,6 +434,8 @@ class Chart extends PureComponent<ChartProps, {}> {
data-test="chart-container"
height={height}
width={width}
+ role="img"
+ aria-label={chartAriaLabel}
Review Comment:
**Suggestion:** Assigning `role="img"` unconditionally makes the loading branch semantically an image too, which can suppress the spinner's live status semantics for assistive tech while data is loading. Only apply image semantics when the actual chart content is being shown. [logic error]
<details>
<summary><b>Severity Level:</b> Critical 🚨</summary>
```mdx
- ❌ Dashboard chart containers hide loading status from screen readers.
- ⚠️ Explore chart preview misrepresents loading charts as static images.
- ⚠️ Violates WCAG 1.1.1 non-text content accessibility requirements.
```
</details>
```suggestion
role={showSpinner ? undefined : 'img'}
aria-label={showSpinner ? undefined : chartAriaLabel}
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Open any dashboard with at least one chart tile, which renders the dashboard Chart
component at
`superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx:156-255`. This
component renders `<ChartContainer>` for the slice at
`gridComponents/Chart/Chart.tsx:194-249`.
2. Trigger a refresh of that chart so its Redux state `chartStatus` becomes `'loading'`
(for example by changing a dashboard filter or clicking the chart's refresh control). In
`gridComponents/Chart/Chart.tsx:107-113` `const isLoading = chartStatus === 'loading'` is
set and the same `chartStatus` is passed into `<ChartContainer>` at
`gridComponents/Chart/Chart.tsx:207-217`.
3. `ChartContainer` is a Redux-connected wrapper around `Chart` in
`superset-frontend/src/components/Chart/Chart.tsx` (see `ChartContainer.tsx:19-25`).
Inside `Chart.render()` at `components/Chart/Chart.tsx:352-377`, `isLoading` is computed
as `chartStatus === 'loading'` and `showSpinner` is `isLoading &&
!this.props.suppressLoadingSpinner`. While loading, the JSX at
`components/Chart/Chart.tsx:431-443` renders `<Styles ... role="img"
aria-label={chartAriaLabel}>` (lines 437-438) and, because `showSpinner` is true, the
spinner branch `this.renderSpinner(databaseName)` (defined at `Chart.tsx:312-325`) is
shown inside that container.
4. With a screen reader active, move focus to the chart region while the chart is still
loading. Because the container at `Chart.tsx:431-439` has `role="img"` and an `aria-label`
describing the final chart (built at `Chart.tsx:368-373` as `chartAriaLabel`), assistive
technology exposes this element as a labeled image and typically derives its accessible
name from `aria-label`, not from its inner text. The visible loading message `"Waiting on
%s"` / `"Waiting on database..."` from `renderSpinner()` (`Chart.tsx:313-315, 324`) is
therefore not announced as status, so users hear only the chart name and not that it is
currently loading. With the suggested change `role={showSpinner ? undefined : 'img'}` and
`aria-label={showSpinner ? undefined : chartAriaLabel}`, the container does not have image
semantics while the spinner is shown, allowing the loading text/spinner semantics to be
exposed correctly.
```
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/components/Chart/Chart.tsx
**Line:** 437:438
**Comment:**
*Logic Error: Assigning `role="img"` unconditionally makes the loading branch semantically an image too, which can suppress the spinner's live status semantics for assistive tech while data is loading. Only apply image semantics when the actual chart content is being shown.
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.
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39230&comment_hash=c6b0da2e02147ba350be4112e0abbadf76fb08d5e22ee1c2ca1fc4d17512bafa&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39230&comment_hash=c6b0da2e02147ba350be4112e0abbadf76fb08d5e22ee1c2ca1fc4d17512bafa&reaction=dislike'>👎</a>
##########
superset-frontend/packages/superset-ui-core/src/components/Icons/BaseIcon.tsx:
##########
@@ -47,21 +47,24 @@ export const BaseIconComponent: React.FC<
...rest
}) => {
const theme = useTheme();
- const whatRole = rest?.onClick ? 'button' : 'img';
- const ariaLabel = genAriaLabel(fileName || '');
+ const isDecorative = rest?.['aria-hidden'] === true || rest?.['aria-hidden'] === 'true';
+ const whatRole = isDecorative ? 'presentation' : (rest?.onClick ? 'button' : 'img');
Review Comment:
**Suggestion:** Assigning `role="button"` based only on the presence of a click handler creates an interactive ARIA role without keyboard semantics (`tabIndex` and key activation), so screen-reader users will hear a button that cannot be operated via keyboard. Keep the icon role as non-interactive here (or implement full keyboard button behavior in the same element) to avoid this broken interaction contract. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ VizTypeGallery search clear icon misrepresented as button control.
- ⚠️ Screen-reader users encounter inoperable button in Explore search.
```
</details>
```suggestion
const whatRole = isDecorative ? 'presentation' : 'img';
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Note BaseIconComponent role logic in
`superset-frontend/packages/superset-ui-core/src/components/Icons/BaseIcon.tsx:49-52`,
where `whatRole` is computed as `isDecorative ? 'presentation' : (rest?.onClick ? 'button'
: 'img')` and applied to the rendered `<span>`/icon via the `role={whatRole}` prop (lines
63–65 and 94–96).
2. See that all Ant Design icons use this BaseIconComponent via
`superset-frontend/packages/superset-ui-core/src/components/Icons/AntdEnhanced.tsx:330-334`,
which wraps each Antd icon with `<BaseIconComponent component={AntdIcons[key]}
fileName={key} {...props} />`, so any `onClick` passed to `<Icons.*>` flows into
`rest.onClick` for BaseIconComponent.
3. Observe an actual interactive icon usage in
`superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx:781`
(from Grep), where the chart search input suffix renders `<Icons.CloseOutlined
iconSize="m" onClick={stopSearching} />` without wrapping it in a `<button>` and without
`tabIndex` or keyboard event handlers; this icon is the "clear search" control visually.
4. Run the frontend, open the Explore view, and focus the "Visualization type" search
input that uses VizTypeGallery; after typing text, the close icon appears. With the
current BaseIconComponent code, that `<Icons.CloseOutlined>` element receives
`role="button"` solely because `onClick` is present, but it is not keyboard-focusable (no
`tabIndex`, no space/Enter key handler). A screen reader will announce it as a button
while keyboard users cannot activate it as a button, creating a broken ARIA interaction
contract. Changing `whatRole` to always be `'img'` (unless decorative) removes the
misleading `role="button"` and avoids this inaccessible behavior.
```
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/packages/superset-ui-core/src/components/Icons/BaseIcon.tsx
**Line:** 51:51
**Comment:**
*Logic Error: Assigning `role="button"` based only on the presence of a click handler creates an interactive ARIA role without keyboard semantics (`tabIndex` and key activation), so screen-reader users will hear a button that cannot be operated via keyboard. Keep the icon role as non-interactive here (or implement full keyboard button behavior in the same element) to avoid this broken interaction contract.
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.
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39230&comment_hash=80fa0fa1d9cf5d1b2eba294efaf163a342f9f3f64b2d06e84f8571d94c84b2a6&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39230&comment_hash=80fa0fa1d9cf5d1b2eba294efaf163a342f9f3f64b2d06e84f8571d94c84b2a6&reaction=dislike'>👎</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "Aitema-gmbh (via GitHub)" <gi...@apache.org>.
Aitema-gmbh commented on code in PR #39230:
URL: https://github.com/apache/superset/pull/39230#discussion_r3232529482
##########
superset-frontend/src/features/alerts/components/AlertStatusIcon.test.tsx:
##########
@@ -0,0 +1,77 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { render, screen } from 'spec/helpers/testing-library';
+import AlertStatusIcon from './AlertStatusIcon';
+import { AlertState } from '../types';
+
+test('renders visually-hidden screen-reader text for Success state (alert)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Success} isReportEnabled={false} />,
+ );
+ expect(
+ screen.getByText('Alert triggered, notification sent'),
+ ).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Success state (report)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Success} isReportEnabled />,
+ );
+ expect(screen.getByText('Report sent')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Working state (alert)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Working} isReportEnabled={false} />,
+ );
+ expect(screen.getByText('Alert running')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Error state (report)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Error} isReportEnabled />,
+ );
+ expect(screen.getByText('Report failed')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Noop state', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Noop} isReportEnabled={false} />,
+ );
+ expect(screen.getByText('Nothing triggered')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Grace state', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Grace} isReportEnabled={false} />,
+ );
+ expect(
+ screen.getByText('Alert Triggered, In Grace Period'),
+ ).toBeInTheDocument();
+});
+
+test('sr-only span is visually hidden via CSS clip', () => {
+ const { container } = render(
+ <AlertStatusIcon state={AlertState.Success} isReportEnabled={false} />,
+ );
+ const srSpan = container.querySelector('span > span:last-child');
+ expect(srSpan).toBeInTheDocument();
+ // The span should have clip-based hiding styles applied via emotion/css
+ expect(srSpan).toHaveTextContent('Alert triggered, notification sent');
Review Comment:
Addressed in 09113cb8 — replaced the brittle 'span > span:last-child' selector with getByText and asserted toHaveStyle({position:'absolute'}) so the test fails if the sr-only style is dropped. Resolving — thanks for the catch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #39230:
URL: https://github.com/apache/superset/pull/39230#discussion_r3455903406
##########
superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx:
##########
@@ -559,6 +560,7 @@ const SliceHeaderControls = (
{isFullSize && (
<Icons.FullscreenExitOutlined
style={{ fontSize: 22 }}
+ aria-label={t('Exit fullscreen')}
onClick={() => {
props.handleToggleFullSize();
Review Comment:
Yes — the flagged issue is **correct**.
`aria-label` gives the icon an accessible name, but it still isn’t keyboard-operable because it’s rendered as a plain clickable icon, not a real button. So keyboard users can’t tab to it or activate it with **Enter/Space**.
### Recommended fix
Use a semantic button wrapper, or add button semantics + keyboard handling. The cleanest option is to wrap it in a real `Button`/`button` and keep the icon decorative:
```tsx
{isFullSize && (
<Button
buttonStyle="link"
aria-label={t('Exit fullscreen')}
onClick={props.handleToggleFullSize}
>
<Icons.FullscreenExitOutlined aria-hidden="true" style={{ fontSize: 22 }} />
</Button>
)}
```
If you want to keep the icon itself clickable, then at minimum add:
- `role="button"`
- `tabIndex={0}`
- `onKeyDown` handling for `Enter` and `Space`
### Conclusion
So this should be fixed as part of the PR; `aria-label` alone is not enough for WCAG keyboard accessibility.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #39230:
URL: https://github.com/apache/superset/pull/39230#discussion_r3455900877
##########
superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx:
##########
@@ -559,6 +560,7 @@ const SliceHeaderControls = (
{isFullSize && (
<Icons.FullscreenExitOutlined
style={{ fontSize: 22 }}
+ aria-label={t('Exit fullscreen')}
onClick={() => {
props.handleToggleFullSize();
Review Comment:
@Aitema-gmbh would you be willing to assess/tackle this part?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #39230:
URL: https://github.com/apache/superset/pull/39230#issuecomment-4399003895
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 09113cb89ad3798d9a180204f220a56a27aaf306 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/69fcbd2edfe46700093c1fb5 |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-39230--superset-docs-preview.netlify.app](https://deploy-preview-39230--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
|<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DcrJDYAgEEDRXuYsihtGO7AMlkFJUAlOFGPsXfIv__BeCPHYAsEEUICKctdrfutSdWu5sLrMMcJETHrCuEtyF57ZGgz-eGaTtRitVqZBY7ETA-d8bHVtVQ_fDw) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-39230--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "Aitema-gmbh (via GitHub)" <gi...@apache.org>.
Aitema-gmbh commented on code in PR #39230:
URL: https://github.com/apache/superset/pull/39230#discussion_r3232527032
##########
superset-frontend/src/features/alerts/components/AlertStatusIcon.test.tsx:
##########
@@ -0,0 +1,77 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { render, screen } from 'spec/helpers/testing-library';
+import AlertStatusIcon from './AlertStatusIcon';
+import { AlertState } from '../types';
+
+test('renders visually-hidden screen-reader text for Success state (alert)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Success} isReportEnabled={false} />,
+ );
+ expect(
+ screen.getByText('Alert triggered, notification sent'),
+ ).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Success state (report)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Success} isReportEnabled />,
+ );
+ expect(screen.getByText('Report sent')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Working state (alert)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Working} isReportEnabled={false} />,
+ );
+ expect(screen.getByText('Alert running')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Error state (report)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Error} isReportEnabled />,
+ );
+ expect(screen.getByText('Report failed')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Noop state', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Noop} isReportEnabled={false} />,
+ );
+ expect(screen.getByText('Nothing triggered')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Grace state', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Grace} isReportEnabled={false} />,
+ );
+ expect(
+ screen.getByText('Alert Triggered, In Grace Period'),
+ ).toBeInTheDocument();
+});
+
+test('sr-only span is visually hidden via CSS clip', () => {
+ const { container } = render(
+ <AlertStatusIcon state={AlertState.Success} isReportEnabled={false} />,
+ );
+ const srSpan = container.querySelector('span > span:last-child');
+ expect(srSpan).toBeInTheDocument();
+ // The span should have clip-based hiding styles applied via emotion/css
+ expect(srSpan).toHaveTextContent('Alert triggered, notification sent');
Review Comment:
Addressed in 09113cb8 — the test now asserts toHaveStyle({position:'absolute'}) on the sr-only element so dropping the clip-based hiding rule fails the test. Resolving — thanks for the catch.
##########
superset-frontend/src/components/Chart/Chart.tsx:
##########
@@ -425,6 +434,8 @@ class Chart extends PureComponent<ChartProps, {}> {
data-test="chart-container"
height={height}
width={width}
+ role="img"
+ aria-label={chartAriaLabel}
Review Comment:
Addressed in 196ed7c6 — role and aria-label are now gated by !showSpinner, so the loading branch no longer hides spinner status semantics. Resolving — thanks for the catch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #39230:
URL: https://github.com/apache/superset/pull/39230#issuecomment-4282910182
Can we also check the existing tests to make sure they're using these new selectors if they are better than our current ones? Or would that be out of scope?
Also, I'm curious if there is any kind of linting rule we can turn on to enforce these in the future or be able to find them if they're missing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #39230:
URL: https://github.com/apache/superset/pull/39230#issuecomment-4282912740
Last but not least, it seems there's a lot of bot review comments you might want to address before we call this mergeable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39230:
URL: https://github.com/apache/superset/pull/39230#issuecomment-4403300221
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #39230:
URL: https://github.com/apache/superset/pull/39230#discussion_r3112507748
##########
superset-frontend/src/components/Chart/Chart.tsx:
##########
@@ -425,6 +434,8 @@ class Chart extends PureComponent<ChartProps, {}> {
data-test="chart-container"
height={height}
width={width}
+ role={showSpinner ? undefined : 'img'}
Review Comment:
`role="img"` is being applied to the top-level `Styles` chart container, which wraps the entire rendered visualization (including cases like table charts with real HTML content and other interactive descendants). `role="img"` is a leaf role and can cause assistive tech to treat all child content as non-interactive/presentational, potentially making table/interactive charts inaccessible. Consider avoiding `role="img"` on this wrapper and instead attaching the accessible name to the actual SVG/canvas element produced by the viz (or use a non-leaf role like `region` with `aria-label`/`aria-labelledby` if you just want a labeled container).
```suggestion
role={showSpinner ? undefined : 'region'}
```
##########
superset-frontend/src/components/Chart/Chart.test.tsx:
##########
@@ -71,6 +71,38 @@ test('shows backend error instead of loading spinner when datasource is still a
).toBeInTheDocument();
});
+test('chart container has role="img" and aria-label with vizType when no slice_name', () => {
+ render(
+ <Chart
+ {...baseProps}
+ chartStatus="success"
+ queriesResponse={[{ data: [{ value: 1 }] }]}
+ />,
+ );
+
+ const container = screen.getByRole('img');
+ expect(container).toBeInTheDocument();
+ expect(container).toHaveAttribute('aria-label', 'table chart');
+});
Review Comment:
These new tests assert `getByRole('img')` on the chart container, which couples the tests to the current `role="img"` approach. If the accessible name is moved to a more appropriate element (e.g., the rendered SVG/canvas) or the container uses a non-leaf role, these tests will fail even though accessibility may improve. Consider asserting on the accessible name via a label query (or targeting the specific rendered graphic element) rather than requiring the outer wrapper to be `role="img"`.
##########
superset-frontend/src/features/alerts/components/AlertStatusIcon.test.tsx:
##########
@@ -0,0 +1,77 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { render, screen } from 'spec/helpers/testing-library';
+import AlertStatusIcon from './AlertStatusIcon';
+import { AlertState } from '../types';
+
+test('renders visually-hidden screen-reader text for Success state (alert)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Success} isReportEnabled={false} />,
+ );
+ expect(
+ screen.getByText('Alert triggered, notification sent'),
+ ).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Success state (report)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Success} isReportEnabled />,
+ );
+ expect(screen.getByText('Report sent')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Working state (alert)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Working} isReportEnabled={false} />,
+ );
+ expect(screen.getByText('Alert running')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Error state (report)', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Error} isReportEnabled />,
+ );
+ expect(screen.getByText('Report failed')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Noop state', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Noop} isReportEnabled={false} />,
+ );
+ expect(screen.getByText('Nothing triggered')).toBeInTheDocument();
+});
+
+test('renders visually-hidden screen-reader text for Grace state', () => {
+ render(
+ <AlertStatusIcon state={AlertState.Grace} isReportEnabled={false} />,
+ );
+ expect(
+ screen.getByText('Alert Triggered, In Grace Period'),
+ ).toBeInTheDocument();
+});
+
+test('sr-only span is visually hidden via CSS clip', () => {
+ const { container } = render(
+ <AlertStatusIcon state={AlertState.Success} isReportEnabled={false} />,
+ );
+ const srSpan = container.querySelector('span > span:last-child');
+ expect(srSpan).toBeInTheDocument();
+ // The span should have clip-based hiding styles applied via emotion/css
+ expect(srSpan).toHaveTextContent('Alert triggered, notification sent');
Review Comment:
The test name suggests it's verifying the visually-hidden CSS, but it only checks text content and uses a very brittle structural selector (`span > span:last-child`) that can break if Tooltip/DOM structure changes. Consider selecting the SR-only element via a more stable query (e.g., `getByText(...).closest('span')`) and asserting the hiding styles using existing emotion/jest matchers (e.g., `toHaveStyleRule('clip', 'rect(0, 0, 0, 0)')`).
```suggestion
render(
<AlertStatusIcon state={AlertState.Success} isReportEnabled={false} />,
);
const srSpan = screen
.getByText('Alert triggered, notification sent')
.closest('span');
expect(srSpan).toBeInTheDocument();
expect(srSpan).toHaveStyleRule('clip', 'rect(0, 0, 0, 0)');
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #39230:
URL: https://github.com/apache/superset/pull/39230#discussion_r3060079352
##########
superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx:
##########
@@ -79,7 +79,7 @@ const ShareSqlLabQuery = ({
margin-right: 0;
}
`}
- icon={<Icons.LinkOutlined iconSize="m" />}
+ icon={<Icons.LinkOutlined iconSize="m" aria-hidden="true" />}
Review Comment:
**Suggestion:** Marking the only icon inside this icon-only button as `aria-hidden` removes the button's accessible name, so screen readers will announce it as an unlabeled control and accessibility checks for discernible button text will fail. Keep the icon exposed with a meaningful label (or alternatively add an `aria-label` on the button). [possible bug]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ SQL Lab copy-link button unlabeled for screen readers.
- ⚠️ WCAG 1.1.1/2.5.3 audits fail on SQL Lab.
- ⚠️ Keyboard-only users lose clear share query affordance.
```
</details>
```suggestion
icon={<Icons.LinkOutlined iconSize="m" aria-label={tooltip} />}
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Open SQL Lab's SQL Editor screen in a running Superset instance. This screen is
implemented by `superset-frontend/src/SqlLab/components/SqlEditor/index.tsx`, which at
line 23 (around lines 840–879 in the file) renders `<ShareSqlLabQuery
queryEditorId={queryEditor.id} />` into the SQL toolbar.
2. In the rendered UI, locate the "copy query link" control in the toolbar. This control
is produced by `ShareSqlLabQuery` in
`superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx`, where
`buildButton()` (lines 70–85) returns a `<Button>` with no textual children and only an
`icon` prop set: `icon={<Icons.LinkOutlined iconSize="m" aria-hidden="true" />}` at line
82.
3. Inspect this button using a screen reader (e.g., NVDA, VoiceOver) or the browser's
Accessibility/ARIA inspector. The `<Button>` component here receives `tooltip={tooltip}`
(line 76) but no `aria-label`, `aria-labelledby`, or visible text content; its only child
is the `<Icons.LinkOutlined>` element, which is marked `aria-hidden="true"` at line 82,
meaning assistive technologies ignore it for naming.
4. Observe that the button is exposed as a generic unlabeled button in the accessibility
tree (no name announced by the screen reader), causing WCAG 2.1 criterion 2.5.3/4.1.2
"Buttons must have discernible text" / "Images must have alternate text" checks to fail.
The existing Jest test at
`superset-frontend/src/SqlLab/components/ShareSqlLabQuery/ShareSqlLabQuery.test.tsx`
(lines 48–56, using `screen.getByRole('button')`) does not assert the accessible name, so
this a11y bug is not caught by automated unit tests.
```
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx
**Line:** 82:82
**Comment:**
*Possible Bug: Marking the only icon inside this icon-only button as `aria-hidden` removes the button's accessible name, so screen readers will announce it as an unlabeled control and accessibility checks for discernible button text will fail. Keep the icon exposed with a meaningful label (or alternatively add an `aria-label` on the button).
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.
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39230&comment_hash=d981020246b896e97da8261ab7d7618920ee85f6eb0de0eb61c03d8bea3b769a&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39230&comment_hash=d981020246b896e97da8261ab7d7618920ee85f6eb0de0eb61c03d8bea3b769a&reaction=dislike'>👎</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39230:
URL: https://github.com/apache/superset/pull/39230#issuecomment-4217232569
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #39230:
URL: https://github.com/apache/superset/pull/39230#discussion_r3060089586
##########
superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx:
##########
@@ -559,6 +560,7 @@ const SliceHeaderControls = (
{isFullSize && (
<Icons.FullscreenExitOutlined
style={{ fontSize: 22 }}
+ aria-label={t('Exit fullscreen')}
onClick={() => {
props.handleToggleFullSize();
Review Comment:
**Suggestion:** The fullscreen exit control is still implemented as a plain icon with only an `onClick`, so adding an `aria-label` alone does not make it keyboard-operable or semantically a button. This means keyboard and assistive-technology users still cannot reliably activate it. Add button semantics and keyboard handling (or use a real `Button`) while keeping the icon decorative. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ Keyboard users can't activate exit fullscreen icon control.
- ⚠️ Noncompliance with WCAG 2.1.1 Keyboard on dashboards.
```
</details>
```suggestion
role="button"
tabIndex={0}
aria-label={t('Exit fullscreen')}
onClick={() => {
props.handleToggleFullSize();
}}
onKeyDown={event => {
if (event.key === 'Enter' || event.key === ' ') {
event.preventDefault();
props.handleToggleFullSize();
}
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Render any chart header via `SliceHeader` at
`superset-frontend/src/dashboard/components/SliceHeader/index.tsx:107-115`, which includes
`<SliceHeaderControls handleToggleFullSize={handleToggleFullSize} isFullSize={isFullSize}
... />` at `index.tsx:78-103`.
2. Open the chart controls menu from the "More Options" button (a `<Button>` at
`SliceHeaderControls/index.tsx:46-55`), then activate the fullscreen menu item, which is
wired to `MenuKeys.Fullscreen` and calls `props.handleToggleFullSize()` in
`handleMenuClick` at `SliceHeaderControls/index.tsx:220-236`, causing `isFullSize` to
become `true`.
3. After `isFullSize` is `true`, `SliceHeaderControls` renders the exit control
`<Icons.FullscreenExitOutlined ... onClick={() => { props.handleToggleFullSize(); } } />`
at `SliceHeaderControls/index.tsx:561-567`, with `aria-label={t('Exit fullscreen')}` but
no `tabIndex` or keyboard handler.
4. At render time, `Icons.FullscreenExitOutlined` goes through `BaseIconComponent` in
`packages/superset-ui-core/src/components/Icons/BaseIcon.tsx:38-52`, which sets
`role='button'` when `onClick` is present but does not add `tabIndex` or key handling;
since the underlying Ant Design icon element is not focusable by default, tabbing through
the header skips this control and pressing Enter/Space never triggers
`handleToggleFullSize`, so keyboard-only users cannot activate this specific exit icon.
```
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx
**Line:** 563:565
**Comment:**
*Logic Error: The fullscreen exit control is still implemented as a plain icon with only an `onClick`, so adding an `aria-label` alone does not make it keyboard-operable or semantically a button. This means keyboard and assistive-technology users still cannot reliably activate it. Add button semantics and keyboard handling (or use a real `Button`) while keeping the icon decorative.
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.
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39230&comment_hash=8e695a01856e90d9fc2d0cbbe654483ec046722c237ccdf45a1e2a66f6abb844&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39230&comment_hash=8e695a01856e90d9fc2d0cbbe654483ec046722c237ccdf45a1e2a66f6abb844&reaction=dislike'>👎</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(a11y): WCAG 1.1.1 — add accessible names to charts, status icons, and icon buttons [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #39230:
URL: https://github.com/apache/superset/pull/39230#issuecomment-4773788406
Obviously a rebase is needed too... let me know if you want help with that, I can try to shepherd some of this forward if needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org