feat: add auto-focus on first input field in onboarding modal - #205
Conversation
|
@grishabhatia is attempting to deploy a commit to the itzzavdhesh's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review limit reached
More reviews will be available in 50 minutes and 17 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughOnboarding.jsx now manages step-aware focus: it adds refs and a retry-focus helper, wires callback refs into the Step 1 voice name input and sr-only focus targets for Steps 2 and 3, and focuses the appropriate target whenever ChangesAuto-focus on step transitions
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
Actionable comments posted: 2
🤖 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 `@client/src/pages/Onboarding.jsx`:
- Line 252: The current focus targets (e.g., the element referenced by
step2FirstInputRef and the similar step3 ref) point to sr-only divs, which gives
no visible focus for keyboard users; update the DOM so the refs point to visible
headings or container elements (make the visible heading/container receive
tabIndex={-1} and move the ref from the sr-only div to that element) and remove
or repurpose the sr-only placeholders, then ensure any dynamic ARIA states
(recording status, audio playback, live camera indicators) are present on those
visible elements or nearby elements so screen-readers announce step/context
changes correctly.
- Around line 33-41: The useEffect that accesses activeStep and refs (useEffect,
voiceNameInputRef, step2FirstInputRef, step3FirstInputRef) runs before
activeStep is declared, causing a TDZ ReferenceError; fix by moving the
activeStep state declaration (the useState for activeStep) above this useEffect
(or vice‑versa ensure activeStep is declared before any hook that references
it). Also update the focus targets for steps 2 and 3 to focus a real interactive
control (e.g., the visible Back or Continue button — create refs like
step2FirstInteractiveRef/step3FirstInteractiveRef or reuse existing
back/continue button refs) instead of hidden sr-only divs, or add an aria-live
region to announce step changes for screen readers.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: c5cc1938-d064-47be-8448-c11bb245fada
📒 Files selected for processing (1)
client/src/pages/Onboarding.jsx
There was a problem hiding this comment.
1 issue found across 1 file
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
✍️ DCO Sign-off NeededHey @grishabhatia! 👋 One or more commits in this PR are missing a Warning
How to fix: For the latest commit: git commit --amend --signoff
git push --force-with-leaseFor multiple commits, replace git rebase --signoff HEAD~N
git push --force-with-leaseThis comment will update automatically after you push. 🤖 VoiceForge Automation · Updates automatically on edits |
🎉 PR Ready for Mentor ReviewHey @grishabhatia! 👋 Your PR passed all checks and is now in the GSSoC review queue. Note 🔗 Closing: #185 · 📐 89 lines across 1 file(s) · 📬 Review requested @sabeenaviklar @Anushreebasics @itsdakshjain @snehkris @1754riya @Mrigakshi-Rathore @Itzzavdheshh @Nitya-003 @4f4d @lovestaco, this PR is ready for your review — please confirm scope, check behavior and tests, then approve or request changes. Important This is not an approval. Please wait for mentor feedback before expecting a merge. If changes are requested, push them to this same branch and keep the PR focused on the linked issue. 🤖 VoiceForge Automation · Updates automatically on edits |
itsdakshjain
left a comment
There was a problem hiding this comment.
Resolve the bot comments
❌ Merge Policy ViolationCaution Unauthorized Merge — Pull request #205 was merged by @Itzzavdheshh (mentor) without any review on record. VoiceForge guidelines require contributors/mentors to submit at least one review (approval, comment, or changes requested) before merging a pull request to ensure code quality and point-tracking integrity. 📊 Violation Summary
🤖 VoiceForge Automation |
🎊 PR Merged SuccessfullyHey @grishabhatia! 👋 Congratulations and thank you for your contribution to VoiceForge! Note 🔗 Linked issue(s): #185 · ✅ Marked as merged and complete Maintainers may still handle final cleanup, release notes, or follow-up tracking after the merge. 🤖 VoiceForge Automation · Updates automatically on edits |
🚀 Program
GSSoC
📝 Description
This PR adds auto-focus functionality to the onboarding modal. Previously, users had to manually click into input fields before typing, which created unnecessary friction, especially for keyboard users and those with mobility challenges.
Now, when each onboarding step loads, the first input field automatically receives keyboard focus, allowing users to start typing immediately.
Changes Made:
useRefanduseEffectimports inOnboarding.jsxvoiceNameInputReffor Step 1 (voice name input)step2FirstInputRefandstep3FirstInputReffor future stepsuseEffectthat triggers onactiveStepchange to set focusrefto the voice name input element in Step 1🔗 Related Issue
Closes #185
🔄 Type of Change
🧪 How to Test
npm run devin the project roothttp://localhost:5173(orhttp://localhost:5174) in Chrome or Edge✅ Checklist
feat: add voice preview)Summary by cubic
Adds auto-focus to the first field in each onboarding step so users can start typing right away. Improves keyboard flow, accessibility, and focus reliability.
New Features
activeStep.Bug Fixes
Written for commit 99cde0a. Summary will update on new commits.