Repository navigation
fix(mobile): keep the pane menu off a dragged text selection on Android - #1159
Conversation
Android Chrome ends a dragged selection with a second contextmenu typed "mouse", with no press of its own. The #838 guard trusted the pointer type when there was one, so that event opened the pane's menu over the phone's Copy toolbar. The last press decides now: after a touch, only a mouse press or a key makes a contextmenu the app's. Reproduced and checked on the owned API 36 emulator (Chrome 133): a long press dragged across a chat message opened "Pane actions" before, and leaves only the selection and Chrome's toolbar after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
Change
On Android Chrome, a long press followed by dragging the selection opened the pane's menu (Rename pane, Split right…) over the phone's Copy toolbar. A long press alone was fine.
Chrome sends two
contextmenuevents for that gesture: one typedtouchwhen the long press starts, and a second typedmouse, with nopointerdownof its own, when the dragged selection ends. #838 trusted the pointer type whenever there was one, so the second one counted as a right-click. The last press now decides: after a touch, acontextmenuis the app's only once a mouse press or a key has come since (PaneCanvas'stouchPress, which a mousepointerdownand anykeydownalready reset).Validation
adb input touchscreen motionevent: hold 900 ms, drag, lift) over a chat message in the demo app. Before: the events werecontextmenu(touch),pointercancel, thencontextmenu(mouse, target.pane-frame), and "Pane actions" opened. After: same events, the selection stays and only Chrome's toolbar shows.scripts/touch-long-press-demo-regression.tsgains adrag-selectcase (a touch press, then acontextmenutypedmouse). It fails onmainand passes here; the keyboard and right-click cases still open the menu.bun run check fastpasses.🤖 Generated with Claude Code