Skip to content

Keep physical keys out of the mobile terminal while a gesture confirmation is open - #1504

Merged
nedtwigg merged 2 commits into
mainfrom
fix/mobile-confirm-dialog-keys
Nov 3, 2026
Merged

nedtwigg merged 2 commits into
mainfrom
fix/mobile-confirm-dialog-keys

Conversation

@dormouse-bot

Copy link
Copy Markdown
Collaborator

On a phone or iPad with a physical keyboard, keys typed while the radial menu's Send ⌃C? or Paste? confirmation is open went straight to the terminal. The dialog takes no focus, so focus stays on the body, and the window keydown listener in MobileTerminalUi (MobileTerminalUi.tsx#L804) checked only the composer and the view. Pressing Enter to answer the dialog sent a newline to the Session and left the dialog open. The bug came in with the physical-keyboard path in #1495.

The listener, and the native-paste listener next to it, now stand down while a confirmation is pending, the same way they already do for the composer and the Sessions screen. The dialog is aria-modal, so nothing behind it should take input. The "Physical keyboard" rule in docs/specs/mobile-terminal-ui.md now names that condition.

A new test in MobileTerminalUi.test.tsx opens the ⌃C confirmation and presses Enter. It fails on main because the key is sent, and passes with this change. The full MobileTerminalUi suite, the lib typecheck, and the spec lint pass.

…s open

The Send ⌃C? and Paste? dialogs take no focus, so a physical Enter pressed
to answer one went to the Session as a newline and left the dialog open.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 462cc5b
Status: ✅  Deploy successful!
Preview URL: https://e09532f5.mouseterm.pages.dev
Branch Preview URL: https://fix-mobile-confirm-dialog-ke.mouseterm.pages.dev

View logs

Main narrowed the physical-keyboard listener to terminalInteractive, for a shown browser. Keep that and this branch's confirming check on the same listener.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nedtwigg
nedtwigg merged commit 949440a into main Nov 3, 2026
17 checks passed
@nedtwigg
nedtwigg deleted the fix/mobile-confirm-dialog-keys branch November 3, 2026 00:17
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