feat(a11y): add keyboard navigation support (#631)#715
Conversation
- autoFocus on GitHub Username input on page load - Escape key clears username input and returns focus - focus-visible ring on all navbar buttons - focus-visible ring on Hero CTA link - Global :focus-visible CSS for consistent focus indicators - aria-labels on Tabs for screen reader support Closes GitMetricsLab#631
✅ Deploy Preview for github-spy ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThe PR adds keyboard navigation support and focus accessibility improvements across the app. Global CSS distinguishes keyboard from mouse focus, component CTAs and buttons gain focus-visible ring styling, and the Tracker page now includes username input keyboard handling, autofocus, and aria-labels for improved tab navigation. ChangesKeyboard Navigation & Focus Accessibility
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🎉 Thank you @vibeetroot for your contribution. Please make sure your PR follows https://github.com/GitMetricsLab/github_tracker/blob/main/CONTRIBUTING.md#-pull-request-guidelines
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/pages/Tracker/Tracker.tsx`:
- Around line 83-88: handleUsernameKeyDown clears username then incorrectly
calls usernameInputRef.current?.querySelector("input")?.focus(), which fails
because usernameInputRef.current is already the HTMLInputElement; change the
logic to call focus directly on the input ref
(usernameInputRef.current?.focus()) after setUsername, updating the
handleUsernameKeyDown callback to reference usernameInputRef.current.focus() and
keep dependencies (setUsername) intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f5e793b8-4ea5-4f37-92aa-4194bc44129e
📒 Files selected for processing (4)
src/components/Hero.tsxsrc/components/Navbar.tsxsrc/index.csssrc/pages/Tracker/Tracker.tsx
Related Issue
Description