Skip to content

Conversation

@AAdIprog
Copy link
Contributor

📌 Fixes

Fixes #655


📝 Summary of Changes

Implemented keyboard navigation improvements for key interactive components to enhance accessibility (a11y).

  • Use Cases Section: The flip cards were previously only accessible via hover. They are now focusable and can be flipped using Enter or Space.
  • Version Selector: The dropdown now supports standard ArrowUp and ArrowDown navigation to cycle through versions, as expected for accessible menus.

Changes Made

  • Updated src/components/master-page/UseCasesSection.tsx
    • Added role="button" and tabIndex={0} to card containers.
    • Added onKeyDown handler for Enter and Space keys.
    • Added focus:ring styles for visual focus indication.
  • Updated src/components/docs/VersionSelector.tsx
    • Added internal state focusedIndex to track keyboard focus.
    • implemented handleKeyDown for ArrowUp, ArrowDown, and Enter.
    • Applied visual focus styling to both Desktop (dropdown) and Mobile (list) variants to match hover states.

Checklist

Please ensure the following before submitting your PR:

  • I have reviewed the project's contribution guidelines.
  • I have written unit tests for the changes (if applicable).
  • I have updated the documentation (if applicable).
  • I have tested the changes locally and ensured they work as expected.
  • My code follows the project's coding standards.

Screenshots or Logs (if applicable)

No visible UI changes unless interacting via keyboard (focus rings appear).


👀 Reviewer Notes

  • The focus styles for the Use Cases cards use standard blue rings (ring-blue-500).
  • The Version Selector uses the same background colors for keyboard focus as it does for mouse hover, ensuring consistency.

Copilot AI review requested due to automatic review settings January 14, 2026 12:32
@kubestellar-prow
Copy link

[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 mavrick-1 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

@kubestellar-prow kubestellar-prow bot added the dco-signoff: no Indicates the PR's author has not signed the DCO. label Jan 14, 2026
@netlify
Copy link

netlify bot commented Jan 14, 2026

Deploy Preview for kubestellar-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 871f64f
🔍 Latest deploy log https://app.netlify.com/projects/kubestellar-docs/deploys/6967a1f5eaf412000812fbc4
😎 Deploy Preview https://deploy-preview-657--kubestellar-docs.netlify.app
📱 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.

@github-actions
Copy link
Contributor

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 git commit -s to certify the Developer Certificate of Origin

PR Title - Must start with an emoji: ✨ (feature), 🐛 (bug fix), 📖 (docs), 🌱 (infra/tests), ⚠️ (breaking change)

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!

@kubestellar-prow kubestellar-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 14, 2026
@kubestellar-prow
Copy link

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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>
@AAdIprog AAdIprog force-pushed the fix/keyboard-navigation branch from 563b83a to a504dbf Compare January 14, 2026 12:34
@kubestellar-prow kubestellar-prow bot added dco-signoff: yes Indicates the PR's author has signed the DCO. and removed dco-signoff: no Indicates the PR's author has not signed the DCO. labels Jan 14, 2026
@AAdIprog AAdIprog changed the title fix(a11y): add keyboard navigation support for UseCases and VersionSe… fix(a11y): Keyboard Navigation & Accessibility Issues in Interactive Components Jan 14, 2026
Copy link
Contributor

Copilot AI left a 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]);
Copy link

Copilot AI Jan 14, 2026

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.

Copilot uses AI. Check for mistakes.
Comment on lines +72 to +83
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);
}
}
Copy link

Copilot AI Jan 14, 2026

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.

Copilot uses AI. Check for mistakes.
@AAdIprog AAdIprog changed the title fix(a11y): Keyboard Navigation & Accessibility Issues in Interactive Components 🐛 Keyboard Navigation & Accessibility Issues in Interactive Components Jan 14, 2026
@kubestellar-prow kubestellar-prow bot added dco-signoff: no Indicates the PR's author has not signed the DCO. and removed dco-signoff: yes Indicates the PR's author has signed the DCO. labels Jan 14, 2026
Signed-off-by: AAdIprog <aadishah132@gmail.com>
@AAdIprog AAdIprog force-pushed the fix/keyboard-navigation branch from 2cc18d9 to 871f64f Compare January 14, 2026 14:02
@kubestellar-prow kubestellar-prow bot added dco-signoff: yes Indicates the PR's author has signed the DCO. and removed dco-signoff: no Indicates the PR's author has not signed the DCO. labels Jan 14, 2026
@btwshivam
Copy link
Collaborator

@naman9271 @oksaumya review

@kubestellar-prow kubestellar-prow bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 17, 2026
@kubestellar-prow
Copy link

PR needs rebase.

Details

Instructions 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.

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. frontend needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Keyboard Navigation & Accessibility Issues in Interactive Components

2 participants