Page MenuHomePhabricator

[native] Migrate gestures to react-native-gesture-handler v2 API in FullScreenViewModal
ClosedPublic

Authored by angelika on Feb 6 2025, 5:05 PM.
Tags
None
Referenced Files
F6240555: D14300.diff
Thu, Apr 24, 11:02 PM
Unknown Object (File)
Wed, Apr 16, 3:14 PM
Unknown Object (File)
Wed, Apr 16, 11:11 AM
Unknown Object (File)
Wed, Apr 16, 10:07 AM
Unknown Object (File)
Wed, Apr 16, 9:51 AM
Unknown Object (File)
Wed, Apr 16, 9:42 AM
Unknown Object (File)
Wed, Apr 16, 6:03 AM
Unknown Object (File)
Wed, Apr 16, 4:59 AM
Subscribers

Details

Summary

https://linear.app/comm/issue/ENG-8150/convert-fullscreenviewmodal-to-reanimated-2-syntax

Replace old gesture handlers API with new GestureDetector API. We can simultaneously handle pan and pinch gestures, but they're exclusive with taps.

At this point the component is broken and will be gradually fixed in the next diffs.

Depends on D14299

Test Plan

Tested gestures after migration.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

angelika held this revision as a draft.
angelika edited the test plan for this revision. (Show Details)
tomek added inline comments.
native/components/full-screen-view-modal.react.js
1229–1240

This doesn't seem to depend on any of the props or state - can we define it outside the component?

native/flow-typed/npm/react-native-gesture-handler_v2.x.x.js
823–829

Should this be readonly and exact?

This revision is now accepted and ready to land.Feb 13 2025, 10:36 AM
native/components/full-screen-view-modal.react.js
1236

We were previously using Gesture.Simultaneous for all of the gestures, so this is changing something. But I guess it makes sense... the taps can't be simultaneous with other gestures.

native/flow-typed/npm/react-native-gesture-handler_v2.x.x.js
823–829

If we're not confident that the list is exhaustive, then we can consider inexact (...) instead of exact ({| |}). In libdefs, it's best to be unambiguous about these two (ie. avoid ambiguous { } syntax) since different Flow environments can pick between these two defaults (we default to exact).

I'd also note that Array<Gesture> would probably be better represented by $ReadOnlyArray<Gesture>

angelika added inline comments.
native/components/full-screen-view-modal.react.js
1229–1240

This doesn't depend yet, it will depend in future diffs on callbacks like panStart, pinchEnd, etc.