✨ [scanner] fix: add ARIA labels and keyboard navigation to modal components#19343
Conversation
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
👋 Hey @clubanderson — thanks for opening this PR!
This is an automated message. |
|
🐝 Hi @clubanderson! I'm Trusted users — org members and contributors with write access — can mention Automation may take a moment to start, and follow-up happens through workflow activity rather than chat replies. |
There was a problem hiding this comment.
Pull request overview
This PR targets accessibility scanner findings by improving ARIA labeling and keyboard interaction for modal-related UI components (table rows, key/value sections, and the base modal shell). Build/lint are expected to be validated by CI on the PR.
Changes:
- Make clickable table rows keyboard-focusable and attempt to improve screen reader announcement.
- Add explicit ARIA labeling for an icon-only copy action in KeyValueSection.
- Add keyboard handlers and presentation roles around the BaseModal backdrop and header icon buttons.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| web/src/lib/modals/TableSection.tsx | Adds interactive semantics to clickable table rows (role/tabIndex/onKeyDown). |
| web/src/lib/modals/KeyValueSection.tsx | Adds aria-label for copy button and additional keyboard handlers for link/copy actions. |
| web/src/lib/modals/BaseModal.tsx | Adds presentation roles and new keyboard handlers for backdrop and header buttons. |
| {...(onRowClick ? { | ||
| role: 'button' as const, | ||
| tabIndex: 0, | ||
| onKeyDown: (e: React.KeyboardEvent) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onRowClick(row) } }, | ||
| } : {})} |
- Remove role="presentation" from backdrop divs with onClick handlers (causes axe-core violations for interactive elements with presentational role) - Remove redundant onKeyDown handlers from button elements (HTML buttons already handle Enter/Space natively) - Keep all aria-label attributes (valid accessibility improvements) This should resolve the "Accessibility Tests" CI failures. Signed-off-by: clubanderson <club@redhat.com>
…tion Buttons handle Enter/Space natively - redundant onKeyDown handlers are unnecessary and add code bloat without accessibility benefit. Signed-off-by: clubanderson <club@redhat.com>
|
Fixes pushed to branch
These changes should resolve the "Accessibility Tests" CI failures. The |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
|
Post-merge build verification passed ✅ Both Go and frontend builds compiled successfully against merge commit |
Fixes #19339
Fixes #19340
Summary
Adds missing ARIA labels and keyboard navigation support to modal components and interactive elements, fixing two accessibility issues identified by the Auto-QA scanner.
Changes
KeyValueSection.tsx
aria-label="Copy to clipboard"to icon-only copy buttonTableSection.tsx
role="button"to clickable table rowsBaseModal.tsx
role="presentation"to backdrop layersFiles with no changes needed
Testing
Accessibility Compliance
All changes follow WCAG 2.1 guidelines: