Make onboarding continue from last visited onboarding page#47472
Make onboarding continue from last visited onboarding page#47472chiragsalian merged 4 commits intoExpensify:mainfrom
Conversation
|
@mollfpr In android and ios native, the Lines 42 to 43 in 57ef25c The To address this, should we create a new Onyx key, |
| const {adaptedState} = getAdaptedStateFromPath(ROUTES.ONBOARDING_ROOT.route, linkingConfig.config); | ||
| navigationRef.resetRoot(adaptedState); | ||
| Navigation.resetToHome(); | ||
| Navigation.navigate(Welcome.getInitialOnboardingPath()); |
There was a problem hiding this comment.
I am changing this line to Navigation.resetHome because it causes some bugs when I use the same code in welcome of Report.openReportFromDeepLink:
Back to personal details
back_to_personal_detaisl-d.mp4
Click next on purpose back to purpose:
click_next_back_to_purpose-d.mp4
src/libs/actions/Report.ts
Outdated
| Welcome.isOnboardingFlowCompleted({onNotCompleted: () => Navigation.navigate(ROUTES.ONBOARDING_ROOT.getRoute())}); | ||
| Welcome.isOnboardingFlowCompleted({ | ||
| onNotCompleted: () => { | ||
| Navigation.resetToHome(); |
There was a problem hiding this comment.
This will fix the issue where a random URL leads to a "not-found" screen and the onboarding modal will disappears after clicking "next" on the purpose page, as mentioned in the issue.
|
@mollfpr, there is also a bug in the main: when a user fills out the work page/business name, clicks "continue" to go to the personal details page, then refreshes the page and clicks the back button, the purpose page is displayed instead of the work page. So I think this is out of scope. back to purpose instead of work page:back_to_purpose.mp4 |
|
Sorry for the delay 🙏
Yes! I think we can implement the original proposal. |
|
@mollfpr I have added the onboarding last visited path on onyx. |
mollfpr
left a comment
There was a problem hiding this comment.
Sorry for the delay! Mostly the changes and the result look good, but I have an issue after signing up the onboarding modal is not showing until I refresh the page.
Screen.Recording.2024-08-22.at.21.10.52.mp4
| } | ||
|
|
||
| onboardingInitialPath = value.substring(1); | ||
| Onyx.disconnect(onboardingLastVisitedPathConnection); |
There was a problem hiding this comment.
Why do we need to disconnect here?
There was a problem hiding this comment.
Because we only need the initial value when the user opens the app or URL. I have tested it, the onboarding is triggered from bottomTabBar and openReportFromDeepLink, leading to navigation changes that affect the lastVisitedPath and will open incorrect page.
I tested mostly on legacy mode. |
This comment was marked as outdated.
This comment was marked as outdated.
|
Thanks for the investigation @tsa321! Sure, I'll give it a try! Just wondering if this will be the production build or not. |
dded728 to
7a13a23
Compare
Signed-off-by: Tsaqif <tsaiinkwa@yahoo.com>
Signed-off-by: Tsaqif <tsaiinkwa@yahoo.com>
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: Tsaqif <tsaiinkwa@yahoo.com>
| Navigation.dismissModal(); | ||
| // Navigate to HOME instead of dismissModal, because there is bug in small screen | ||
| // where the onboarding puropose page will be disaplayed briefly | ||
| Navigation.navigate(ROUTES.HOME); |
There was a problem hiding this comment.
I am changing dismissModal to navigate HOME because there is a bug:
Onboarding purpose disaplyed briefly:
home-instead-of-dismiss-d.mp4
| } | ||
|
|
||
| function startOnboardingFlow() { | ||
| const {adaptedState} = getAdaptedStateFromPath(getOnboardingInitialPath(), linkingConfig.config, false); |
There was a problem hiding this comment.
I really need to add an optional parameter to getAdaptedStateFromPath because it is causing this bug:
The path is being appended to the URL inserted by the user:
Incorrect URL path:
incorrect-path-d.mp4
| isOnboardingInProgress = false; | ||
| onCompleted?.(); | ||
| } else { | ||
| } else if (!isOnboardingInProgress) { |
There was a problem hiding this comment.
Prevents multiple onboarding flow running causing navigation issue.
| } | ||
|
|
||
| const getAdaptedStateFromPath: GetAdaptedStateFromPath = (path, options) => { | ||
| const getAdaptedStateFromPath: GetAdaptedStateFromPath = (path, options, shouldReplacePathInNestedState = true) => { |
There was a problem hiding this comment.
I am adding an optional parameter here, I really need it, more info here.
Reviewer Checklist
Screenshots/VideosAndroid: Native47472.Android.mp4Android: mWeb Chrome47472.mWeb-Chrome.mp4iOS: Native47472.iOS.moviOS: mWeb Safari47472.Safari.movMacOS: Chrome / Safari47472.Web.mp4MacOS: Desktop47472.Desktop.mp4 |
mollfpr
left a comment
There was a problem hiding this comment.
LGTM 👍
Also, the result on web still good under the strict mode true.
|
I had to revert this PR since it caused a number of workflow failures. Please create another PR and ensure you are up to date so that GH actions runs on the latest code 🙂 |
|
🚀 Deployed to staging by https://github.com/chiragsalian in version: 9.0.26-1 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.0.26-6 🚀
|
Details
Fixed Issues
$ #46104
PROPOSAL: #46104 (comment)
Tests
JoinManage my team's expenses..com, for example,/aaa(for desktop, enter the URL in the browser asnew-expensify:/aaaand press Enter)..comto/settings/profile(for desktop, enter the URL in the browser asnew-expensify:/settings/profileand press Enter).Continue.Offline tests
QA Steps
JoinManage my team's expenses..com, for example,/aaa(for desktop, enter the URL in the browser asnew-expensify:/aaaand press Enter)..comto/settings/profile(for desktop, enter the URL in the browser asnew-expensify:/settings/profileand press Enter).Continue.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
android-native-d.mp4
Android: mWeb Chrome
android-mweb_d.mp4
iOS: Native
ios-native_d.mp4
iOS: mWeb Safari
ios-msfari_d.mp4
MacOS: Chrome / Safari
macos-web-d.mp4
MacOS: Desktop
macos-desktop_d.mp4