fix(mobile): give a sideways drag on the terminal to the session swipe alone

The terminal's touch handler and the session swipe judged every gesture separately, so a sideways flick also ended as a tap on the session being left (a link, a CLI click, a keyboard toggle) or as a vertical scroll. The terminal now locks the dominant axis past the tap slop, hands a sideways drag it cannot pan to the swipe and publishes the axis, and the swipe stands aside for scrolls, pans, a lift the terminal consumed (its selection gesture), touch selections, a second finger and surfaces with controls of their own. A touch that starts outside the terminal resets the published axis, so swiping from the phone home screen into a session keeps working after a terminal scroll. A deliberate swipe gets 500ms instead of 300ms, and vertical drift cancels it mid-gesture instead of only at the lift.
This commit is contained in:
JD committed 2026-10-21 21:40:27 -04:00
1 parent 39077281d1
commit 63cada938d
8 files changed
+221 -28

No files matched your search

+3 -3
View File
@@ -68,11 +68,11 @@ export const KEYBOARD = {
CONFIRM_TIMEOUT: 2000,
} as const;
// Swipe constants (match app.js SwipeHandler)
// Swipe constants (match SwipeHandler in mobile-handlers.js)
export const SWIPE = {
MIN_DISTANCE: 80,
MAX_TIME: 300,
MAX_VERTICAL_DRIFT: 100,
MAX_TIME: 500,
MAX_VERTICAL_DRIFT: 50,
} as const;
// Subagent window constants