-
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
[Search v1] Fix desynchronized bottom tab and central pane after goBack to the Search #43998
[Search v1] Fix desynchronized bottom tab and central pane after goBack to the Search #43998
Conversation
// Allow CentralPane to use UP with fallback route if the path is not found in root navigator. | ||
if (isCentralPaneFocused && fallbackRoute && distanceFromPathInRootNavigator === -1) { | ||
navigate(fallbackRoute, CONST.NAVIGATION.TYPE.UP); | ||
return; | ||
if (isCentralPaneFocused && fallbackRoute) { | ||
// Allow CentralPane to use UP with fallback route if the path is not found in root navigator. | ||
if (distanceFromPathInRootNavigator === -1) { | ||
navigate(fallbackRoute, CONST.NAVIGATION.TYPE.UP); | ||
return; | ||
} | ||
|
||
// Add possibility to go back more than one screen in root navigator if that screen is on the stack. | ||
if (distanceFromPathInRootNavigator > 0) { | ||
navigationRef.current.dispatch(StackActions.pop(distanceFromPathInRootNavigator)); | ||
return; | ||
} |
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.
This change is cosmetic only. It won't change behaviour. I just realised that the ifs are similar.
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
@getusha all yours |
Hey @getusha how it's going with review? |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-07-09.at.5.22.09.in.the.afternoon.movAndroid: mWeb ChromeScreen.Recording.2024-07-09.at.5.07.01.in.the.afternoon.moviOS: NativeScreen.Recording.2024-07-09.at.5.19.00.in.the.afternoon.moviOS: mWeb SafariScreen.Recording.2024-07-09.at.5.04.11.in.the.afternoon.movMacOS: Chrome / SafariScreen.Recording.2024-07-09.at.4.56.16.in.the.afternoon.movMacOS: DesktopScreen.Recording.2024-07-09.at.5.38.40.in.the.afternoon.mov |
@adamgrzybowski i am able to reproduce the issue after applying your solution Screen.Recording.2024-06-21.at.3.19.44.in.the.afternoon.mov |
@getusha I am trying to reproduce the problem you showed and I can't. Do you see anything I may be doing wrong? Screen.Recording.2024-06-21.at.17.14.31.mov |
Hmm I'm also still able to reproduce the issue. What am I doing wrong? I confirmed that I'm on your branch and ran Screen.Recording.2024-06-21.at.12.50.43.PM.mov |
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.
Changing my approval since the issue is still reproducible
@luacmartins @getusha okay I managed to reproduce it with a different account. Weird stuff happening 😄 I will continue my investigation tomorrow. |
Thanks @adamgrzybowski ! |
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.
Waiting on @adamgrzybowski to address this comment
@adamgrzybowski any luck addressing #43998 (comment)? |
Moved forward with the investigation but don't have a solution yet. I hope to resolve that tomorrow. |
@adamgrzybowski any updates on this one? |
I have been busy with higher priority tasks and helping people as many new navigation issues were created. Things are slowly looking better so I'll be able to get back to it soon |
@luacmartins @getusha Hey guys, I merged the newest main and couldn't reproduce the above mentioned problem. I asked a few other people to do the same and still no reproduction. Could you please check if you can reproduce it once again? Thanks! |
Sorry, I was focused on Search v2.1 today and didn't get to this review. I'll do it tomorrow. In the meantime, @getusha could you please review this as your top priority? |
Following the QA steps, when pressing the back button:
Is this something we should fix? @luacmartins @adamgrzybowski Screen.Recording.2024-07-04.at.12.37.52.in.the.afternoon.mov |
@getusha good catch! I will take a look into this one |
@getusha @luacmartins it seems like the issue is caused by the strict mode. If it's enabled the navigation root useEffect is triggererd twice
which sets setShouldPopAllStateOnUP to true (it's not the first render, so it gets set to true), which in effect is causing the goBack function to include a case meant for the screen size change. We'll discuss it with @adamgrzybowski, but it looks like applying this flag based on the screen size directly it should work as expected, excluding the bug |
@BrtqKr thanks for the explanation. Let me know when the PR is ready for review again. |
@luacmartins it's ready |
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 & tests well!
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.0.6-0 🚀
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.0.6-0 🚀
|
This PR is failing because of issue #43407 The issue is reproducible in: all Platforms 1720622974638.screen-20240710-174850.mp41720621362292.Screen_Recording_2024-07-10_at_17.18.38.mp41720621938171.Screen_Recording_2024-07-10_at_17.28.43.mp41720622708191.screen-20240710-174403.mp41720630236386.RPReplay_Final1720630143.mp4 |
🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 9.0.6-1 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 9.0.6-1 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.6-8 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.7-8 🚀
|
Details
Sometimes we will navigate to central pane with different matching bottom tab. In this case matching bottom tab will be pushed on the bottom tab stack.
We need to modify
goBack
function to take this into account. We will check if the central pane under the one that we want to pop matches current bottom tab. If not, we will look for the proper bottom tab screen and pop to it's index.Fixed Issues
$ #43407
PROPOSAL:
Tests
Offline tests
QA Steps
This is test for the reported issue
This one was found later. The root cause is exactly the same.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.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 and/or tagged@Expensify/design
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
Android: mWeb Chrome
iOS: Native
ios.mov
iOS: mWeb Safari
iosWeb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov