Skip to content

refactor: reusable stepped-flow chrome; migrate currency-creator#1108

Merged
bmc08gt merged 5 commits into
code/cashfrom
feat/stepped-flow-reuse
Jul 21, 2026
Merged

refactor: reusable stepped-flow chrome; migrate currency-creator#1108
bmc08gt merged 5 commits into
code/cashfrom
feat/stepped-flow-reuse

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Extracts the stepped-wizard chrome that was baked into currency-creator into a reusable, opt-in flow type in apps/flipcash/core, and migrates currency-creator onto it. No behavior change to the currency-creator flow — this is groundwork so upcoming stepped flows (e.g. tipping setup) can reuse the same chrome instead of hand-rolling a top bar.

The underlying com.getcode.navigation.flow framework already had 8 consumers but provided no chrome; currency-creator was the only one with a progress-bar wizard. That pattern is now shared.

What's new (in com.flipcash.app.core.ui.flow)

  • SteppedFlowRoute<R> — a FlowRouteWithResult that declares progressSteps. Declaring your route as this is how a flow opts into the progress chrome.
  • SteppedFlowScaffold — wraps FlowHost, renders the progress top bar, and owns the progress math (reads route.progressSteps against the current step) so it no longer lives in the ViewModel.
  • FlowStepBar + FlowStepBarController / LocalFlowStepBar — the generalized progress top bar and its state holder (progress / onBack / onEndAction).
  • FlowStepper + StepperItem — the vertical intro stepper, now driven by a caller-supplied List<StepperItem> instead of hardcoded content.
  • flowProgressFor(step, progressSteps) — the step→fraction helper, unit-tested.

currency-creator migration

  • AppRoute.Token.CurrencyCreator is now a SteppedFlowRoute and declares its 5 progress steps.
  • CurrencyCreatorFlowScreen uses SteppedFlowScaffold; per-step title/end content extracted into currencyCreatorTitleContent / currencyCreatorEndContent helpers.
  • InfoScreen renders the shared FlowStepper (with a currencyCreatorStepperItems builder).
  • Removed progress / connectTopBar from CurrencyCreatorViewModel; deleted the bespoke CurrencyCreatorTopBar + CurrencyCreatorTopBarController.

Testing

  • New FlowProgressTest (5 cases) covers the progress computation lifted out of the ViewModel.
  • :apps:flipcash:core and :apps:flipcash:features:currency-creator unit tests pass.
  • :apps:flipcash:app:assembleDebug builds successfully.

Behavior is preserved by construction: same animated progress bar, same back/close handling, same "Next" action on Bill Customization, same steps excluded from the bar.

bmc08gt added 5 commits July 21, 2026 11:19
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
…step bar)

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
…spoke chrome

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
@github-actions github-actions Bot added the type: refactor Code restructuring, no behavior change label Jul 21, 2026
@bmc08gt
bmc08gt merged commit 350b53c into code/cash Jul 21, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the feat/stepped-flow-reuse branch July 21, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant