Commit cfe2964
authored
feat(onboarding): unify login into a single OnboardingFlow with linear FlowHost API (#778)
* feat(onboarding): unify login into a single OnboardingFlow with linear 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>
* feat(onboarding): skip contact permission step when ContactPickerMode is enabled
* feat(auth): fetch user profile on login to populate verified phone number
Ensures UserProfile (including verifiedPhoneNumber) is available before
onboarding routing decisions that depend on phone-linked state.
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
* feat(onboarding): skip contact permission for existing users and extract 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>
* feat(contacts): suspend contact sync, Android 17 multi-pick picker, and loading button states
Make ContactCoordinator.sync() and addPickedContacts() suspend returning
Result<Unit> so callers can await completion. Add ContactAccessHandle using
ContactsPickerSessionContract on API 37+ with phone-only filtering, falling
back to full permission on older APIs. Thread isLoading/isSuccess through
ContactPermissionBottomBar for visual feedback during sync.
* fix(onboarding): preserve seenAccessKey flag across restart so onboarding resumes at access key
onAccountPurchased was removing seenAccessKeyKey, and login always set
LoggedInWithUser when flags.isRegistered was true, skipping the access key
screen on restart. Now onAccountPurchased preserves the flag value,
hasSeenAccessKey falls back to selectedAccountIdKey, login gates
LoggedInWithUser on seenAccessKey, and RealSessionController respects
incomplete onboarding state.
* feat(onboarding): move phone verification before access key and remove for existing users
When PhoneNumberSend is enabled, new account creation now launches
verification with target=OnboardingFlow(AccessKey) so the user verifies
their phone before seeing the access key. Existing users (PostAccessKey)
skip verification entirely and go straight to permissions. Verification
gating logic moved from composable into LoginViewModel.
* chore: add onboarding, session, and phone area labels for PR labeler
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
---------
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>1 parent 2be9942 commit cfe2964
55 files changed
Lines changed: 1440 additions & 523 deletions
File tree
- .github
- apps/flipcash
- app
- src/main/kotlin/com/flipcash/app/internal/ui
- core/src/main
- kotlin/com/flipcash/app/core
- onboarding
- res/values
- features
- contact-verification/src/main/kotlin/com/flipcash/app/contact/verification
- email
- internal/phone
- phone
- login
- src
- main/kotlin/com/flipcash/app/login
- accesskey
- internal
- screens
- router
- seed
- test/kotlin/com/flipcash/app/login
- router
- myaccount/src/main/kotlin/com/flipcash/app/myaccount
- internal
- purchase/src/main/kotlin/com/flipcash/app/purchase/internal
- libs/permissions/public/src/main/kotlin/com/getcode/util/permissions
- services/flipcash/src/main/kotlin/com/flipcash/services/controllers
- ui
- components/src/main/kotlin/com/getcode/ui/components
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
33 | 38 | | |
34 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
35 | 49 | | |
36 | 50 | | |
37 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | | - | |
270 | | - | |
| 269 | + | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
296 | | - | |
| 295 | + | |
| 296 | + | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 22 | + | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
| |||
Lines changed: 5 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 37 | + | |
41 | 38 | | |
42 | 39 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 40 | | |
48 | 41 | | |
49 | 42 | | |
| |||
75 | 68 | | |
76 | 69 | | |
77 | 70 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
88 | 75 | | |
89 | 76 | | |
90 | 77 | | |
| |||
Lines changed: 8 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
200 | 187 | | |
| 188 | + | |
201 | 189 | | |
202 | 190 | | |
203 | 191 | | |
| |||
223 | 211 | | |
224 | 212 | | |
225 | 213 | | |
226 | | - | |
| 214 | + | |
227 | 215 | | |
228 | 216 | | |
229 | | - | |
| 217 | + | |
230 | 218 | | |
231 | 219 | | |
232 | 220 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
65 | 92 | | |
66 | 93 | | |
67 | 94 | | |
| |||
Lines changed: 63 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
284 | 288 | | |
285 | 289 | | |
286 | 290 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
0 commit comments