rusackas opened a new pull request, #42078: URL: https://github.com/apache/superset/pull/42078
### SUMMARY Continues the incremental `jsx-a11y` rollout (follows #42006, #42009) by turning on `prefer-tag-over-role` as `error`. This rule flags elements using ARIA `role="button"`/`role="img"` where a native HTML tag would give the same semantics for free, along with built-in keyboard operability, focus handling, and no need for manual `role`/`tabIndex`/`onKeyDown` wiring. **Applied across all 154 violations:** - The large majority: converted custom `<span>`/`<div role="button">` widgets to real `<button type="button">` elements, with a small CSS reset (`appearance/border/background/padding/font`) so they render identically to before. Where the base component already had a working `onKeyDown` handler for Enter/Space, it's now redundant and removed (native buttons fire `click` on both natively). - `ActionButton` (a shared, widely-reused component) was converted at its root, fixing dozens of call sites in one shot. - Icons.X components (`role="button"`/`role="img"`) that already had a matching `onClick` are auto-computed to `role="button"` by `BaseIconComponent` — the explicit prop was dead weight and removed. - A handful of genuinely custom widgets where no native tag fits (`ButtonGroup`'s `role="group"`, `CompactSelectPanel`'s `listbox`, virtualized-table headers, popover-managed dialogs, hover-only tooltip triggers) keep their ARIA role with an inline suppression comment explaining why. - Two `href="#"` anchor-as-button anti-patterns (deckgl `Legend`, table `Pagination`) became real `<button>`s, removing the need for `preventDefault()` hacks against anchor navigation entirely. - A couple of nested `role="button"` cases (inside an already-interactive `<a>`/`ModalTrigger` wrapper) were simply redundant and dropped. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A — no visual change; the CSS resets keep every converted control's appearance identical. ### TESTING INSTRUCTIONS - `cd superset-frontend && npx oxlint -c oxlint.json` — 0 errors with the rule set to `error`. - `npx tsc --noEmit -p tsconfig.json` — 0 errors (after a full `npm run plugins:build -- "*"` rebuild). - Ran the ~50 co-located Jest suites for every swept component (list pages, cards, dashboard grid components, explore controls, chart drill-by/drill-detail, SQL Lab, deckgl/table/pivot-table plugins) — all pass. A couple of tests that asserted implementation details of the old `role="button"` span/anchor markup (breadcrumb DOM-reuse quirk, `href="#"` `preventDefault()` regression tests) were updated to assert the underlying behavior instead. - `pre-commit run` (prettier, oxlint, custom-rules, stylelint, type-checking) all pass on the full changed-file set. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [x] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
