Skip to content

fix(tui): strip fragmented wheel reports and make friction approvals macOS-usable - #115

Merged
jkyberneees merged 3 commits into
mainfrom
fix/wheel-leak-composer
Sep 12, 2026
Merged

fix(tui): strip fragmented wheel reports and make friction approvals macOS-usable#115
jkyberneees merged 3 commits into
mainfrom
fix/wheel-leak-composer

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Summary

Two user-reported defects, one consolidated fix PR:

1. Mouse wheel codes repeating in the composer (Logitech)

A fast wheel burst splits SGR mouse reports mid-sequence; leftover tails (;1;1M, 64;5;13M — plain or carrying the Alt bit from the consumed ESC head) reached the model as text and spliced into the draft. stripLeakedMouseReports now strips bracketed reports wherever they appear, accepts an empty button field, honors the Alt bit, and clears any remainder that is entirely bare report tails. Typed text coexisting with a fragment is preserved; paste remains exempt.

2. Friction approvals required Alt+A / Alt+D — untypeable on macOS

The approval-fatigue gate now routes plain keys through the same empty-draft guard as normal approvals: bare a opens the confirmation editor (never approves — the typed word approve + ⏎ still decides, so friction keeps its teeth), bare d denies. Alt chords unchanged, paste inert, trust stays withdrawn under friction. Hints and README updated.

Validation

  • RED-first tests for both fixes (wheel_leak_test.go, friction_plainkeys_test.go); three pre-existing tests encoding the old Alt-only contract updated deliberately.
  • Gates: fmt / vet / lint 0 issues / full race suite green.
  • Adversarial sub-agent review of both diffs: CLEAN across six attack vectors (over-stripping, leak bypass, queue/expiry lifecycle, draft/paste guards, trust reachability, docs parity).

A fast wheel burst (Logitech) splits SGR mouse reports mid-sequence;
the tails that reach the model are bare report fragments like ';1;1M'
or '64;5;13M', plain or carrying the Alt bit from the consumed ESC
head. The previous filter refused Alt messages and required the
leading button digits, so those shapes spliced into the composer as
repeating codes. The strip now drops bracketed reports wherever they
appear, accepts an empty button field, honors the Alt bit, and clears
any remainder that is entirely bare report tails — typed text
coexisting with a stripped fragment is preserved.
The approval fatigue gate required Alt+A / Alt+D, which macOS
Option-as-UTF-8 terminals cannot deliver. The friction handler now
routes plain keys through the empty-draft guard of the normal approval
path: a bare 'a' opens the confirmation editor (never approves — the
typed word still decides), a bare 'd' denies. Alt chords unchanged,
paste still inert, trust stays withdrawn under friction. Hint strings
and README document the plain keys.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bodek 04e36e9 Commit Preview URL

Branch Preview URL
Sep 12 2026, 02:01 PM

@jkyberneees
jkyberneees merged commit 86e6c2d into main Sep 12, 2026
9 checks passed
@jkyberneees
jkyberneees deleted the fix/wheel-leak-composer branch September 12, 2026 14:04
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