Skip to content

Send while dictating stops it and sends the words, in one press - #2824

Merged
davidmckayv merged 3 commits into
mainfrom
send-stops-dictation
Dec 3, 2026
Merged

davidmckayv merged 3 commits into
mainfrom
send-stops-dictation

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

What was wrong

Found in dogfooding (#openbot-dogfooding, 2026-12-02): someone dictated a message and pressed Send, and nothing happened. Send was turned off while live dictation listened, so a dictated message took two presses: Stop, then Send.

What changes

  • Send while live dictation listens (Chrome's Web Speech API, or the Desktop window's recognizer) stops listening, waits for the recognizer's last words, then sends the message, in one press. It goes through the same submitDraft path as every send, with the same checks (empty, over the file cap, card needed, queued mid-turn).
  • If dictation fails, nothing is sent and the notice above the box says why, as it already does for a failed dictation. If nothing was heard and the box is empty, nothing is sent and the notice says "No words were heard, so nothing was sent. Try again."
  • Enter is unchanged: while listening it only stops, so the person can read what was heard, and the next Enter sends.
  • Send looks pressable while listening whenever there is something in the box, using its existing enabled style. Nothing else on screen changes.
  • A recording (OpenBot with a transcription provider) already worked this way: the box is hidden, and the recording's own "Transcribe and send" stops, transcribes and sends in one press. That path is unchanged, and now also has a real-browser test.

LiveDictation.stop() now returns a promise that settles true once the last words are in, and false when listening ended any other way (failed, or typing in the box let it go). Existing callers ignore the result.

Tests

The report was from OpenBot Desktop. The Desktop path is what most of these tests drive: the desktop app is faked by its Tauri channel contract (tests/desktop-shell.fixture.ts), so app/src/lib/desktop/speech.ts and the Desktop branch of liveDictationSource run for real, and "tonight" is the word the desktop hands over only once it is asked to stop.

  • app/tests/composer-live-dictation.test.tsx (the real composer, with the recorded Chrome speech fake and the Desktop channel fake): Send while listening sends the dictated words, including the last word handed over only after the stop, in the compact and default composer, Chrome and Desktop; a failed dictation sends nothing and says why; nothing heard sends nothing and says why; Send during the permission wait sends the box as it is; on Desktop, the last words still arrive when the channel delivers its messages out of order. The existing tests that Enter only stops still pass. The 5 Send-while-listening tests fail on main.
  • app/tests/composer-send-while-dictating.test.tsx (new, real browser, added to the Chromium + WebKit job): live dictation (Chrome speech fake and Desktop fake) in Chromium and WebKit, Send sends in one press; Enter only stops; a recording in Chromium through the real MediaRecorder on a fake microphone (Chromium's fake capture device on Linux CI), with the transcription answered by the test. The 4 live Send tests fail on main in both engines.

Changelog

Send while dictating
Pressing Send while dictating now stops dictation and sends your words in one press.

Send was off while live dictation listened, so a dictated message took
Stop, then Send. Send now stops listening, waits for the recognizer's
last words, and sends through the same submit path and checks as any
other send. If dictation fails, or nothing was heard and the box is
empty, nothing is sent and the notice above the box says why. Enter
still only stops, so the person can read what was heard first.
@davidmckayv
davidmckayv added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit cdd8c38 Dec 3, 2026
26 checks passed
@davidmckayv
davidmckayv deleted the send-stops-dictation branch December 3, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant