Skip to content

feat: comment submit shortcut preference#9081

Draft
sriramveeraghanta wants to merge 1 commit into
previewfrom
feat/comment-submit-shortcut
Draft

feat: comment submit shortcut preference#9081
sriramveeraghanta wants to merge 1 commit into
previewfrom
feat/comment-submit-shortcut

Conversation

@sriramveeraghanta
Copy link
Copy Markdown
Member

Summary

Adds a user profile preference to configure the keyboard shortcut for submitting comments. Users can now choose between Enter (default) and Mod+Enter (⌘+Enter on Mac, Ctrl+Enter on Windows/Linux).

Changes

Backend (apps/api)

  • New CommentSubmitShortcut choices and comment_submit_shortcut field on the Profile model
  • Migration 0122_profile_comment_submit_shortcut

Shared packages

  • @plane/types: new CommentSubmitShortcut type; field added to TUserProfile
  • @plane/utils: new isCommentSubmissionValid helper centralizing the keyboard-event matching logic; new getIsMac helper
  • @plane/editor: EnterKeyExtension now dynamically handles both shortcut modes — when shortcut is enter, Enter submits and Shift+Enter inserts a newline; when mod_enter, Mod+Enter submits and Enter inserts a newline. submitShortcut is threaded through ILiteTextEditorProps.
  • @plane/i18n: new profile-preferences namespace with translations for all 19 supported locales

Web app (apps/web)

  • Profile store seeds comment_submit_shortcut: "enter"
  • Lite-text editor reads the preference and passes submitShortcut to the editor
  • comment-create.tsx and comments/card/edit-form.tsx replace hardcoded Enter-only checks with isCommentSubmissionValid
  • New CommentShortcutSelector component in profile preferences (mirrors the ThemeSwitcher pattern); registered in the default preferences list

Space app

  • Profile store seeds the new default
  • Space lite-text editor reads the preference and passes submitShortcut to the editor

Test plan

  • Apply migration 0122_profile_comment_submit_shortcut cleanly on a fresh DB
  • Visit Profile → Preferences and confirm the new "Comment submit shortcut" selector renders with the Mac/Windows label variant
  • Toggle the preference between Enter and Mod+Enter and confirm it persists across reload
  • With shortcut = Enter: Enter submits a comment, Shift+Enter inserts a newline, Mod+Enter inserts a newline
  • With shortcut = Mod+Enter: Enter inserts a newline, Shift+Enter inserts a newline, Mod+Enter submits
  • Verify behavior on both new-comment and edit-comment flows
  • Verify behavior in the Space (public site) comment editor
  • Localized labels render correctly across non-English locales

Add a user profile preference to choose between Enter and Mod+Enter
for submitting comments across the web and space apps. Wires the new
preference through the Profile model, types, utils, editor extension,
and i18n namespace, and exposes a selector in profile preferences.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 440df984-8273-4f3f-992e-996205d040ba

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/comment-submit-shortcut

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.

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