Skip to content

ui-react: a touch kept on the composer mic for a second after Start opens presses Start when it lifts #4185

Closed

Description

@schlessera

Context

ComposerMic (packages/ui-react/src/components/chat/composer-mic.tsx) opens Start when a press has been held 0.6 s (HOLD_MS, line 5). It then swallows the release's click for one second (SWALLOW_MS, line 8; swallowNextClick, lines 57-76). The guard has a fixed length. It does not know whether the press that completed the hold is still down.

Start replaces the composer, and its Start button (bk-voice-start, packages/ui-kit/src/voice/StartCard.tsx:151-161) is drawn where the mic was. Found while working #4184, with native touch input in the pinned Chromium (rail-mixed, widths 320 and 1280) and the mic's timers on a controlled clock:

  • A touch pressed on the mic, kept down for HOLD_MS + SWALLOW_MS (1.6 s) and lifted in place produces a click on the Start button. The conversation starts: one conversation_start frame is sent.
  • The same touch lifted one millisecond earlier is swallowed, and Start stays open, unpressed.
  • With a mouse there is no click once Start has replaced the mic, so only a touch is affected.

The mic's stated contract is that no microphone, provider or history work starts until the user picks dictation or presses Start (composer-mic.tsx:31-33), and that the click a release produces after a hold is not a tap (composer-mic.tsx:52-56). Here the user never pressed Start. They only kept a finger down.

The same fixed guard shows without live conversation (the S4 notice): a press kept down 1.6 s and released on the mic starts dictation and dismisses the notice, for a mouse and for a touch. The pointer spec from #4184 pins that as today's behaviour in its cases named one second after a completed hold the release is a tap again, because #4174 asked for the guard's duration to be pinned from both sides.

Not known: whether a real touch browser sends a click after a touch this long. Many treat it as a long press and send none. Chromium driven through Input.dispatchTouchEvent sends one at any duration (measured up to 2 s).

Blocked by #4184

Scope

  • After a completed hold, the click made by releasing the press that completed it is swallowed however late the release comes. The guard ends with that release (and its click, if the browser makes one), not after a fixed second.
  • Cases in packages/ui-react/tests/browser/composer-mic.pointer.tsx, on its controlled clock, for Start and for S4.
  • Update the cases named one second after a completed hold the release is a tap again to the new behaviour.

Out of scope

  • HOLD_MS, and the one-second guard after a cancelled hold.
  • Checking real touch devices. The fix applies whether or not they send the click.

Acceptance criteria

  • A touch held on the mic until Start opens, kept down for 5 s on the controlled clock and lifted in place does not press Start: no conversation_start frame, Start still open. Proven with native touch in rail-coarse and rail-mixed, by a case that fails before the change.
  • Under S4, a mouse or touch press kept down for 5 s after the notice opens and released on the mic does not dictate, and leaves the notice open.
  • After either release, a deliberate tap on Start, or on the mic, still works.
  • A press, click or key after the release still ends the guard, so a later tap is never lost.
  • The guard after a cancelled hold is unchanged, and its cases in the spec still pass.

Verification

  • bun run check:pr --base origin/main.
  • Hosted heavy feedback: browser green.

Contract impact

None. Behaviour of one UI control.

Activity

  1. added
    type: fix
    area: ui-react
    blocked
    on Nov 17, 2026
  2. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Unblocked: #4184 is closed, so scripts/sync-project.ts is removing the blocked label.

  3. added
    agent-ready
    and removed
    blocked
    on Nov 17, 2026
  4. added this to the 0.45.0 milestone on Nov 17, 2026
  5. self-assigned this
    on Nov 17, 2026
  6. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-0d133c0a. Branch: fix/4185-composer-mic-release.

    Maintainer requested immediate implementation. Acceptance criteria and cited source verified against current main; no parent epic or open implementation PR.

  7. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Merged in #4235 as 70c1000a89b1a94fa932b8e32b6aac640343157c (PR head 8806e48d435dc8c7b9100f69b3ac6c51d660a56e). Exact-candidate confirmation passed: https://github.com/schlessera/brain-kit/actions/runs/44191104559. The squash’s automatic main run passed all selected categories, including all three browser shards: https://github.com/schlessera/brain-kit/actions/runs/44195000391 (attempt 1). Actual successful job checkout logs match the squash SHA; its parent and tree match the confirmed candidate. Independent review is clean and recorded. Both the issue and PR retain milestone 0.45.0; issue closure verified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyarea: ui-reacttype: fix

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions