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
Unknown Object (File)
Fri, Mar 14, 7:59 AM
Unknown Object (File)
Fri, Mar 14, 7:59 AM
Unknown Object (File)
Fri, Mar 14, 7:59 AM
Unknown Object (File)
Tue, Mar 11, 4:17 PM
Unknown Object (File)
Tue, Mar 11, 4:12 PM
Unknown Object (File)
Tue, Mar 11, 4:11 PM
Unknown Object (File)
Tue, Mar 11, 3:53 PM
Unknown Object (File)
Tue, Mar 11, 3:51 PM
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
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #47078)

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 ↗(On Diff #47078)

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 ↗(On Diff #47078)

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 ↗(On Diff #47078)

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 ↗(On Diff #47078)

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