Skip to content

✨ [scanner] fix: add ARIA labels and keyboard navigation to modal components#19343

Merged
clubanderson merged 6 commits into
mainfrom
scanner/fix-19339
Jun 21, 2026
Merged

✨ [scanner] fix: add ARIA labels and keyboard navigation to modal components#19343
clubanderson merged 6 commits into
mainfrom
scanner/fix-19339

Conversation

@clubanderson

Copy link
Copy Markdown
Collaborator

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

  • Added aria-label="Copy to clipboard" to icon-only copy button
  • Added keyboard support (Enter/Space) to link buttons and copy button

TableSection.tsx

  • Added role="button" to clickable table rows
  • Keyboard navigation (Enter/Space) was already present, now properly announced by screen readers

BaseModal.tsx

  • Added role="presentation" to backdrop layers
  • Added keyboard support (Enter/Space) to backdrop click handlers
  • Added keyboard support to back/close icon-only buttons

Files with no changes needed

  • UtilitySections.tsx: CollapsibleSection already uses Button component (keyboard accessible)
  • PodDrillDown.tsx: Tab buttons have text labels (self-labeling, no aria-label needed)
  • ProjectNode.tsx: Image already has alt text
  • ModalRuntime.tsx, ConfirmDialog.tsx: Use Button components (keyboard accessible)

Testing

  • Verified buttons with text labels don't need aria-label (self-labeling)
  • Verified Button components handle keyboard automatically
  • Added keyboard handlers only where missing (non-button clickable elements)

Accessibility Compliance

All changes follow WCAG 2.1 guidelines:

  • Icon-only buttons have aria-label
  • Clickable non-button elements have role, tabIndex, and onKeyDown
  • Keyboard users can navigate and activate all interactive elements

…ection

- Add aria-label to copy button (icon-only button needs label)
- Add keyboard support (Enter/Space) to link buttons
- Add keyboard support to copy button

Fixes #19339
Fixes #19340

Signed-off-by: hive-scanner <scanner@kubestellar.io>
…rows

- Add role="button" to clickable table rows
- Keyboard navigation already had Enter/Space support
- This ensures screen readers properly announce interactivity

Fixes #19339
Fixes #19340

Signed-off-by: hive-scanner <scanner@kubestellar.io>
- Add role="presentation" to backdrop layers
- Add keyboard support (Enter/Space) to backdrop click handlers  
- Add keyboard support to back/close icon buttons
- Ensures modals are fully keyboard accessible

Fixes #19339
Fixes #19340

Signed-off-by: hive-scanner <scanner@kubestellar.io>
Copilot AI review requested due to automatic review settings June 21, 2026 09:07
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Jun 21, 2026
@netlify

netlify Bot commented Jun 21, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit 351c67f
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a37b6c6b9eca200080d8c92
😎 Deploy Preview https://deploy-preview-19343.console-deploy-preview.kubestellar.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign eeshaansa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @clubanderson — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@github-actions

Copy link
Copy Markdown
Contributor

🐝 Hi @clubanderson! I'm kubestellar-hive[bot], an automation bot for this repo.

Trusted users — org members and contributors with write access — can mention @kubestellar-hive in a comment to trigger repo automation.
On issues, that mention queues an automated fix attempt. On pull requests, it records extra context for existing automation.
This is not an interactive Q&A bot, so mentions should be treated as requests for automation rather than a conversation.

Automation may take a moment to start, and follow-up happens through workflow activity rather than chat replies.

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 122 to 126
{...(onRowClick ? {
role: 'button' as const,
tabIndex: 0,
onKeyDown: (e: React.KeyboardEvent) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onRowClick(row) } },
} : {})}
Comment thread web/src/lib/modals/KeyValueSection.tsx
Comment thread web/src/lib/modals/KeyValueSection.tsx
Comment thread web/src/lib/modals/BaseModal.tsx
Comment thread web/src/lib/modals/BaseModal.tsx
Comment thread web/src/lib/modals/BaseModal.tsx Outdated
Comment thread web/src/lib/modals/BaseModal.tsx Outdated
- 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>
@kubestellar-prow kubestellar-prow Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 21, 2026
…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>
@kubestellar-prow kubestellar-prow Bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 21, 2026
@clubanderson

Copy link
Copy Markdown
Collaborator Author

Fixes pushed to branch scanner/fix-19339:

  • Removed role="presentation" from backdrop divs (caused axe-core violations)
  • Removed redundant onKeyDown handlers from <button> elements (buttons handle Enter/Space natively)
  • Kept aria-label="Copy to clipboard" and role="button" on table rows (valid improvements)

These changes should resolve the "Accessibility Tests" CI failures. The role="presentation" combined with onClick handlers was the likely axe-core trigger.

@clubanderson clubanderson merged commit 14cbaeb into main Jun 21, 2026
31 of 39 checks passed
@kubestellar-prow kubestellar-prow Bot deleted the scanner/fix-19339 branch June 21, 2026 10:17
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

@github-actions

Copy link
Copy Markdown
Contributor

Post-merge build verification passed

Both Go and frontend builds compiled successfully against merge commit 14cbaeb426e513c1cda44fe989f4f5f507e92619.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. tier/2-standard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Auto-QA] Keyboard navigation gaps [Auto-QA] Interactive elements missing ARIA labels

2 participants