feat: comment submit shortcut preference#9081
Draft
sriramveeraghanta wants to merge 1 commit into
Draft
Conversation
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.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)CommentSubmitShortcutchoices andcomment_submit_shortcutfield on theProfilemodel0122_profile_comment_submit_shortcutShared packages
@plane/types: newCommentSubmitShortcuttype; field added toTUserProfile@plane/utils: newisCommentSubmissionValidhelper centralizing the keyboard-event matching logic; newgetIsMachelper@plane/editor:EnterKeyExtensionnow dynamically handles both shortcut modes — when shortcut isenter, Enter submits and Shift+Enter inserts a newline; whenmod_enter, Mod+Enter submits and Enter inserts a newline.submitShortcutis threaded throughILiteTextEditorProps.@plane/i18n: newprofile-preferencesnamespace with translations for all 19 supported localesWeb app (
apps/web)comment_submit_shortcut: "enter"submitShortcutto the editorcomment-create.tsxandcomments/card/edit-form.tsxreplace hardcoded Enter-only checks withisCommentSubmissionValidCommentShortcutSelectorcomponent in profile preferences (mirrors theThemeSwitcherpattern); registered in the default preferences listSpace app
submitShortcutto the editorTest plan
0122_profile_comment_submit_shortcutcleanly on a fresh DB