Gesture system
SootSim implements the React Native responder system and integrates with react-native-gesture-handler.
Responder system
The touch pipeline (engine/touch/):
- Hit testing — find the deepest node at touch coordinates
- Responder negotiation — walk up the tree asking
onStartShouldSetResponder - Event dispatch — send touchStart/touchMove/touchEnd to the responder
- Responder transfer — handle
onMoveShouldSetResponderfor mid-gesture transfers
Hit testing
engine/hit-test.ts walks the node tree depth-first, checking if the touch point falls within each node’s absolute bounds. Respects:
pointerEvents(none, box-none, box-only, auto)overflow: hiddenclipping- z-index ordering
Gesture handler integration
The react-native-gesture-handler stub (@soot/compat) provides:
- Tap — single and double tap with position tracking
- Pan — translation, velocity, state machine
- LongPress — duration-based with position
- Composed gestures — Race, Simultaneous, Exclusive
Gesture support is implemented inside the engine’s touch, hit-test, scroll, and gesture-handler layers so responder ownership and gesture state are derived from the same live render tree the app is running against.
Scroll
engine/scroll.ts implements iOS scroll physics:
- Deceleration — momentum after release
- Rubber band — elastic overscroll at bounds
- Snap — pagingEnabled snapping
- Indicators — auto-hiding scroll bars