Repository navigation
feat(desktop): answer the send-while-streaming choice from the keyboard - #1600
Merged
Merged
Conversation
The send button asks whether to queue the draft or interrupt the run while a reply streams, but the two rows could only be picked with a pointer - the reader had just pressed Enter in the field, so the keyboard was where their hand already was. The menu now keeps the caret in the field and listens on the window in the capture phase: up/down walk the two rows, Enter runs the highlighted one, and the first row (the queue, which spends and loses nothing) is selected when the menu opens, so the Enter that asked is the Enter that answers. Taking the keys before the editor is what keeps one press from both picking a row and recalling a sent message or sending the draft; a modified key stays a text-editing gesture. The rows moved into their own component (SendChoiceMenu) so that wiring does not live in the composer's control row.
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.
While a reply streams, the desktop send button stops being a plain Stop: pressing it asks whether this send should hold the draft in the queue or interrupt the run and send now. Those two rows could only be picked with a pointer, even though the reader has just pressed Enter in the composer — the keyboard is where their hand already is. This adds a keyboard path through that choice without taking the caret out of the draft.
The menu keeps the caret in the editor and listens on the window in the capture phase, so
↑/↓walk the rows andEnterconfirms, instead of the editor recalling sent messages or sending the draft underneath the open menu. Opening selects the first (reversible) row, so the sameEnterthat opened the menu lands on the choice that spends nothing and loses nothing. Modified chords (⇧/⌘/⌥/⌃) and IME composition are left to the editor.Commits
Verification
Local, at
ceb1e8acein a detached worktree,ulimit -n 8192,node_moduleslinked from the main checkout:npx tsc --noEmit(desktop) — cleannpx eslinton the four changed sources — cleannpx vitest run(desktop, full) — 426 files, 6027 tests passedmake check-docs— 417 docs checked, placement/bilingual pairing/links OK; provider matrix unchangedUser-visible changes
↑/↓move the highlight,Enterruns the highlighted row, the first row (queue the draft) is selected on open. Before: pointer only, the keyboard pressed the send button and then had no way to choose. Revert:bbf63003f.Notes
None.