Swap Enter/Shift+Enter in agents prompt editor#199
Open
aletc1 wants to merge 1 commit into21st-dev:mainfrom
Open
Swap Enter/Shift+Enter in agents prompt editor#199aletc1 wants to merge 1 commit into21st-dev:mainfrom
aletc1 wants to merge 1 commit into21st-dev:mainfrom
Conversation
Enter now inserts a newline and Shift+Enter submits (Opt+Shift+Enter force-submits). Applies to both the new-workspace prompt and the active-chat input, since they share AgentsMentionsEditor. Multi-line prompts are much easier to compose without an accidental send. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Swap the submit/newline keys in the shared
AgentsMentionsEditor:Applies to both the new-workspace ("What do you want to get done?") input and the active-chat input, since both render the same editor.
Closes #197
Why
Multi-line prompts were easy to accidentally send with a stray Enter. Making Enter a newline and requiring a modifier to submit matches the pattern users already expect from other chat UIs for longer-form composition.
Changes
src/renderer/features/agents/mentions/agents-mentions-editor.tsx— flipped theshiftKeycheck in the Enter branch of the editor'sonKeyDownhandler (the core one-line behavior change). Plain Enter now falls through to the native contenteditable newline; dropdown (@mention //slash) handling is unchanged.chat-input-area.tsx,active-chat.tsx, andnew-chat-form.tsxso any "Opt+Enter" / "press Enter to send" references now say "Opt+Shift+Enter" / "press Shift+Enter to send".IME composition (
isComposing) guard is preserved — composing in CJK IMEs still commits on Enter without submitting.Test plan
@then Enter still selects mention; typing/then Enter still selects command🤖 Generated with Claude Code