codeant-ai-for-open-source[bot] commented on code in PR #41503:
URL: https://github.com/apache/superset/pull/41503#discussion_r3487702663
##########
superset-frontend/packages/superset-ui-core/src/components/ActionButton/index.tsx:
##########
@@ -41,6 +41,7 @@ export const ActionButton = ({
<span
role="button"
tabIndex={0}
+ aria-label={label}
Review Comment:
**Suggestion:** Using `label` as the accessible name is incorrect for many
existing call sites because `label` is also used as a test identifier (for
example values like `copy-col-${data.name}` and `pinned-schema-${schema}`), so
screen readers will announce technical IDs instead of user-facing action text.
Use a dedicated accessible text source (or fallback to plain-string `tooltip`)
so the announced name is human-readable and localized. [incomplete
implementation]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ SQL Lab tree actions announce non-human-readable identifiers.
- ⚠️ Copy column action accessible name mismatches tooltip text.
- ⚠️ Pinned schema button exposes internal IDs to screen readers.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Start Superset with this PR applied and open SQL Lab, then navigate to
the table
browser sidebar, which is implemented by `TableExploreTree` in
`superset-frontend/src/SqlLab/components/TableExploreTree/index.tsx:166-200`
and renders
nodes via `TreeNodeRenderer`.
2. In the table browser, focus a column node; the column renderer uses
`ActionButton` with
`label={"copy-col-${data.name}"}` in
`superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx:191-38`
(computed from the BulkRead range 160-279, where the `label` line is entry
33).
3. Inspect the `ActionButton` component definition in
`superset-frontend/packages/superset-ui-core/src/components/ActionButton/index.tsx:32-60`,
where the inner <span> sets `aria-label={label}` at line 44, so the
accessible name for
that button becomes the technical string `copy-col-${data.name}` rather than
the
human-facing tooltip text `t('Copy column name')` defined at
`TreeNodeRenderer.tsx:193`.
4. With a screen reader active, move keyboard focus to the copy-column and
pinned-schema
actions in the tree; for schema nodes, `ActionButton` labels like
`pinned-schema-${schema}`, `refresh-schema-${schema}`, and
`pin-schema-${schema}` are set
in `TreeNodeRenderer.tsx:248, 263, 275`, causing the screen reader to
announce these
internal ID-style strings instead of localized, descriptive action names,
confirming that
binding `aria-label` directly to `label` produces non-user-friendly
announcements for
multiple existing call sites.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=f952c12cd1fe41afa32f2e54c0d0a1e3&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=f952c12cd1fe41afa32f2e54c0d0a1e3&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<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/ActionButton/index.tsx
**Line:** 44:44
**Comment:**
*Incomplete Implementation: Using `label` as the accessible name is
incorrect for many existing call sites because `label` is also used as a test
identifier (for example values like `copy-col-${data.name}` and
`pinned-schema-${schema}`), so screen readers will announce technical IDs
instead of user-facing action text. Use a dedicated accessible text source (or
fallback to plain-string `tooltip`) so the announced name is human-readable and
localized.
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.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41503&comment_hash=674f336c2cef1f8bab66bff70048c405dd595285b0bc6b515e3733901d3a4db3&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41503&comment_hash=674f336c2cef1f8bab66bff70048c405dd595285b0bc6b515e3733901d3a4db3&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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]