Repository navigation
fix(site/src): swap Stop for Queue once a draft exists while streaming - #29507
Merged
Merged
Conversation
On viewports below 640px a streaming turn previously left only Stop in the footer, so queued sends were unreachable from touch. The rightmost footer slot now shows Stop while the draft is empty and a send button labelled Queue once there is sendable text, an active upload, or a live voice recording. History-message editing while streaming keeps Stop. Below 640px, Enter inserts a newline, so the send button omits aria-keyshortcuts and the tooltip shortcut suffix there, and the queued list hides its Enter hint. The mic cluster stays mounted while a recording outlives the start of a turn so Accept and Cancel remain reachable.
jscottmiller
force-pushed
the
scott/mobile-queue-send
branch
from
September 17, 2026 22:54
503f2d9 to
7d6c7d0
Compare
added 2 commits
September 18, 2026 02:46
The mic renders whenever speech recognition is supported, so a recording can start mid-stream and land in the Queue slot. Recognition errors clear after five seconds instead of persisting until the next recording.
…xt recording Restores useSpeechRecognition to its main behaviour: a recognition error stays exposed until start() or cancel() clears it.
jscottmiller
marked this pull request as ready for review
September 18, 2026 03:14
bpmct
added a commit
that referenced
this pull request
Sep 20, 2026
Enter and Cmd/Ctrl+Enter inserted newlines instead of sending when the Coder Agents window was narrower than 640px. This broke desktop split views even with the Cmd/Ctrl+Enter preference enabled. Use pointer capability instead of window width for touch keyboard behavior. Narrow desktop windows respect the send preference, Cmd/Ctrl+Enter works at every width, and Shift+Enter still inserts a newline. Fixes #28438. Refs [CODAGT-1006](https://linear.app/codercom/issue/CODAGT-1006). Tested on web (macOS/Chrome): https://github.com/user-attachments/assets/10e3fc49-d5b5-4438-96b8-5fe740b6acbb Tested on iOS: https://github.com/user-attachments/assets/0a3844f8-721a-469e-a822-7e8ea89586d9 <details> <summary>Implementation and verification notes</summary> The change is limited to the shared composer Enter handler, its existing tests, and the mobile composer story. Plain Enter inserts a newline when the primary pointer is coarse, including on larger touch devices. Cmd/Ctrl+Enter bypasses that check. Pointer capability is a proxy for touch input, not a physical-keyboard detector. Regression tests reproduced the bug before the fix. All 87 targeted unit tests and 99 composer stories pass, along with frontend formatting, lint, typechecking, and the full make pre-commit checks. Browser checks confirmed submit callbacks at 390px and 1280px with both send preferences and touch emulation. A dev-instance chat also completed through dogfood AI Gateway. The related queue-button work in #29507 is not a dependency. </details> Generated by Coder Agents on behalf of @bpmct.
…int and tidy viewport stub Add a phone Pixel viewport to the SeveralMessages story so the hidden Enter-to-send hint is visually covered, capture matchMedia once so stubViewport does not nest stubs when called twice in a test, and rename the shortcut test to match what it asserts.
ibetitsmike
approved these changes
Sep 22, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
On viewports below 640 px, Enter inserts a newline, so once a turn was streaming the footer offered only Stop and there was no way to queue a follow-up message from touch.
The rightmost footer slot now follows one rule while a turn streams: Stop while the draft is empty, and the send button labelled Queue once the draft has sendable text, an active upload, or a live voice recording. Editing a history message while streaming keeps Stop. When not streaming, nothing changes. Exactly one of Stop or the send button renders in the slot at any time.
Two fixes from the UAT report are included:
aria-keyshortcutsand the tooltip shortcut suffix, and the queued list hides its Enter hint (hidden sm:flex), since Enter does not send there.UAT report: https://github.com/coder/scott-misc/blob/main/uat/mobile-queue-send-uat/README.md
Merge point with #29216: that PR changes the label to
isEditingMessage ? "Save Edit" : isChatPaused ? "Queue" : "Send"and renamesisEditingHistoryMessagetoisEditingMessage. Whichever lands second should resolve the label toisEditingMessage ? "Save Edit" : isStreaming || isChatPaused ? "Queue" : "Send".UAT findings disposition
aria-keyshortcutssay Enter below 640 px; queued-list hint mismatchesbodyafter Queue on phoneToasterwidth, needs design sign-offImplementation plan
Repository: /home/coder/coder, branch
scott/mobile-queue-sendofforigin/main.Confirmed reading
AgentChatInput.tsx:handleSubmitdoes not checkisStreaming; the editor'sonEnter={handleSubmit}therefore queues a message while a turn streams, and the page's send path handlesresponse.queued. Footer right group: voice input hidden while streaming, context usage visible, Stop underisStreaming && onInterrupt, send button only under!isStreaming.sendButtonLabelis"Save Edit" | "Send"; open PR feat(site): edit queued chat messages #29216 changes it toisEditingMessage ? "Save Edit" : isChatPaused ? "Queue" : "Send".Decisions and constraints
handleSubmitpath. Not streaming: unchanged. The button stays in the rightmost footer slot.draftOccupiesSlot = hasSendableContent || hasActiveUploads: an attachment still uploading shows a transiently disabled Queue, an errored-only attachment keeps Stop. Stop is also kept while a history message is being edited during a stream; Enter still saves the edit.onInterrupt, nothing renders in the slot (same asmain).Scope
Single component change plus test and story. No page wiring, no server change.
Changes
AgentChatInput.tsx: labelisEditingHistoryMessage ? "Save Edit" : isStreaming ? "Queue" : "Send"; footer slot shows Stop whenisStreaming && onInterrupt && !draftOccupiesSlot, the send button when!isStreaming || draftOccupiesSlot; spinner only whenisLoading && !isInterruptPending; tooltipQueue: <shortcut>follows from the label.AgentChatInput.test.tsx: Stop -> Queue -> Stop after draft clear, with callback assertions; interrupt-pending with a draft renders a disabled Queue that does not callonSend.AgentChatInput.stories.tsx: narrow-viewport streaming story with a draft so the 390 px footer with Queue in the Stop slot is captured.ChatPageContent.stories.tsxInterruptingShowsBusyComposer: the absent-send-button assertion queries the streaming label "Queue".UAT follow-up (this PR)
mobileViewportMediaQueryconstant inutils/mobile.ts;useMediaQueryinAgentChatInputdropsaria-keyshortcutsand the tooltip suffix below 640 px; queued-list hinthidden sm:flex.speech.isSupported;speech.isRecordingadded todraftOccupiesSlot; a live recording takes precedence over history editing in the slot.This PR was generated by Coder Agents on behalf of @jscottmiller.