Repository navigation
fix(onboarding): prevent browser back from reopening onboarding steps - #94709
luacmartins merged 11 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a920dd2316
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
969d51d to
2fbb494
Compare
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75ae3b9fef
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Since we are using these three new functions only for onboarding, it might be better to group them into a single file for mobile and a single file with no-ops for web. I feel that creating a new folder for every small function might overcomplicate the structure. Maybe we could combine them into one file, similar to Navigation.ts, but for onboarding. What do you think?
| // Skip when forceReplace is set so the caller's explicit REPLACE intent is preserved. | ||
| const currentTopRoute = currentState.routes[currentState.index]; | ||
| if (currentTopRoute?.name !== NAVIGATORS.TAB_NAVIGATOR && typedPayload.name === NAVIGATORS.TAB_NAVIGATOR) { | ||
| if (!forceReplace && currentTopRoute?.name !== NAVIGATORS.TAB_NAVIGATOR && typedPayload.name === NAVIGATORS.TAB_NAVIGATOR) { |
There was a problem hiding this comment.
I have a slight concern regarding the use of forceReplace in linkTo. I feel it might be a bit risky to use 'navigate' action for all navigations with forceReplace, as it could cause a few unexpected bugs. Because we use forceReplace pretty regularly, if we try to navigate to a screen that’s already in the stack, 'navigate' action will pull us back to the old screen instead of pushing a new one. This might also be problematic for our dynamic routes.
Do you think we could tweak this approach? Or maybe we could just add an extra flag so this behavior only applies to the onboarding screens?
There was a problem hiding this comment.
I’m also wondering whether making a change this high up in the navigation architecture is a good idea specifically for fixing onboarding. Were there more bugs similar to the one we’re trying to fix with this change?
918a6ab to
a419896
Compare
|
@ChavdaSachin 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-07-20.at.7.18.00.PM.moviOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-07-20.at.7.04.28.PM.mov |
|
@ChavdaSachin friendly bump :) |
|
Thanks for the ping, I had some issues with my private domain. |
|
@WojtekBoman, the code looks good. Please merge the main. And ping me if you make changes to the core logic and this needs another review after the merge. |
…early stack reset
…boardingStackToRootTest
47be0c1 to
7e1f637
Compare
|
@ChavdaSachin Conflicts solved! |
ChavdaSachin
left a comment
There was a problem hiding this comment.
Ready for the merge ✅
|
🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.4.42-0 🚀
|
|
🤖 I reviewed the changes in this PR against the help site content under No help site changes are required. This PR is a purely technical navigation fix — it collapses the nested onboarding navigation stack before
There is no new or changed user-facing feature, setting, label, tab, or workflow — the onboarding flow itself and its steps are unchanged. Help articles describe how to use features and complete flows, and none of that documented behavior is affected by this fix, so there's nothing to add or update. No draft PR was created since no documentation updates are needed. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.4.42-1 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Fixes onboarding browser-back behavior on web by collapsing the nested onboarding stack before
completeOnboarding, usingforceReplaceexit navigation options, and wiring post-completion navigation from the Purpose step. Platform-specific behavior lives in.ts/.native.tshelpers (collapseOnboardingNestedStack,getOnboardingExitNavigationOptions,dismissOnboardingModalBeforeExit).Screen.Recording.2026-07-06.at.16.00.38.mov
Fixed Issues
$ #86816
PROPOSAL:
Tests
Sign up for a new account on web (desktop browser)
Complete onboarding through Purpose → Personal Details → Interested Features (or Workspaces), advancing through multiple steps
Finish onboarding and land on the expected destination (home, admins room, or Concierge)
Press the browser Back button
Verify that onboarding steps do not reopen and navigation stays on the post-onboarding destination
On web, start onboarding and advance at least two steps deep in the onboarding modal
Select "I'm just looking around" on the Purpose step and complete onboarding from there
Verify that you are navigated to the correct post-onboarding destination without getting stuck on the Purpose screen
On iOS or Android native, complete onboarding through any flow that dismisses the onboarding modal
Verify that the modal dismisses cleanly and you land on the expected destination without navigation errors in the console
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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.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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari