feat: submit contact add form with Cmd/Ctrl+Enter#366
Conversation
Deploying usesend with
|
| Latest commit: |
2476b16
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4187502a.usesend.pages.dev |
| Branch Preview URL: | https://feat-contact-form-cmd-enter.usesend.pages.dev |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
WalkthroughThe pull request updates the add-contact form component by removing an unused 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/web/src/app/`(dashboard)/contacts/[contactBookId]/add-contact.tsx:
- Around line 107-115: The keydown handler currently triggers
contactsForm.handleSubmit(onContactsAdd) even when a previous mutation is
pending; update that onKeyDown callback to check the same "pending" flag used to
disable the submit button (for example contactsAdd.isLoading,
contactsMutation.isLoading, or contactsForm.formState.isSubmitting) and return
early if it is true so Cmd/Ctrl+Enter cannot start another submit; only call
contactsForm.handleSubmit(onContactsAdd) when the mutation is not pending and
keep event.preventDefault() inside that non-pending branch so behavior matches
the disabled button.
Summary
/contacts/[contactBookId]Testing
pnpmis not available in PATHSummary by cubic
Add Cmd/Ctrl+Enter to submit the Add Contacts form. Improves keyboard workflow and prevents duplicate submits.
New Features
Bug Fixes
Written for commit 2476b16. Summary will update on new commits.
Summary by CodeRabbit