Skip to content

Cancel stale mobile IME input when the active Session changes - #1309

Merged
nedtwigg merged 2 commits into
audit-mobile-gesture-sessionfrom
audit-mobile-composition-owner
Oct 21, 2026
Merged

nedtwigg merged 2 commits into
audit-mobile-gesture-sessionfrom
audit-mobile-composition-owner

Conversation

@nedtwigg

Copy link
Copy Markdown
Member

When the active mobile Session changes during IME composition, the hidden input remains mounted and its commit uses the new Session's input callback. Text begun for the old terminal could therefore reach its replacement, including when a remote terminal disappears.

Cancel the outstanding composition on a Session change, including switching away and back, while keeping the same textarea and keyboard focus. A subsequent composition works normally. Stacked on #1283's gesture ownership fix.

Validation: all three new transition regressions failed before the fix. 98 mobile UI, wall, gesture, scroll, and acknowledgement tests pass; library TypeScript, spec lint, Markdown lint, and diff checks pass.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: f6f817c
Status: ✅  Deploy successful!
Preview URL: https://2b032092.mouseterm.pages.dev
Branch Preview URL: https://audit-mobile-composition-own.mouseterm.pages.dev

View logs

@dormouse-bot dormouse-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The cancellation sits in an effect that also re-runs on touchMode and interactive, so it drops composed text when the active Session has not changed. In Pocket, cursorTouchAvailable is derived from the active pane's mouseReporting (PocketWall.tsx). When a full-screen program turns mouse reporting off while the user is composing in cursor mode, the existing touchMode === 'cursor' && !cursorTouchAvailable effect switches to gestures. That marks the composition cancelled, and compositionend then silently discards text meant for the same terminal. Keying the cancel on activeSessionId alone matches the new spec rule ("when the active Session changes") and still covers the switch-back case, since each transition changes the id.

Comment thread lib/src/components/MobileTerminalUi.tsx
@nedtwigg
nedtwigg merged commit 77ae97b into audit-mobile-gesture-session Oct 21, 2026
15 checks passed
@nedtwigg
nedtwigg deleted the audit-mobile-composition-owner branch October 21, 2026 17:09
nedtwigg added a commit that referenced this pull request Oct 21, 2026
…idents

Drop rules AGENTS.md and running-tend already carry, and replace general
advice with an evidence-to-action table, a ledger template, and the
commands for combined validation and landing checks. Cite the incidents
behind the specific lessons (#1313, #1320, #1283/#1309), name the
harness's one-window and real-Tauri limits, and point visual checks at
Argos. Allow read-only sub-agents for per-feature review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants