refactor: reusable stepped-flow chrome; migrate currency-creator#1108
Merged
Conversation
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>
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.
Summary
Extracts the stepped-wizard chrome that was baked into
currency-creatorinto a reusable, opt-in flow type inapps/flipcash/core, and migratescurrency-creatoronto 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.flowframework already had 8 consumers but provided no chrome;currency-creatorwas 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>— aFlowRouteWithResultthat declaresprogressSteps. Declaring your route as this is how a flow opts into the progress chrome.SteppedFlowScaffold— wrapsFlowHost, renders the progress top bar, and owns the progress math (readsroute.progressStepsagainst 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-suppliedList<StepperItem>instead of hardcoded content.flowProgressFor(step, progressSteps)— the step→fraction helper, unit-tested.currency-creator migration
AppRoute.Token.CurrencyCreatoris now aSteppedFlowRouteand declares its 5 progress steps.CurrencyCreatorFlowScreenusesSteppedFlowScaffold; per-step title/end content extracted intocurrencyCreatorTitleContent/currencyCreatorEndContenthelpers.InfoScreenrenders the sharedFlowStepper(with acurrencyCreatorStepperItemsbuilder).progress/connectTopBarfromCurrencyCreatorViewModel; deleted the bespokeCurrencyCreatorTopBar+CurrencyCreatorTopBarController.Testing
FlowProgressTest(5 cases) covers the progress computation lifted out of the ViewModel.:apps:flipcash:coreand:apps:flipcash:features:currency-creatorunit tests pass.:apps:flipcash:app:assembleDebugbuilds 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.