Skip to content

feat(onboarding): unify login into a single OnboardingFlow with linear FlowHost API#778

Open
bmc08gt wants to merge 4 commits into
code/cashfrom
feat/onboarding-flow-internalize-verification
Open

feat(onboarding): unify login into a single OnboardingFlow with linear FlowHost API#778
bmc08gt wants to merge 4 commits into
code/cashfrom
feat/onboarding-flow-internalize-verification

Conversation

@bmc08gt
Copy link
Copy Markdown
Collaborator

@bmc08gt bmc08gt commented May 28, 2026

Replace the fragmented login routing (LoginRouter, standalone screens, and scattered verification logic in MainRoot) with a single OnboardingFlowScreen backed by two FlowHost phases: Account and Permissions.

FlowHost API changes:

  • Add linear flow overload with steps, resumeAt, and completedResult parameters for ordered step-by-step flows
  • Add FlowNavigator.proceed() to advance through the step list, exit with completedResult at the end, or delegate to onProceed for custom behavior
  • Rename the existing overload as the non-linear variant for flows that manage their own navigation via navigateTo/exitWithResult
  • Extract shared logic into FlowHostImpl; support re-seeding when initialStack changes before user navigation (async flag settling)

Onboarding routing:

  • All AuthState.Registered cases now route to AppRoute.OnboardingFlow with a ResumePoint (Login, AccessKey, AccessKeyThenPurchase, or PostAccessKey) — MainRoot no longer routes directly to Verification
  • PostAccessKeyRedirect checks UserProfile.verifiedPhoneNumber to skip verification when phone is already linked
  • Seed restore (LoggedIn) skips verification and goes straight to permissions — existing users encounter phone verification in-app via the send flow
  • Permissions phase uses the linear FlowHost with resumeAt to skip already-granted permissions

Login module restructuring:

  • Delete LoginRouter, AccessKeyScreen, SeedInputScreen (standalone wrappers) — all step content is now composed inline by OnboardingFlowScreen via the entryProvider
  • Move ViewModels to internal package, screen content to internal/screens
  • Add OnboardingStep sealed interface and OnboardingResult for flow step/result modeling

@bmc08gt bmc08gt self-assigned this May 28, 2026
@github-actions github-actions Bot added type: feature New functionality area: auth Login, session, access keys, identity area: ui Compose UI, theme, components, resources area: onramp Deposit, purchase, Coinbase, fiat on-ramp area: deeplinks Deep link handling, URL routing, and link parsing and removed type: feature New functionality labels May 28, 2026
bmc08gt added 2 commits May 27, 2026 21:10
…r FlowHost API

Replace the fragmented login routing (LoginRouter, standalone screens,
and scattered verification logic in MainRoot) with a single
OnboardingFlowScreen backed by two FlowHost phases: Account and
Permissions.

FlowHost API changes:
- Add linear flow overload with `steps`, `resumeAt`, and `completedResult`
  parameters for ordered step-by-step flows
- Add `FlowNavigator.proceed()` to advance through the step list, exit
  with completedResult at the end, or delegate to `onProceed` for custom
  behavior
- Rename the existing overload as the non-linear variant for flows that
  manage their own navigation via navigateTo/exitWithResult
- Extract shared logic into FlowHostImpl; support re-seeding when
  initialStack changes before user navigation (async flag settling)

Onboarding routing:
- All AuthState.Registered cases now route to AppRoute.OnboardingFlow
  with a ResumePoint (Login, AccessKey, AccessKeyThenPurchase, or
  PostAccessKey) — MainRoot no longer routes directly to Verification
- PostAccessKeyRedirect checks UserProfile.verifiedPhoneNumber to skip
  verification when phone is already linked
- Seed restore (LoggedIn) skips verification and goes straight to
  permissions — existing users encounter phone verification in-app via
  the send flow
- Permissions phase uses the linear FlowHost with resumeAt to skip
  already-granted permissions

Login module restructuring:
- Delete LoginRouter, AccessKeyScreen, SeedInputScreen (standalone
  wrappers) — all step content is now composed inline by
  OnboardingFlowScreen via the entryProvider
- Move ViewModels to internal package, screen content to
  internal/screens
- Add OnboardingStep sealed interface and OnboardingResult for flow
  step/result modeling

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
@bmc08gt bmc08gt force-pushed the feat/onboarding-flow-internalize-verification branch from a595b08 to a01d8b8 Compare May 28, 2026 01:19
@github-actions github-actions Bot added the type: feature New functionality label May 28, 2026
bmc08gt added 2 commits May 28, 2026 08:14
…mber

Ensures UserProfile (including verifiedPhoneNumber) is available before
onboarding routing decisions that depend on phone-linked state.

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
…act routing logic

- Add skipContacts flag to OnboardingFlow route, passed from PostAccessKey path
- Purchase now exits with ProceedToVerification so IAP paths check phone-linked
  state and route through verification when needed
- Extract resolvePostAccountRoute pure function from composable routing logic
- Add OnboardingRoutingTest covering all flow chart paths
- Replace prose KDoc with ASCII flow charts documenting each onboarding path

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: auth Login, session, access keys, identity area: deeplinks Deep link handling, URL routing, and link parsing area: onramp Deposit, purchase, Coinbase, fiat on-ramp area: ui Compose UI, theme, components, resources type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant