Gesture system

SootSim implements the React Native responder system and integrates with react-native-gesture-handler.

Responder system

The touch pipeline (engine/touch/):

  1. Hit testing — find the deepest node at touch coordinates
  2. Responder negotiation — walk up the tree asking onStartShouldSetResponder
  3. Event dispatch — send touchStart/touchMove/touchEnd to the responder
  4. Responder transfer — handle onMoveShouldSetResponder for 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: hidden clipping
  • 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