Enter sends the prompt, Shift+Enter breaks the line (fix #1510) - #1530
Merged
Conversation
Aligns the composer with Claude Code web's bindings. Plain Enter submits unless Enter already means something where the caret is: an open suggestion menu (which uses it to pick), a code block (newline), or an IME composition. Cmd/Ctrl+Enter keeps working. The suggestion popup's aria-expanded now tracks the menu's actual visibility instead of the plugin's active range — it doubles as the Enter guard's signal, and stops announcing an open menu that a non-matching query already hid. Co-Authored-By: Claude Fable 5 <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.
What
Plain Enter now submits the composer, matching Claude Code web (#1510); Shift+Enter stays a line break, and Cmd/Ctrl+Enter keeps working everywhere it did.
Enter steps aside where it already means something at the caret:
/<@#) — Enter picks the highlighted item, as beforeHow
The direct
editorProps.handleKeyDownoutranks the suggestion plugins' handlers, so it can't just grab Enter — it checks the editor'saria-expandedbefore submitting. That attribute (set by the suggestion popup) now tracks the menu's actual visibility rather than the plugin's active range: a non-matching query hides the menu but used to leavearia-expanded="true"behind, which both lied to the a11y tree and would have swallowed Enter.draw()now owns the attribute and clearsaria-activedescendantwhen the menu hides.One change covers every composer surface (launcher, in-session, compact navbar) — they all render
PromptEditor. The submit button's tooltip hint updates from(⌘↵ / Ctrl+Enter)to(Enter · Shift+Enter for a new line).Tests
New
PromptEditor.test.tsxmounts the real Tiptap editor (the existing Composer tests mock it, so the keyboard seam itself was uncovered): plain Enter submits; Shift/Alt+Enter don't; Cmd/Ctrl+Enter still do; Enter is left alone whilearia-expanded="true"; Enter during IME composition doesn't send.Full dashboard suite: 82 files / 801 tests passing, typecheck clean.
Worth a quick manual pass on the menu flow (type
/, Enter picks — doesn't send) before merging.🤖 Generated with Claude Code