refactor(navigation): hierarchical, route-dispatching CodeNavigator (Phase 1)#1073
Open
bmc08gt wants to merge 5 commits into
Open
refactor(navigation): hierarchical, route-dispatching CodeNavigator (Phase 1)#1073bmc08gt wants to merge 5 commits into
bmc08gt wants to merge 5 commits into
Conversation
…ator
- Convert CodeNavigator from data class to class (copy()/componentN() unused)
- Add optional parent, isFlowNavigator, flowScope fields (all defaulted)
- Add FlowScope interface with exitWithResult + dismiss contract
- Thread new params through rememberCodeNavigator (existing callers unaffected)
- Stand up JVM unit-test harness: TestNav fixtures + CodeNavigatorHarnessTest
- Add kotlin("test") + bundles.unit.testing to ui:navigation test deps
…t chain FlowSteps land on the nearest flow navigator; all other routes bubble up to the app-root stack via the parent chain, so feature screens need only one navigator handle regardless of context.
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.
Phase 1 of simplifying the navigator situation inside flows. Today a flow-step author faces up to six navigator-ish handles, and
LocalCodeNavigator.currentsilently resolves to a different instance depending on whether the screen is mounted top-level, in a flow, or re-shadowed byflowAnnotatedEntry. This makesCodeNavigatorhierarchical and route-dispatching so a screen can eventually use one handle everywhere.This lands the engine only, entirely behind the existing API —
FlowNavigatorand all feature call sites are untouched, so there is no runtime behavior change for existing flows.CodeNavigatorgainsparent+isFlowNavigator+flowScope(data class→class)navigate()dispatches by route type:FlowSteps land on the nearest flow stack; everything else bubbles up the parent chain to the app-root stack (restoreRoutingbypasses dispatch; aFlowStepreaching the root is dropped with aTraceType.Error)navigateBackWithResult()anddismiss(), delegating flow/sheet mechanics to a small newFlowScopeinterface implemented byFlowHostFlowHostwired to make it live (parent/isFlowNavigator/flowScope);sheetNavigatorread viarememberUpdatedState; sheet dismiss guarded onisSheetRootui/navigation(harness + dispatch + intent tests)