fix: replace HOME instead of pushing when navigating to Settings RHP#88117
fix: replace HOME instead of pushing when navigating to Settings RHP#88117yuvrajangadsingh wants to merge 1 commit intoExpensify:mainfrom
Conversation
|
@cristipaval 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] |
|
@yuvrajangadsingh CI is failing |
1d677d6 to
9ed2431
Compare
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
when navigating from HOME to an RHP that maps to a different fullscreen (e.g. Settings Wallet), replace HOME with the matching fullscreen instead of pushing on top. pushing creates [HOME, SETTINGS_SPLIT_NAVIGATOR, RHP] which causes Android to trim HOME from the render tree, producing wrong back animation (Expensify#85122). the original fix in Expensify#87128 added a blanket guard in shouldChangeToMatchingFullScreen that returned false for HOME, which broke Add address navigation (Expensify#87655). replacing HOME matches the reload state shape [SETTINGS, RHP] and fixes both issues: correct back animation AND working navigation. removes the blanket guard in shouldChangeToMatchingFullScreen so the replace path can run.
18552e9 to
0ddfa64
Compare
|
@roryabraham CI is green now. the earlier fails were a stale checklist template, missing signing config, and a prettier nit. also rebased on latest main so the diff now cleanly removes the #87128 guard in shouldChangeToMatchingFullScreen and replaces it with a replace-instead-of-push when navigating from HOME. matches the reload stack shape [SETTINGS, RHP] so Android doesn't trim HOME and Add address navigation works. ready for review. |
|
awaiting C+ review from @ShridharGoel |
|
@roryabraham Just waiting on this |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-04-17.at.1.08.45.PM.mov |
Explanation of Change
Regression fix from #87128.
PR #87128 (merged Apr 8) added a guard in
shouldChangeToMatchingFullScreenthat returnedfalsewhenlastFullScreenRoute.name === SCREENS.HOME. This fixed the back animation issue (#85122) but broke navigation from Home to Settings RHP routes (#87655).The guard was too broad: it blocked ALL fullscreen changes when on HOME, including legitimate ones like "Add address" which needs to navigate to Settings/Wallet.
This PR replaces HOME with the matching fullscreen via
StackActions.replaceinstead of blocking the fullscreen change entirely. The stack shape now matches a page reload ([SETTINGS_SPLIT_NAVIGATOR, RHP]), which fixes both:One boolean:
shouldReplace = lastFullScreenRoute.name === SCREENS.HOME. Usesreplaceinstead ofpushonly for HOME. All other routes usepushas before.Fixed Issues
$ #87655
PROPOSAL: #88117
Tests
Offline tests
Same as tests. Navigation logic is client-side and not affected by network state.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A
Android: mWeb Chrome
N/A
iOS: Native
N/A
iOS: mWeb Safari
N/A
MacOS: Chrome / Safari
N/A