Skip to content

feat(ui): hold-to-record dictation on the composer mic button - #111114

Merged
steipete merged 10 commits into
mainfrom
codex/talk-web-hold-to-record
Jul 19, 2026
Merged

steipete merged 10 commits into
mainfrom
codex/talk-web-hold-to-record

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The web composer has no dictation: the mic button only toggles a full realtime Talk session. Users who want to speak a message into the composer — without starting a live conversation — have no path, even though the gateway already ships a transcription relay that Android's dictation uses.

Why This Change Was Made

Press-and-hold is the natural quick-dictation gesture (design reference: Claude desktop's composer). A hold ≥250ms records; release inserts the transcript into the composer at the cursor without sending; a quick tap keeps starting realtime Talk exactly as before. The pipeline rides the existing gateway transcription relay as-is — talk.session.create { mode: "transcription", transport: "gateway-relay", brain: "none" }, G.711 μ-law @ 8kHz (src/gateway/talk-transcription-relay.ts), the same envelope Android's dictation consumes. No server or protocol changes.

User Impact

  • Hold the mic button, speak, release: transcribed text lands at your cursor, ready to edit — never auto-sent. Slide off, press Escape, or lose focus to cancel.
  • Recording honors your selected microphone; live level + partial transcript show while recording; a distinct finishing state covers final-transcript drain.
  • Robust failure modes: no transcription provider → immediate clear error; mic permission denied → existing mic error strings; gateway disconnect mid-recording → keeps already-final text, single disconnect error, no hang; hold gesture disabled while a Talk session owns the mic.
  • New composerHoldToRecord setting (default on) with a Settings toggle; turning it off restores the exact previous button behavior.

Release-note context: Composer hold-to-record dictation — hold the web composer's mic button to dictate into the message box via the gateway transcription provider; tap still starts realtime Talk.

Evidence

  • 290 tests passing across composer-dictation (new), chat-composer, chat-view, settings, and config view suites — includes gesture threshold, session lifecycle ordering (mic acquire → session create → append → close), buffered startup audio, pointer-capture retention across the hold-start rerender, disconnect/blur/Escape cancellation, insertion/caret behavior, and setting-off paths.
  • Three structured review rounds: pointer-capture loss on rerender (fixed via stable template identity + regression test), disconnect drain lock + armed click suppression (fixed + regression tests), and one final finding rejected with gateway-source evidence (the transcription relay intentionally emits the transcriptionSessionId envelope this client parses; Android consumes the same shape — documented inline).
  • Audio contract verified against src/gateway/talk-transcription-relay.ts (encoding, sample rate, event shapes) rather than assumed.
  • Testbox UI typecheck + type-aware UI lint: green. Focused oxfmt/oxlint, git diff --check: clean.
  • Gap: live end-to-end browser dictation against a configured provider not exercised in CI (requires real mic + provider); covered by mocked gateway-frame tests mirroring the relay's emission shapes.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Jul 19, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 19, 2026, 2:30 AM ET / 06:30 UTC.

Summary
Adds press-and-hold composer dictation through the existing gateway transcription relay, a default-on device-local setting and toggle, UI status feedback, G.711 μ-law capture, and mocked lifecycle coverage.

PR surface: Source +1017, Tests +805. Total +1822 across 17 files.

Reproducibility: yes. from source with medium confidence: release during provider WebSocket authentication/reconnection, after browser frames are queued but before readiness, then observe that finalization closes the session and drops queued audio. A real configured-provider browser run is still needed to confirm the exact user-visible outcome.

Review metrics: 1 noteworthy metric.

  • Persisted interaction default: 1 added default-on device-local setting. The new preference changes the existing composer microphone gesture for stored settings that lack an explicit opt-out.

Stored data model
Persistent data-model change detected: serialized state: ui/src/app/settings.node.test.ts, serialized state: ui/src/pages/chat/chat-view.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Repair the provider-readiness/queued-audio finalization path with a focused regression test.
  • [P1] Add redacted real browser/provider evidence showing hold-to-record, release, and final text insertion without auto-send.
  • Obtain maintainer direction on whether the new composer gesture should default on for existing users.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR provides extensive mocked lifecycle tests and CI but explicitly lacks an after-fix browser run with a real microphone and configured transcription provider; add a redacted recording, terminal/live output, or runtime logs showing hold, speech, release, and inserted final text. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A redacted web UI chat recording can directly prove the central user-visible behavior that mocked gateway tests cannot establish. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis web UI chat proof: verify hold-to-record with a configured transcription provider inserts final text into the composer without sending, and return redacted diagnostics.

Risk before merge

  • [P1] A short dictation released while the configured transcription provider is still connecting can discard queued audio before it reaches the provider, producing no final text despite the browser having sent frames.
  • [P1] The default-on hold gesture changes an existing mic control and introduces a persisted preference; maintainers need to accept the upgrade and discoverability behavior for current Control UI users.
  • [P1] Mocked gateway-frame coverage does not establish real browser microphone capture, provider connection, relay finalization, and composer insertion behavior together.

Maintainer options:

  1. Repair finalization before merge (recommended)
    Keep queued microphone frames alive until the transcription provider is ready or expose a relay-level readiness/finalize contract, with focused coverage for immediate release during connection.
  2. Accept the provider-startup limitation
    Merge only if maintainers explicitly accept that very short dictations during provider startup may return no final transcript.
  3. Pause pending product direction
    Pause the PR if maintainers do not want the new default-on microphone gesture or cannot support its provider-finalization semantics yet.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Repair provider-readiness finalization so a quick hold-and-release cannot discard queued transcription audio; add focused coverage for provider connection pending at release, then refresh real browser/provider proof.

Next step before merge

  • [P1] A narrow finalization repair is possible, but the default-on interaction change requires maintainer product direction and the contributor must provide real browser/provider behavior proof.

Maintainer decision needed

  • Question: Should the Control UI make hold-to-record dictation a default-on behavior change for every existing composer mic button, or should it ship opt-in until maintainers have accepted the interaction and upgrade behavior?
  • Rationale: The patch adds a new persisted UI preference whose default changes the semantics of an established microphone control; source and tests cannot decide the intended product default.
  • Likely owner: steipete — The available review context identifies steipete as the implementation contact for the proposed behavior; merged-area ownership could not be established from the read-only inspection environment.
  • Options:
    • Ship default-on after proof (recommended): Keep the proposed default, but require the provider-readiness repair and real browser/provider proof before merge.
    • Ship opt-in first: Default the new hold gesture off so existing users retain the exact mic interaction until they enable dictation in Settings.
    • Defer the feature: Pause this PR until maintainers define the intended composer voice interaction and release messaging.

Security
Cleared: The reviewed diff adds no dependency, workflow, permission, secret-handling, or supply-chain execution path; the primary risks are functional finalization and interaction compatibility.

Review findings

  • [P1] Wait for provider readiness before closing dictation — ui/src/pages/chat/composer-dictation.ts:1
Review details

Best possible solution:

Preserve the existing tap-to-Talk behavior, make dictation finalization wait for provider readiness or retain queued audio through finalization, then land only after a redacted real browser run proves hold, speech, release, final transcript insertion, cancellation, and selected-microphone behavior against a configured provider.

Do we have a high-confidence way to reproduce the issue?

Yes, from source with medium confidence: release during provider WebSocket authentication/reconnection, after browser frames are queued but before readiness, then observe that finalization closes the session and drops queued audio. A real configured-provider browser run is still needed to confirm the exact user-visible outcome.

Is this the best way to solve the issue?

No: reusing the transcription relay is the right boundary, but closing the relay without a provider-readiness or queued-audio preservation guarantee is not a durable dictation finalization path across providers.

Full review comments:

  • [P1] Wait for provider readiness before closing dictation — ui/src/pages/chat/composer-dictation.ts:1
    When release occurs while the configured transcription provider is still connecting, the relay can close before the provider has flushed queued audio; the queued frames are then lost and the user gets no final inserted text. Preserve queued audio through finalization or add a readiness/finalize contract before closing the remote session. This remains from the prior review; the current head's later commits are test-only.
    Confidence: 0.88

Overall correctness: patch is incorrect
Overall confidence: 0.84

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7055ed578d08.

Label changes

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🧂 unranked krab, so this older rating label is no longer current.

Label justifications:

  • P2: This is a substantial but non-emergency Control UI feature whose remaining risk is limited to dictation users and existing mic interaction behavior.
  • merge-risk: 🚨 compatibility: The branch adds a default-on persisted setting that changes the established composer microphone interaction for existing users.
  • merge-risk: 🚨 availability: Closing dictation before a transcription provider is ready can produce a failed or empty dictation result after the user has recorded audio.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides extensive mocked lifecycle tests and CI but explicitly lacks an after-fix browser run with a real microphone and configured transcription provider; add a redacted recording, terminal/live output, or runtime logs showing hold, speech, release, and inserted final text. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +1017, Tests +805. Total +1822 across 17 files.

View PR surface stats
Area Files Added Removed Net
Source 11 1058 41 +1017
Tests 6 922 117 +805
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 1980 158 +1822

What I checked:

  • Unresolved relay readiness path: The latest completed ClawSweeper review identified that the relay returns before provider connection settles and that closing while a provider WebSocket is still authenticating clears queued pre-ready audio; the current PR's later commits are test-isolation changes rather than a relay/readiness implementation change. (ui/src/pages/chat/composer-dictation.ts, c46c4848d3cd)
  • Gateway contract: The documented Talk contract supports transcription clients using talk.session.create, talk.session.appendAudio, talk.session.cancelTurn, and talk.session.close; the PR must preserve finalization semantics across configured providers, not only mocked gateway frames. (src/gateway/talk-transcription-relay.ts, 7055ed578d08)
  • Proof gap acknowledged by the PR: The PR body explicitly says live browser dictation with a real microphone and configured provider was not exercised; mock tests, lint, and CI do not show that hold, provider readiness, release, and composer insertion work together in a real setup. (ui/src/pages/chat/composer-dictation.test.ts, c46c4848d3cd)
  • Compatibility-sensitive preference change: The branch adds composerHoldToRecord with a default value of true and persists only opt-out state, changing the existing mic-button interaction for existing Control UI users unless they discover the new setting. (ui/src/app/settings.ts:359, c46c4848d3cd)

Likely related people:

  • steipete: Authored the current PR's ten commits, including the new composer dictation controller, settings surface, and follow-up fixes; this identifies the implementation contact, not established ownership of the merged mainline area. (role: proposed implementation author; confidence: low; commits: e3a0993b4bca, 9a92627340d5, c46c4848d3cd; files: ui/src/pages/chat/composer-dictation.ts, ui/src/app/settings.ts, ui/src/pages/chat/components/chat-composer.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (4 earlier review cycles)
  • reviewed 2026-07-19T01:46:24.628Z sha 6523a69 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-19T03:34:09.314Z sha 7c66dfd :: needs real behavior proof before merge. :: [P1] Commit transcription input before closing the relay
  • reviewed 2026-07-19T04:16:29.310Z sha 7c66dfd :: needs real behavior proof before merge. :: [P1] Commit transcription input before closing the relay
  • reviewed 2026-07-19T06:07:52.117Z sha f801c4b :: needs real behavior proof before merge. :: [P1] Wait for provider readiness before closing dictation | [P2] Avoid acquiring the microphone after a cancelled hold | [P2] Use the relay cancellation contract for cancelled holds

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6523a69952

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +165 to +167
this.inputMeter = new RealtimeTalkMediaStreamMeter(this.callbacks.onLevel);
this.inputMeter.start(media, this.context);
this.inputPump.start(media, this.context, (samples) => this.appendAudio(samples));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use sub-512 ms capture frames for 8 kHz dictation

At the configured 8 kHz sample rate, RealtimeTalkPcmInputPump uses the 4096-sample buffer in ui/src/pages/chat/realtime-talk-audio.ts:88, so onSamples runs only about every 512 ms. Releasing the button immediately stops the processor without flushing its partially filled buffer; consequently, utterances shorter than 512 ms can produce no audio at all, and every recording can lose up to the final 512 ms of speech. Use a smaller dictation capture buffer or a capture path that flushes/resamples pending samples before stopping.

Useful? React with 👍 / 👎.

Comment on lines +452 to +453
if (this.phase === "stopping") {
return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle disconnects while finalizing

If the Gateway disconnects after pointer release has entered stopping, this early return skips markGatewayDisconnected(). A finalization with no completed transcript or with only a partial therefore remains locked for the full 10-second drain timeout and can report a finalization timeout instead of the disconnect, whereas disconnects during recording finish promptly.

Useful? React with 👍 / 👎.

Comment on lines +456 to +462
const keepFinal = this.active && !options.connected;
if (keepFinal) {
this.session?.markGatewayDisconnected();
}
void this.stop({ commit: keepFinal });
if (keepFinal) {
options.onError(t("chat.composer.dictationDisconnected"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Suppress request errors after a known disconnect

When the Gateway disconnects while talk.catalog or talk.session.create is pending, this path immediately emits the friendly disconnect error and starts finish(), but the pending RPC rejection is subsequently passed through reportFailure() and invokes onError a second time with the low-level socket error. This overwrites the intended chat error and defeats the single-error behavior; mark the session failure as disconnect-owned or suppress later request failures once disconnection is known.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the codex/talk-web-hold-to-record branch from 6523a69 to f6dc842 Compare July 19, 2026 02:56

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f6dc84250d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +354 to +356
this.closePromise ??= this.client
.request("talk.session.close", { sessionId: this.sessionId })
.then(() => undefined)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Commit OpenAI audio before closing dictation

When OpenAI transcription is active and the user releases before server VAD has observed its configured silence interval, this closes the relay immediately after stopping microphone input. The relay calls sttSession.close() (src/gateway/talk-transcription-relay.ts:408-429), but the OpenAI session registers no onClose action (extensions/openai/realtime-transcription-provider.ts:218-257), unlike providers that send a finalize/end frame, so the buffered utterance is never explicitly committed and cannot produce the final transcript that finish() awaits. This makes an otherwise fully transmitted utterance time out after 10 seconds and insert nothing; send the provider's input-buffer commit before closing or add a generic transcription-session finalize contract.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Jul 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f801c4bc0d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +203 to +204
await this.appendChain;
await this.closeRemote();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve queued audio until the provider is ready

When the user releases while the provider WebSocket is still authenticating or reconnecting, this closes the relay immediately. The relay returns the session before sttSession.connect() settles (src/gateway/talk-transcription-relay.ts:333-367), while the WebSocket session queues pre-ready audio but clears that queue in close() (src/realtime-transcription/websocket-session.ts:124-145). Consequently, a quick dictation can lose every frame even after the browser successfully sent it; wait for provider readiness/queue flushing before closing, or preserve the queued audio during finalization.

Useful? React with 👍 / 👎.

Comment on lines +147 to +150
const inputDeviceId = loadSettings().realtimeTalkInputDeviceId?.trim() || undefined;
const media = await openRealtimeTalkInput(inputDeviceId, {
signal: this.abortController.signal,
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip microphone acquisition after cancellation

If the hold is released, blurred, or cancelled while talk.catalog is pending, stopCapture() aborts the signal, but after the catalog response this still invokes getUserMedia. openRealtimeTalkInput() does not inspect an already-aborted signal until after getUserMedia resolves (ui/src/pages/chat/realtime-talk-input.ts:157-184), so a cancelled gesture can unexpectedly display a permission prompt or acquire the microphone later only to discard it. Check the stopped/aborted state before starting microphone acquisition.

Useful? React with 👍 / 👎.

await this.stopCapture();
await this.startPromise?.catch(() => undefined);
await this.appendChain;
await this.closeRemote();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Route cancelled holds through the cancellation lifecycle

For Escape, blur, pointer-cancel, or slide-off, cancel() calls closeRemote(), which sends talk.session.close. The relay's close path explicitly emits input.audio.committed (src/gateway/talk-transcription-relay.ts:408-428), whereas talk.session.cancelTurn reaches cancelTalkTranscriptionRelayTurn() and emits the turn.cancelled outcome (src/gateway/talk-transcription-relay.ts:431-450). These user-cancelled dictations are therefore recorded as committed turns in Talk observability/state; use the cancellation contract and clean up the unified session afterward.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c46c4848d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const dictationOptions = {
client: props.gatewayClient ?? null,
connected: props.connected,
enabled: props.composerHoldToRecord !== false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disable dictation when the composer cannot accept drafts

When canSend is false for an archived or otherwise read-only session (chat-pane.ts:2857), the textarea is disabled, but this still enables the hold controller and the microphone button remains clickable while connected. A long press therefore acquires the microphone, creates a transcription session, and calls onDraftChange to insert text into a composer the user cannot edit or send; gate hold-to-record on canCompose while preserving the existing tap-to-Talk behavior if needed.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit aae5b0f into main Jul 19, 2026
102 of 104 checks passed
@steipete
steipete deleted the codex/talk-web-hold-to-record branch July 19, 2026 07:03
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 20, 2026
…aw#111114)

* feat(ui): add hold-to-record dictation

* chore: drop changelog edit (release generation owns CHANGELOG.md)

* fix(ui): preserve composer controls after rebase

* fix(ui): preserve dictation pointer capture

* fix(ui): finish dictation on cancellation

* docs(ui): note transcription-relay event envelope contract at the dictation parser

* test(ui): complete realtime-talk-input mock factory for shared-registry workers

* test(ui): isolate composer mocks across workers

* test(ui): isolate shared chat module mocks

* test(ui): type shared chat spies
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
…aw#111114)

* feat(ui): add hold-to-record dictation

* chore: drop changelog edit (release generation owns CHANGELOG.md)

* fix(ui): preserve composer controls after rebase

* fix(ui): preserve dictation pointer capture

* fix(ui): finish dictation on cancellation

* docs(ui): note transcription-relay event envelope contract at the dictation parser

* test(ui): complete realtime-talk-input mock factory for shared-registry workers

* test(ui): isolate composer mocks across workers

* test(ui): isolate shared chat module mocks

* test(ui): type shared chat spies
obviyus added a commit that referenced this pull request Nov 13, 2026
fix(ui): keep dictated text when the window loses focus

Control UI dictation cancelled on window blur and on a hidden page, discarding everything already transcribed, so an Alt+Tab, screensaver or tab switch threw away minutes of speech. Blur now stops dictation through the existing commit path, so the transcribed text stays in the draft; capture still stops, the microphone is released and nothing is sent. A repeated blur or hidden event while the final text drains commits it once. Escape and hold-mode drag-out still discard. "Lose focus to cancel" came from #111114's hold-to-record gesture, which no longer exists now that all dictation is latched; keeping the user's already-transcribed draft is the intended behavior. No new text.

Evidence: the built Gateway and Control UI in headed Chromium with a fake microphone and a local speech-to-text stand-in, with real keystrokes for window blur and tab switch, main once and candidate once. On main a window blur, a tab switch, and a stop followed by a tab and window switch all reset the draft to its starting text. With this change the full dictated text stays in the draft, committed once. Escape and drag-out discard and Stop keeps the same text on both; in every run the microphone stopped and nothing was sent. Control UI +156 B gzip. The latched test covers click, blur and visibilitychange each followed by a hidden page, at net 0 test lines. Screenshots: #197852 (comment).

Fixes #197843. Thanks @wr-web, and @digitalfrost84 for the report.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 14, 2026
)

fix(ui): keep dictated text when the window loses focus

Control UI dictation cancelled on window blur and on a hidden page, discarding everything already transcribed, so an Alt+Tab, screensaver or tab switch threw away minutes of speech. Blur now stops dictation through the existing commit path, so the transcribed text stays in the draft; capture still stops, the microphone is released and nothing is sent. A repeated blur or hidden event while the final text drains commits it once. Escape and hold-mode drag-out still discard. "Lose focus to cancel" came from openclaw#111114's hold-to-record gesture, which no longer exists now that all dictation is latched; keeping the user's already-transcribed draft is the intended behavior. No new text.

Evidence: the built Gateway and Control UI in headed Chromium with a fake microphone and a local speech-to-text stand-in, with real keystrokes for window blur and tab switch, main once and candidate once. On main a window blur, a tab switch, and a stop followed by a tab and window switch all reset the draft to its starting text. With this change the full dictated text stays in the draft, committed once. Escape and drag-out discard and Stop keeps the same text on both; in every run the microphone stopped and nothing was sent. Control UI +156 B gzip. The latched test covers click, blur and visibilitychange each followed by a hidden page, at net 0 test lines. Screenshots: openclaw#197852 (comment).

Fixes openclaw#197843. Thanks @wr-web, and @digitalfrost84 for the report.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant