Skip to content

fix(ui-react): guard completed mic holds through release - #4235

Merged
schlessera merged 8 commits into
mainfrom
fix/4185-composer-mic-release
Nov 17, 2026
Merged

schlessera merged 8 commits into
mainfrom
fix/4185-composer-mic-release

Conversation

@schlessera

@schlessera schlessera commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #4185

What changed

A completed composer mic hold keeps swallowing the original release's click even when the finger stays down for five seconds after Start or the S4 notice opens. A fresh tap still starts conversation or dictation. Cancelled holds keep their existing one-second guard.

Why this shape

The completed hold records its pointer ID and waits for that pointer's release before starting fallback listener cleanup. The window capture listeners survive the composer being replaced by Start. The release click, a new pointer press, or a key clears the guard; browsers that produce no click clean up automatically. HOLD_MS stays 600 and cancellation stays at 1,000 ms. No machine contract changes.

Proof

Citations verified against origin/main at 0aeb62a7acaef51deabe6a6bc84d3b7b1b72e286: HOLD_MS:5, SWALLOW_MS:8, swallowNextClick:57-76, no capture promise:31-33, and StartCard.tsx:151-161. No parent epic. Scope follows the issue and the maintainer's immediate implementation request.

All gesture timings use the existing Vitest controlled clock. Native input runs in the pinned browser container with Bun 1.4.2 and Node 24.21.0. Command:

node scripts/visual.mjs --project=rail-fine --project=rail-coarse --project=rail-mixed --filter=composer-mic
  • Failing first after the coordinate correction: the product file was restored byte-for-byte from base 0aeb62a7acaef51deabe6a6bc84d3b7b1b72e286 (the old fixed-expiry guard), with the updated spec. Separate pinned runs avoid concurrent failure-screenshot artifact collisions:
    • node scripts/visual.mjs --project=rail-coarse --filter=composer-mic: 12 passed / 4 failed. Both five seconds after Start opens the original release never presses Start touch 320/1280 cases failed at the original release must not press Start: expected zero conversation_start frames, received one.
    • node scripts/visual.mjs --project=rail-mixed --filter=composer-mic: 24 passed / 6 failed. The same two native-touch cases failed at the same assertion: expected zero conversation_start frames, received one.
    • Both runs reached and passed the premise asserting that Start is under the original press/release point. All four failures were the unwanted Start activation, with no load or artifact errors in these individual receipts. The remaining expected failures were the S4 late-release cases (expected idle, received dictate).
    • The initial combined diagnostic run also reproduced all four Start failures, but had secondary screenshot-copy EPERM errors; the separate receipts above establish the failure without those artifact errors.
  • Restored implementation with the corrected hit points: all three projects passed, 64/64 cases, including unchanged cancellation boundaries, five-second Start and S4 releases, subsequent deliberate native taps, and guard clearing by a new press, key, or unpaired click.
  • Earlier mutation receipts at implementation head cc645d9e2c235fd4b8fa71470754ca95f6d5ebfd, restored afterwards (product code is unchanged by the review fix): (1) old fixed expiry is the failing-first run above; (2) removing only the keydown clearing listener made after a completed hold with no release click a new key ends the guard fail with a fresh key allows Start (no conversation_start), 1 failed / 17 passed in rail-fine; (3) removing only end() from click suppression made the corresponding new click case fail with a fresh click allows Start, 1 failed / 17 passed in rail-fine. An exploratory mutation removing all three clearing paths also lost a deliberate native Start tap (expected one frame, received zero); isolated mutations avoid attributing its cascading failures to individual paths. Final restoration: 64/64 passed across all three projects.
  • Strict NODE_OPTIONS=--max-old-space-size=8192 bun run typecheck: passed. The default 2 GiB Node heap initially aborted with an explicit JavaScript heap-out-of-memory error; provisioning compiler memory completed the same strict check without changing source or scope.
  • bun run build: passed. bun scripts/check-changeset-packages.ts and full bunx --no-install changeset status: passed; pending plan has no major bumps.
  • Local infrastructure attempt before the failing-first run: scratch permissions refused fixture creation before tests. Preflight discovery also initially refused a container-owned scratch fixture; restoring scratch ownership resolved it. Corrected rootless Docker scratch permissions; no test or guard weakened.
{"version":1,"kind":"brain-check-pr-receipt","head":"8806e48d435dc8c7b9100f69b3ac6c51d660a56e","base":"origin/main","mode":"focused","startedAt":"2026-11-17T22:30:24.417Z","finishedAt":"2026-11-17T22:31:05.283Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":13034.187211},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":118.85139100000015},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":84.47004799999922},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":20.464657000000443},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":27592.724557}]}

Collision inspection (bun scripts/collisions.ts --json --pr 4235) at head a1b28b8a2cb4fd72910145378303d7797eff4336: closure overlaps with #3054, #3056, #3059, #3069, #3581, #3622, #4151, #4198, #4199, #4234, #4236, #4237, #4238, #4240. No direct path collision was reported.

The first handoff superseded the earlier draft heavy-feedback request (https://github.com/schlessera/brain-kit/actions/runs/44163361504). Fresh independent review of 5c35488a8d23b9c8164a3cf0b49fce4efbcce9bb is clean and recorded. Heavy feedback run https://github.com/schlessera/brain-kit/actions/runs/44166336099 tested that exact head. Browser shard 3 (job 134333899457, attempt 1) failed the four existing #4230 ArtifactTheme Layout Phone/Desktop Escape-focus cases (dark/light), with 4 failed / 3369 passed; verification, packaging, runtime and four changed-spec repetitions passed on that head. This failed job was not rerun. Remaining work on that superseded tree was cancelled.

The base fix was already delivered in #4231 (d226c76700e837f22c5b79d207f0c2d1fbe20ef2). A clean merge refreshed the branch: 72c50e1c334651d15b5e9bcbba350b23e3be9419, parents 5c35488a8d23b9c8164a3cf0b49fce4efbcce9bb and 743f1547503e9ed5078ca7a533691aade0676618. Its tree f889f7088c59051088d062d64ae50a70ebac8428 equals the independently computed automatic merge tree. The merge diff against the pre-merge head was read; it adds only main's nine changed files, with no overlap or content changes in this PR's three files and no duplicated block. No new implementation commit or conflict resolution was added. The review remains applicable under the clean-base-merge rule. The fresh feedback request at that head (run 44169068382) was cancelled during admission before any selected proof ran: two admissions were mutually yielding after the lease cleared. This coordination defect is filed as #4239. Requests are now ordered to avoid that cycle. A second clean merge includes the subsequently delivered #4179: head 79c827ca2ea2cb4d820afaf8651c5ea50fa1b911, parents 72c50e1c334651d15b5e9bcbba350b23e3be9419 and d84fca3e08dfa7c5b65973f931ab08d740537d02, automatic merge tree 19bcf241531eb76fcffffde17762e937c0b5fd55. The merge diff adds only main's four changed files; this PR's three files remain byte-identical, with no duplicate block or conflict resolution. The current-head focused preflight passed. The feedback slot cleared after the other run finished. Main then advanced through #4196, so one further clean merge refreshed the branch to a1b28b8a2cb4fd72910145378303d7797eff4336, parents 79c827ca2ea2cb4d820afaf8651c5ea50fa1b911 and ade18f34fbfeb03f49a993268966974fd361cc69. Its tree 94a0bab0942887434fb4078044ab13d92ec392b4 matches the computed automatic merge tree. Comparing against the pre-merge head adds only main's 15 changed files: none overlap this PR's three files, whose contents remain byte-identical. Fresh heavy feedback and candidate proof remain required for this combined candidate.

Review finding fixed in 5c35488a8d23b9c8164a3cf0b49fce4efbcce9bb (test-only follow-up; no product change).

Coordinate audit for the review finding: both cases that lift an original hold onto the replacement Start button now press the upper portion of the mic and assert Start is hit at that same point before release. A coarse mic's centre lies below Start at 320 px and on its bottom edge at 1280 px. The earlier completed-hold case had the same weakness and is corrected too. Other mic releases target the unchanged mic (early release, cancellation, S4); their old-code S4 failures demonstrate the intended click is produced. The guard-clearing mouse cases intentionally produce no release click after replacement, then use explicit fresh Start activation coordinates.

Hosted heavy feedback qualification: https://github.com/schlessera/brain-kit/actions/runs/44177730826, attempt 1, success, exact head a1b28b8a2cb4fd72910145378303d7797eff4336 (tree 94a0bab0942887434fb4078044ab13d92ec392b4). All selected proof workers' checkout SHAs were read from their actual logs and match that head. All three browser shards passed: jobs 134384419088, 134384419233 and 134384419141. The changed composer spec passed four repetitions under CPU load (job 134384419122). Verification, packaging, unit, runtime, native-host, layout, captures and endurance all passed too. The reporting aggregate runs its policy from the workflow's default-branch event checkout by design and reports the requested head; it is feedback, not candidate proof. No failed test job was rerun.

After the passing feedback, main advanced through #4236. A clean refresh creates d76d1504f60637c1b3885ffc872eaa65e321dfe8, parents a1b28b8a2cb4fd72910145378303d7797eff4336 and 29e3cb0dc89d880143205edab2ae01e4f12c52c7, with tree 3bee9ad4be17e5a96cf2974247cf8610984961a6 equal to the automatic merge result. The diff against the pre-merge head adds only main's 15 CI watchdog/doc/test files; none overlap this PR's three files, whose bytes remain identical. The selected mic product timings remain on the controlled clock. The prior feedback receipt retains its actual head; new candidate confirmation and the squash's own main run establish the final combined tree. The current-head preflight receipt above passed.

A further clean refresh after #4199 advanced main creates 4ce0b3b387512f30662410bf873c72617245abf5, parents d76d1504f60637c1b3885ffc872eaa65e321dfe8 and 51d0f6de637509a97bed014eb0a284a196199e80. Its tree 255b3c5741f431728d1d2dc8bd80fae2fa60d16b equals the computed automatic merge. The pre-merge comparison adds only main's five GitHub draft-body UI/test/changeset files; none overlap this PR's three files. The mic implementation and controlled-clock spec remain byte-identical to the passing feedback source. The feedback receipt is retained at its actual source, with fresh exact-candidate confirmation and squash main proof still required.

While waiting for the reservation, #4237 advanced main. The clean refresh is 8806e48d435dc8c7b9100f69b3ac6c51d660a56e, parents 4ce0b3b387512f30662410bf873c72617245abf5 and cd896acbba3cdce68d5076171fe305835b0a01dc, automatic merge tree b203db5942ac7a99e1090a65eb9af55814dce541. Comparing to the pre-merge head adds only main's four determinism-warning/doc/fixture/test files. None overlap this PR's three files, which remain byte-identical; no duplicated block or resolution edit was introduced.

Containment

This is a gesture suppression guard: completing a hold triggers it; cancelled holds use their original bounded path. It suppresses only the release click, including when Start replaces the mic; earlier releases still dictate. Fresh press/key/click clears it, and release starts automatic fallback cleanup if the browser makes no click. The visible outcome is Start or S4 remaining open; no host/backend restriction or durable failure state is added. Native browser tests prove a fresh Start/mic tap remains usable while the unwanted release is suppressed. No microphone, provider-history, or server path changed.

Checklist

  • Focused preflight and behavioral receipts passed.
  • Changeset included; no personal data or machine contract changes.
  • PR and issue assigned to 0.45.0.
  • Selected hosted feedback and candidate proof passed.
  • Independent review recorded for the current head.

Anything left open

Independent review is complete. Hosted heavy feedback, integration confirmation, and the squash main-run verification remain. Hosted feedback is feedback, not merge proof. The #4230 record recovered while this branch was being refreshed; its already-delivered base fix is included by the clean merge. This PR does not claim that incident fix as its own.

@schlessera schlessera added this to the 0.45.0 milestone Nov 17, 2026
@uploads-sh

uploads-sh Bot commented Nov 17, 2026

Copy link
Copy Markdown

No uploads on this PR yet

This PR changes UI files (packages/ui-react/src/components/chat/composer-mic.tsx and packages/ui-react/tests/browser/composer-mic.pointer.tsx). Screenshots help reviewers see what changed.

  • From the CLI: uploads put before.png after.png --pr 4235
  • From an agent: ask it to attach screenshots with uploads.sh
  • By hand: drag images into the PR description and they're imported automatically
Tips for agents

Label each shot so reviewers know what they're seeing. Labels apply to every file in a call, so run one put per shot:

uploads put after.png --pr 4235 --meta path=/settings --state after --caption "Saved settings toast"
uploads put chat.png --pr 4235 --app ios --screen "Chat" --state after

No CLI? With the Uploads MCP, call sign_upload_url for files on disk (or put) with repo, pr: 4235 and the same screen, state and caption fields.

This comment updates with each upload, so you don't need to post the images yourself. A shot or two in the PR description is still welcome. Check what's attached with uploads list --pr 4235. More in the github-screenshots skill or the agent docs.

Workspace admins can turn this comment off in Settings → GitHub · docs

@schlessera
schlessera marked this pull request as ready for review November 17, 2026 19:56
@schlessera

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head cc645d9 against base 0aeb62a. Reviewer: agent. 1 finding: 0 fixed, 0 filed, 0 rejected, 1 without a disposition.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4235,
  "head": "cc645d9e2c235fd4b8fa71470754ca95f6d5ebfd",
  "base": "0aeb62a7acaef51deabe6a6bc84d3b7b1b72e286",
  "reviewer": "agent",
  "outcome": "findings",
  "findings": [
    {
      "summary": "packages/ui-react/tests/browser/composer-mic.pointer.tsx:281: The rail-coarse Start regression case passes with the old fixed-expiry guard, as the PR's failing-first receipt confirms: its release coordinates do not activate Start. It therefore cannot detect this guard regression in rail-coarse and misses #4185's explicit requirement for failing-first native-touch proof in both rail-coarse and rail-mixed."
    }
  ]
}

@schlessera

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head cc645d9 against base 0aeb62a. Reviewer: agent. 1 finding: 1 fixed, 0 filed, 0 rejected, 0 without a disposition.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4235,
  "head": "cc645d9e2c235fd4b8fa71470754ca95f6d5ebfd",
  "base": "0aeb62a7acaef51deabe6a6bc84d3b7b1b72e286",
  "reviewer": "agent",
  "outcome": "findings",
  "findings": [
    {
      "summary": "packages/ui-react/tests/browser/composer-mic.pointer.tsx:281: The rail-coarse Start regression case passes with the old fixed-expiry guard, as the PR's failing-first receipt confirms: its release coordinates do not activate Start. It therefore cannot detect this guard regression in rail-coarse and misses #4185's explicit requirement for failing-first native-touch proof in both rail-coarse and rail-mixed.",
      "disposition": "fixed",
      "commit": "5c35488a8d23b9c8164a3cf0b49fce4efbcce9bb"
    }
  ]
}

@schlessera

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head 5c35488 against base 0aeb62a. Reviewer: agent. No findings.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4235,
  "head": "5c35488a8d23b9c8164a3cf0b49fce4efbcce9bb",
  "base": "0aeb62a7acaef51deabe6a6bc84d3b7b1b72e286",
  "reviewer": "agent",
  "outcome": "no-findings",
  "findings": []
}

@schlessera

Copy link
Copy Markdown
Owner Author

Collision receipt for head d76d1504f60637c1b3885ffc872eaa65e321dfe8 (bun scripts/collisions.ts --json --pr 4235): closure overlaps with #3054, #3056, #3059, #3069, #3581, #3622, #4151, #4198, #4199, #4234, #4237, #4238, #4240. No direct path collision was reported.

Hosted feedback passed on the pre-refresh head a1b28b8a2cb4fd72910145378303d7797eff4336: https://github.com/schlessera/brain-kit/actions/runs/44177730826 (attempt 1). All selected proof-worker checkout SHAs were verified from actual job logs. The subsequent clean merge adds only main's CI watchdog changes and leaves the three mic-fix files byte-identical. The current-head check:pr receipt is in the body; the recorded independent review still returns refusal null. Candidate confirmation will prove the exact current head/base.

@schlessera

Copy link
Copy Markdown
Owner Author

Current collision receipt: head 4ce0b3b387512f30662410bf873c72617245abf5, base 51d0f6de637509a97bed014eb0a284a196199e80. bun scripts/collisions.ts --json --pr 4235 reports closure overlaps with #3054, #3056, #3059, #3069, #3581, #3622, #4151, #4198, #4234, #4237, #4238, #4240. No direct path collision was reported.

The latest clean base merge leaves this PR's three files byte-identical. Current check:pr passed and its receipt is in the body; review gate refusal is null. GitHub's synthetic checkout 08ce9c46fa7608e20f2303b7fd6b89d9382c97a8 has exactly these base/head parents and tree 255b3c5741f431728d1d2dc8bd80fae2fa60d16b, verified from Git. PR and #4185 milestones read back as 0.45.0.

@schlessera

Copy link
Copy Markdown
Owner Author

Collision receipt: head 8806e48d435dc8c7b9100f69b3ac6c51d660a56e, base cd896acbba3cdce68d5076171fe305835b0a01dc. bun scripts/collisions.ts --json --pr 4235 reports closure overlaps with #3054, #3056, #3059, #3069, #3581, #3622, #4151, #4198, #4234, #4238, #4240. No direct path collision was reported.

Current preflight passed; review refusal is null. GitHub synthetic checkout 5d2220638f950b3207240d206cd1716e0a002f2e has those exact base/head parents and tree b203db5942ac7a99e1090a65eb9af55814dce541. The clean base refresh changes none of the three mic-fix files. Passing hosted feedback remains attributed to its actual source head A1b as recorded in the body. Both milestones read back as 0.45.0.

@schlessera
schlessera marked this pull request as ready for review November 17, 2026 22:32
@schlessera
schlessera merged commit 70c1000 into main Nov 17, 2026
49 of 62 checks passed
@schlessera

Copy link
Copy Markdown
Owner Author

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant