-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: gesture direction for left modal stack #37601
fix: gesture direction for left modal stack #37601
Conversation
@sobitneupane Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@youssef-lr may I kindly ask you to review this PR? 👀 |
On it. |
@kirillzyusko in Android emulator, how do I simulate a swipe? clicking and holding doesn't seem to work for me |
@youssef-lr By default gesture-based navigation is iOS specific feature. If we want to support it in Android then we need to open a new discussion (because from one side - it gives a cool feature, but from the other side - it will not be supported if we migrate to native stack navigators) 👀 |
Oh, so in the android native recording you're just pressing back and not actually swiping? |
@@ -41,8 +39,9 @@ const getRootNavigatorScreenOptions: GetRootNavigatorScreenOptions = (isSmallScr | |||
}, | |||
leftModalNavigator: { | |||
...commonScreenOptions, | |||
cardStyleInterpolator: (props) => modalCardStyleInterpolator(isSmallScreenWidth, false, props, SLIDE_LEFT_OUTPUT_RANGE_MULTIPLIER), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious what this does SLIDE_LEFT_OUTPUT_RANGE_MULTIPLIER
, @kirillzyusko? And why did we remove it after changing the direction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@youssef-lr basically it was reverting the animation. And when we multiply extrapolated values (let's say we move screen from 0 to 336) by -1
- we change a direction of animation.
But in react-navigation this -1
multiplier is already handled if you specify gestureDirection
.
So if I specify gestureDirection
as horizontal-inverted
- it'll automatically drive the animation from left to right, but since we multiplied it before by -1
we kind of getting double inversion which results in right-to-left
(default) animation.
That's why I removed this - I delegated a control fully to react-navigation
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh makes sense, thanks for clarifying!
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: Nativeios.native.1.moviOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
@youssef-lr Ah, you about my recording? Yes, I kind of dismiss it with swipe gesture, but it's a newly introduced feature (available in Android 13 and Android 14 by default) and backward compatible with previous "hardware back button" functionality. So this swipe is handled by OS (not by app) and when such swipe occurs it's simply simulate a press on hardware/emulated software back button (typically was prior to Android 10 in the bottom of the screen). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for working on this! Left one comment mainly because I'm curious :D
@kirillzyusko probably out of scope, any reason you can think of why the animation of the search page and workspace switched are not 60fps compared to the profile page? See my recording in the checklist |
This is a very good question 😅 I don't have the answer at the moment (need to perform a profiling to understand it better), but I'm currently working on replacing |
Awesome, can't wait! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/youssef-lr in version: 1.4.48-0 🚀
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.4.48-0 🚀
|
Details
Added right-to-left gesture for Search/Workspace screens.
Fixed Issues
$ #37354
PROPOSAL: N/A
Tests
Offline tests
Not needed
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
telegram-cloud-document-2-5406699501597507749.mp4
Android: mWeb Chrome
iOS: Native
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-03-01.at.13.43.19.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop