orca/mobile/scripts
Brennan Benson f23b3308a5
fix(mobile): route external mouse click and drag to the terminal (#11473)
* fix(mobile): route external mouse click and drag to the terminal

The terminal WebView suppresses mousedown/click at capture so xterm's own
mouse handling stays inert (its onData bytes are dropped by the mobile
bridge). That left hardware mouse clicks and drags with no path at all:
touch taps reached mouse-aware TUIs and drove selection, while a Bluetooth
mouse or trackpad click did nothing (#8818; wheel half landed in #11247).

Add a pointer-event router on the terminal surface (pointerType 'mouse',
left button only) that mirrors touch semantics:

- plain click: same pipeline as a touch tap (links/file paths first, then
  tracking-mode press+release reports, else keyboard focus), and a click
  on an active selection dismisses it like touch does
- drag with mouse tracking: press at the anchor, per-cell motion reports
  (drag/any modes), release on pointerup or pointercancel
- drag without tracking: character-anchored selection reusing the touch
  handle-drag plumbing (edge scroll, handles, copy pill)

Widen the RN gesture-input grammar to pass left-drag motion reports
(SGR button 32, default-encoding byte 64) through the existing
validation and rate limiting.

Mock server: echo the subscribe viewport and serialize scrollback so the
session screen leaves the resubscribe loop, serve the session-tabs
subscribe stream, and add a MOCK_TUI=1 mouse-tracking scenario plus a
[SEND] byte log - the rig used to reproduce and verify this fix on an
Android emulator.

Fixes #8818

* fix(mobile): capture the mouse pointer and clear stale gestures on pointerdown

A drag leaving the terminal surface dropped pointermove/pointerup without
pointer capture, stranding the gesture; a pointerup lost outside the
WebView could leave a tracked press latched until the next gesture.

* fix(mobile): end mouse gestures whose pointerup never reached the surface

Capture the mouse pointer on pointerdown so a drag that leaves the surface
keeps delivering pointermove/pointerup; when capture is unavailable and the
release is lost anyway, synthesize the release from the next buttons==0
pointermove or the next pointerdown, so a tracking TUI is never left with
the left button latched down.

* fix(mock-server): clear the terminal stream interval on resubscribe and unsubscribe

* fix(mobile): synthesize the lost-pointerup release at the pointer's current cell

* test(mobile): split terminal mouse click and drag coverage

* test(mobile): satisfy changed-line quality checks

* fix(mobile): cancel stale mock terminal callbacks

* refactor(mobile): extract mouse report cell mapping
2026-07-31 00:54:40 -07:00
..
build-terminal-webview-engine.mjs Fix blank mobile terminal on Android devices with outdated WebViews or blocked CDN (#7186) 2026-07-03 15:22:00 -07:00
mobile-expo-cli.mjs refs/heads/handle-mobile-pull-request-issues (#6598) 2026-06-28 00:58:17 -07:00
mobile-lag-scenario.ts Fix mobile workspace parity (#6207) 2026-06-23 17:07:28 -07:00
mock-server-account-rpc.ts feat(mobile): add safe Codex rate-limit resets (#9394) 2026-07-24 14:42:04 -07:00
mock-server-account-state.ts feat(mobile): add safe Codex rate-limit resets (#9394) 2026-07-24 14:42:04 -07:00
mock-server-encryption.ts
mock-server-file-preview-data.ts Show full workspace file tree on mobile (#7289) 2026-07-06 15:41:51 -07:00
mock-server-git-state.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
mock-server-key-pair.ts fix(mobile): harden native chat send budgets, streams, and stop (#10814) 2026-07-26 22:08:38 -07:00
mock-server-native-chat-scenario.ts fix(mobile): harden native chat send budgets, streams, and stop (#10814) 2026-07-26 22:08:38 -07:00
mock-server-rpc-handlers.ts fix(mobile): route external mouse click and drag to the terminal (#11473) 2026-07-31 00:54:40 -07:00
mock-server-session-tabs-fixture.ts fix(mobile): route external mouse click and drag to the terminal (#11473) 2026-07-31 00:54:40 -07:00
mock-server-terminal-fixtures.ts feat(mobile): add safe Codex rate-limit resets (#9394) 2026-07-24 14:42:04 -07:00
mock-server-terminal-stream.ts fix(mobile): route external mouse click and drag to the terminal (#11473) 2026-07-31 00:54:40 -07:00
mock-server.ts fix(mobile): harden native chat send budgets, streams, and stop (#10814) 2026-07-26 22:08:38 -07:00
prepare-android-release.mjs fix(mobile): keep Android release versionCode committed (#7271) 2026-07-03 15:26:11 -07:00
repro-terminal-colors.ts
repro-workspace-picker-lag.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
repro-worktree-startup-stream.ts
start-emulator-pairing-runtime.mjs fix(mobile): harden native chat send budgets, streams, and stop (#10814) 2026-07-26 22:08:38 -07:00
start-emulator.mjs Revert "fix(memory): bound OOM-prone accumulators (#10179)" (#10255) 2026-07-23 18:35:31 -07:00
start-expo.mjs chore(lint): adopt unicorn/prefer-import-meta-properties (error) (#6847) 2026-06-29 23:37:30 -07:00
test-subscribe.ts