rusackas opened a new pull request, #42096:
URL: https://github.com/apache/superset/pull/42096

   ### SUMMARY
   
   Continues the incremental `jsx-a11y` rollout (follows #42006, #42009, 
#42078) by turning on `no-static-element-interactions` as `error`. This rule 
flags static elements (`<div>`/`<span>`, no interactive role) that have an 
event handler — the theory being that if it's clickable, it should be 
operable/discoverable via a role.
   
   This rule's scope turned out much smaller than expected (7 violations, vs. 
154 for `prefer-tag-over-role`): most of the codebase's bare clickable `<div>`s 
already got `role="button"` in earlier passes, which exempts them from this 
rule entirely. What's left are genuinely non-interactive elements that only 
happen to carry an event handler:
   
   - **Pure event-boundary wrappers** (5 of 7): `<div>`/`<span>` whose only 
handler is `e.stopPropagation()`, used to stop a click/keydown from bubbling up 
to a parent's real handler (`ModalTrigger`'s modal-body wrapper blocking 
menu-nav keys, and three action-button containers in SQL Lab's 
`TreeNodeRenderer` blocking clicks from reaching the tree row's select/toggle 
handler). Adding a role here would be misleading — these elements don't do 
anything themselves.
   - **`TreeNodeRenderer`'s row div** (1 of 7): forwards clicks/keys to 
`node.select()`/`node.toggle()`, but it renders *inside* a `react-arborist` row 
that already supplies `role="treeitem"` and roving `tabIndex` — giving this 
inner div its own role would be a nested-interactive-role anti-pattern.
   - **Test scaffolding** (2 of 7): harness `<div onKeyDown={...}>` wrappers in 
`ModalTrigger.test.tsx` and `SqlEditorTabHeader.test.tsx` that exist purely to 
assert keydown doesn't leak past the component under test.
   
   All 7 are suppressed with an inline `eslint-disable-next-line` and a 
one-line comment explaining why, rather than restructured — restructuring any 
of these would either be misleading (event-boundary wrappers aren't 
interactive) or actively wrong (nested roles inside `react-arborist`'s own ARIA 
tree semantics).
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — no behavior or visual change; every fix is a suppression comment.
   
   ### 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 3 co-located Jest suites for the touched components 
(`ModalTrigger`, `SqlEditorTabHeader`, `TableExploreTree`) — 37 tests pass.
   - `pre-commit run` (prettier, oxlint, custom-rules, stylelint, 
type-checking) all pass on the changed-file set.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] 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]

Reply via email to