-
Notifications
You must be signed in to change notification settings - Fork 64
🐛 Keyboard Navigation & Accessibility Issues in Interactive Components #657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
[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 |
✅ Deploy Preview for kubestellar-docs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Welcome to KubeStellar! 🚀 Thank you for submitting this Pull Request. Before your PR can be merged, please ensure: ✅ DCO Sign-off - All commits must be signed off with ✅ PR Title - Must start with an emoji: ✨ (feature), 🐛 (bug fix), 📖 (docs), 🌱 (infra/tests), Getting Started with KubeStellar: Contributor Resources:
🌟 Help KubeStellar Grow - We Need Adopters! Our roadmap is driven entirely by adopter feedback. Whether you're using KubeStellar yourself or know someone who could benefit from multi-cluster Kubernetes: 📋 Take our Multi-Cluster Survey - Share your use cases and help shape our direction! A maintainer will review your PR soon. Feel free to ask questions in the comments or on Slack! |
|
Hi @AAdIprog. Thanks for your PR. I'm waiting for a kubestellar member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
…lector Signed-off-by: AAdIprog <aadishah132@gmail.com>
563b83a to
a504dbf
Compare
There was a problem hiding this comment.
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 enhances keyboard accessibility for interactive components by adding keyboard navigation support to flip cards in the Use Cases section and the Version Selector dropdown.
Changes:
- Added keyboard interaction (Enter/Space) and ARIA attributes to flip cards in UseCasesSection for accessibility
- Implemented arrow key navigation (ArrowUp/ArrowDown) for the VersionSelector dropdown with visual focus indicators
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/components/master-page/UseCasesSection.tsx | Added keyboard event handlers, ARIA attributes (role, tabIndex, aria-pressed, aria-label), and focus ring styling to flip cards |
| src/components/docs/VersionSelector.tsx | Added keyboard navigation state management, arrow key handlers, Enter key selection, and visual focus styling for both mobile and desktop variants |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| document.addEventListener('keydown', handleKeyDown); | ||
| return () => document.removeEventListener('keydown', handleKeyDown); | ||
| }, [isOpen, versions.length, focusedIndex]); |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The useEffect dependency array includes focusedIndex but the effect uses handleVersionChange which is defined outside the effect. This creates a stale closure issue where handleVersionChange may reference outdated values. Additionally, handleVersionChange itself is not memoized and depends on pathname and projectId. Add handleVersionChange to the dependency array or move it inside the useEffect, or wrap handleVersionChange in useCallback with proper dependencies.
| function handleKeyDown(event: KeyboardEvent) { | ||
| if (event.key === 'ArrowDown') { | ||
| event.preventDefault(); | ||
| setFocusedIndex(i => (i + 1) % versions.length); | ||
| } else if (event.key === 'ArrowUp') { | ||
| event.preventDefault(); | ||
| setFocusedIndex(i => (i - 1 + versions.length) % versions.length); | ||
| } else if (event.key === 'Enter' && focusedIndex >= 0) { | ||
| event.preventDefault(); | ||
| handleVersionChange(versions[focusedIndex].key); | ||
| } | ||
| } |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the dropdown first opens and focusedIndex is -1, pressing ArrowDown or ArrowUp will set focusedIndex to 0 or the last index respectively, but there's no initial focused state when the dropdown opens. Consider initializing focusedIndex to 0 (or the current version's index) when the dropdown opens so users immediately have a focused option. This provides better keyboard navigation UX and matches standard dropdown behavior.
Signed-off-by: AAdIprog <aadishah132@gmail.com>
2cc18d9 to
871f64f
Compare
|
@naman9271 @oksaumya review |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
📌 Fixes
Fixes #655
📝 Summary of Changes
Implemented keyboard navigation improvements for key interactive components to enhance accessibility (a11y).
Space.ArrowUpandArrowDownnavigation to cycle through versions, as expected for accessible menus.Changes Made
role="button"andtabIndex={0}to card containers.onKeyDownhandler for Enter andSpacekeys.focus:ringstyles for visual focus indication.focusedIndexto track keyboard focus.ArrowUp,ArrowDown, and Enter.Checklist
Please ensure the following before submitting your PR:
Screenshots or Logs (if applicable)
No visible UI changes unless interacting via keyboard (focus rings appear).
👀 Reviewer Notes
ring-blue-500).