You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: Swipeable code breaking after RNGH v3.4 - #667
This PR fixes an issue where the miniplayer swipe gesture behaved inconsistently since v3.7.0. We narrowed down the cause to be RNGH v3.4, in which our temporary fix for v3.9.0 was to downgrade RNGH to v3.3.
I think this is an unintended side-effect as this mainly was to fix an issue w/ scrollables.
In our case, we have a Pressable wrapping the GestureDetector used by the swipeable, where potentially the onPress seems to cancel the gesture.
Adding the disabled prop to the Pressable allows the swipe gesture to work on every attempt.
Creating a patch undoing the changes from that PR verified that this was indeed the cause of the issue.
Note
An alternative to maintaining this patch whenever RNGH releases a new version is to maybe rewrite Swipeable to use React Native's Animated API (again).
Checklist
New files have the SPDX license identifier at the top of the file.
Documentation is up to date to reflect these changes.
Ensure dependency licenses are up-to-date by running pnpm sync:licenses.
This diff will work correctly for pnpm android:prod.
Add tests if necessary.
Summary by CodeRabbit
Bug Fixes
Improved touch handling when native views take over a gesture, reducing unintended cancellations of other gestures.
Updates
Updated the gesture-handling library to a newer version.
No actionable comments were generated in the recent review.
Walkthrough
The mobile app upgrades react-native-gesture-handler from 3.3.0 to 3.5.0 and applies a patch that changes how native-touch-grab events cancel handlers.
Changes: Gesture Handler Upgrade
Layer / File(s)
Summary
Dependency version and patch setup mobile/package.json, mobile/pnpm-workspace.yaml, mobile/src/resources/licenses.json
The dependency and recorded license version change to 3.5.0. The workspace maps the package to its patch file.
The root helper passes the mid-gesture flag to the orchestrator. The orchestrator cancels native-view handlers when their hook returns true for that flag. The detector view removes native DOWN-time tracking and detector-based cancellation.
Merge Risk: Low · up to 3634c · assessed changes only
Path filters excluded changed files. This rating applies only to the assessed changes.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix: Swipeable code breaking after RNGH v3.4" names the problem the PR addresses: swipe gestures in the miniplayer broke after react-native-gesture-handler v3.4. The changeset upgrades reac…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix: Swipeable code breaking after RNGH v3.4" names the problem the PR addresses: swipe gestures in the miniplayer broke after react-native-gesture-handler v3.4. The changeset upgrades react-native-gesture-handler to 3.5.0 and adds a patch that reverts the orchestrator and detector-view grab-cancellation behavior tied to upstream PR #4582. The title does not name the patch or the version bump, but it identifies the main purpose of the change. It is clear and specific enough for a teammate scanning history.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 46a0c368-bb8b-4326-9022-9e03ff4c46e5
Commits
Reviewing files that changed from the base of the PR and between 5ecd6c1 and 3634cf5.
Files ignored due to path filters: 1
mobile/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 4
mobile/package.json
mobile/patches/react-native-gesture-handler.patch
mobile/pnpm-workspace.yaml
mobile/src/resources/licenses.json
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This PR fixes an issue where the miniplayer swipe gesture behaved inconsistently since
v3.7.0. We narrowed down the cause to be RNGH v3.4, in which our temporary fix forv3.9.0was to downgrade RNGH to v3.3.After doing a bit of investigation work, it seems the cause was: software-mansion/react-native-gesture-handler#4582
Pressablewrapping theGestureDetectorused by the swipeable, where potentially theonPressseems to cancel the gesture.disabledprop to thePressableallows the swipe gesture to work on every attempt.Creating a patch undoing the changes from that PR verified that this was indeed the cause of the issue.
Note
An alternative to maintaining this patch whenever RNGH releases a new version is to maybe rewrite
Swipeableto use React Native's Animated API (again).Checklist
pnpm sync:licenses.pnpm android:prod.Summary by CodeRabbit