-
Notifications
You must be signed in to change notification settings - Fork 568
feat: allow renaming a face using Enter key in addition to button #581
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
feat: allow renaming a face using Enter key in addition to button #581
Conversation
WalkthroughAdds an Enter key handler to the person name input in PersonImages editing mode. When Enter is pressed, it invokes the existing save function to submit the rename without clicking the button. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant PI as PersonImages page
participant IN as Name Input
participant H as handleSaveName()
U->>IN: Type name
U->>IN: Press Enter
IN->>PI: onKeyDown(Enter)
PI->>H: Invoke save handler
H-->>PI: Save completed/failed
PI-->>U: UI updates with result
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
frontend/src/pages/PersonImages/PersonImages.tsx (1)
64-68: AddpreventDefault()for robustness.The Enter key handler correctly invokes
handleSaveName(), but consider callinge.preventDefault()to explicitly prevent any default browser behavior and make the intent clear.Apply this diff:
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => { if (e.key === 'Enter') { + e.preventDefault(); handleSaveName(); } };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
frontend/src/pages/PersonImages/PersonImages.tsx(2 hunks)
🔇 Additional comments (1)
frontend/src/pages/PersonImages/PersonImages.tsx (1)
86-86: LGTM!The
onKeyDownhandler is correctly wired to the Input component, enabling Enter key support as intended. This provides a better user experience by allowing keyboard-driven workflow.
rahulharpal1603
left a comment
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.
Thanks @rebeccabas
Summary
This PR adds support for triggering the rename action when the Enter key is pressed, in addition to the existing ✅ button click.
It improves the overall user experience by making the renaming process faster and more intuitive.
What Changed
onKeyDownevent handler to detect the Enter key and trigger the rename logic when Enter is pressed.Testing
Documentation
No documentation changes were necessary since this is a small UX enhancement.
Checklist
npm run format)npm run lint:check)Closes: #580
Summary by CodeRabbit