Skip to content

feat: submit contact add form with Cmd/Ctrl+Enter#366

Merged
KMKoushik merged 2 commits intomainfrom
feat/contact-form-cmd-enter-submit
Feb 28, 2026
Merged

feat: submit contact add form with Cmd/Ctrl+Enter#366
KMKoushik merged 2 commits intomainfrom
feat/contact-form-cmd-enter-submit

Conversation

@KMKoushik
Copy link
Member

@KMKoushik KMKoushik commented Feb 28, 2026

Summary

  • add keyboard shortcut support so pressing Cmd/Ctrl + Enter submits the Add Contacts form in /contacts/[contactBookId]
  • keep existing submit button flow unchanged and route shortcut through react-hook-form validation/submit handling
  • update form helper text to advertise the new shortcut and remove an unused import in the component

Testing

  • unable to run lint/tests in this VM because pnpm is not available in PATH

Summary by cubic

Add Cmd/Ctrl+Enter to submit the Add Contacts form. Improves keyboard workflow and prevents duplicate submits.

  • New Features

    • Cmd/Ctrl+Enter submits the form in /contacts/[contactBookId].
    • Shortcut triggers react-hook-form validation and onContactsAdd.
    • Helper text updated to advertise the shortcut.
  • Bug Fixes

    • Ignore the shortcut while submission is pending to avoid double submits.

Written for commit 2476b16. Summary will update on new commits.

Summary by CodeRabbit

  • New Features
    • Added a keyboard shortcut (Cmd/Ctrl + Enter) to submit the add-contact form; on-screen guidance was updated to show this shortcut.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 28, 2026

Deploying usesend with  Cloudflare Pages  Cloudflare Pages

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

View logs

@vercel
Copy link

vercel bot commented Feb 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
unsend-marketing Ready Ready Preview, Comment Feb 28, 2026 1:55pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 161f491 and 2476b16.

📒 Files selected for processing (1)
  • apps/web/src/app/(dashboard)/contacts/[contactBookId]/add-contact.tsx

Walkthrough

The pull request updates the add-contact form component by removing an unused useRouter import, adding a keyboard shortcut so pressing Cmd/Ctrl+Enter in the textarea triggers the existing submit handler, and updating the form description to document the shortcut. A trailing comma was added in the mutation options object. No public API or exported signatures were changed.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main feature addition: keyboard shortcut support (Cmd/Ctrl+Enter) for submitting the contact form, which aligns with the primary change in the changeset.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e3e9635 and 161f491.

📒 Files selected for processing (1)
  • apps/web/src/app/(dashboard)/contacts/[contactBookId]/add-contact.tsx

@KMKoushik KMKoushik merged commit 9e588e2 into main Feb 28, 2026
6 checks passed
@KMKoushik KMKoushik deleted the feat/contact-form-cmd-enter-submit branch February 28, 2026 13:58
@KMKoushik KMKoushik restored the feat/contact-form-cmd-enter-submit branch February 28, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant