fix(onboarding): land on the wallet tab, not the camera - #1280
Merged
Conversation
The end of onboarding hardcoded AppRoute.Main.Scanner on both exit paths of PermissionsPhaseFlowHost, so a freshly onboarded v2 user was dropped on the camera and only saw the wallet on the next cold launch. Launch already picked the right home (Sheets.Wallet under FeatureFlag.NewUi, Main.Scanner under v1) — the two just drifted apart. Extract that choice into a shared homeRoute(isNewUi) helper and use it in both places. The v2 wallet is a flat tab home, so navigating to it with ClearAll is exactly what a nav bar tab tap does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After finishing onboarding, the app dropped the user on the camera/scanner instead of the wallet. The wallet only appeared on the next cold launch.
Launch already picked the right home —
buildNavGraphForLaunchresolvedAppRoute.Sheets.WalletunderFeatureFlag.NewUiandAppRoute.Main.Scannerunder v1 — but the end of onboarding hardcodedAppRoute.Main.Scanneron both exit paths ofPermissionsPhaseFlowHost:FlowExitReason.Completed— permissions flow finishedFlowExitReason.BackedOutOfRoot— all permissions already granted, nothing to showSo the two release points had drifted apart.
Change
homeRoute(isNewUi)helper in:apps:flipcash:core(core/navigation/HomeRoute.kt) — a single definition of "where the app releases to once there's a session".MainRoot.buildNavGraphForLaunchuses it (behavior unchanged).OnboardingFlowScreen'sPermissionsPhaseFlowHostobservesFeatureFlag.NewUiand releases tohomeon both exit paths. The flow diagram in its KDoc now saysHome³with a footnote instead ofScanner.The v2 wallet is a flat tab home rather than a sheet, so navigating to it with
PopUpTo.ClearAllis exactly what a nav bar tab tap does (replaceAllinAppNavigationBar). v1 is untouched — it still lands on the scanner.Tests
HomeRouteTestcovers both flag states, plus an assertion that the v2 home maps to a nav bar tab — it's applied withClearAll, so a non-tab route would leave the hoisted bar with no selection.Not included
Two other spots still hardcode
Main.Scannerafter account setup —NotificationPermissionScreen/NotificationPermissionRationaleScreenin:shared:permissionsandPurchaseAccountScreenin:features:purchase. Both are dead code: no route registers them, and onboarding renders its own in-file step composables. Left alone rather than widening this change.