6.1 KiB
6.1 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, decisions, metrics
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | decisions | metrics | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 02.1 | 04 | navigation |
|
|
|
|
|
|
|
|
Phase 02.1 Plan 04: Navigation Foundation Summary
Type-safe navigation skeleton with 4 nested tab graphs (Planner/Recipes/Pantry/Shopping), a BottomBarDestination enum exposing routes/labels/icons/search visibility, and a navigateToTab extension that enforces the multi-back-stack four-flag contract — verified by 3 unit tests.
What Was Built
- Routes.kt — 8
@Serializable data objecttypes: PlannerGraph/PlannerHome, RecipesGraph/RecipesHome, PantryGraph/PantryHome, ShoppingGraph/ShoppingHome. - BottomBarDestination.kt — enum in D-03 order (Planner first as
Default); only Recipes + Pantry havehasSearch=true/non-nullsearchPlaceholder. Bound toIcons.Outlined.{CalendarMonth,Inventory2,ShoppingCart}andIcons.AutoMirrored.Outlined.MenuBook. - RootNavHost.kt — single root
NavHost(startDestination = PlannerGraph)containing fournavigation<*Graph>(startDestination = *Home)blocks. Eachcomposable<*Home>retrieves the parent graph'sNavBackStackEntryvianavController.getBackStackEntry(*Graph)(Pattern 2 wired and ready for plan 02.1-08 to consume withkoinViewModel(viewModelStoreOwner = parent)). Renders privateTabHomePlaceholderusingBasicText— no Material dependency. - NavExtensions.kt —
fun NavHostController.navigateToTab(graphRoute: Any)appliespopUpTo(graph.findStartDestination().id){saveState=true},launchSingleTop = true,restoreState = true. - strings.xml — 9 new keys appended (4 tab labels + 2 search placeholders + 3 search a11y), Polish copy verbatim from UI-SPEC. All 7 existing
auth_*keys preserved. - NavigationTest.kt —
@Ignoreremoved; 3 tests assert the four-flag contract via the publicnavOptions { ... }DSL andshouldLaunchSingleTop()/shouldRestoreState()/shouldPopUpToSaveState()accessors.
Verification
./gradlew :composeApp:compileKotlinIosSimulatorArm64 -q→ exit 0./gradlew :composeApp:iosSimulatorArm64Test --tests "dev.ulfrx.recipe.navigation.NavigationTest"→ BUILD SUCCESSFUL (3 tests pass)./gradlew :composeApp:linkDebugFrameworkIosSimulatorArm64 -q→ exit 0- All acceptance grep counts match per task.
Deviations from Plan
Auto-fixed Issues
1. [Rule 1 - Bug] Deprecated Icons.Outlined.MenuBook failed -Werror compile
- Found during: Task 1 verify
- Issue:
'val Icons.Outlined.MenuBook: ImageVector' is deprecated. Use the AutoMirrored version— Werror promoted the warning to a build failure. - Fix: Switched to
Icons.AutoMirrored.Outlined.MenuBookand updated import. - Files modified:
composeApp/src/commonMain/kotlin/dev/ulfrx/recipe/navigation/BottomBarDestination.kt - Commit: 9b9029a (folded into Task 1 commit)
No other deviations. Plan executed as written.
Open Questions Resolved
- navOptions DSL availability under nav-compose 2.9.2 K/N: Public
navOptions { ... }builder andshouldLaunchSingleTop()/shouldRestoreState()/shouldPopUpToSaveState()accessors are all publicly exposed. The fake-builder fallback path described in the plan was not needed. - TabHomePlaceholder text strategy: Settled on
androidx.compose.foundation.text.BasicText— keeps the placeholder Material-free per UI-SPEC line 31. Plan 02.1-08 will replace with realTab*Screencomposables.
Commits
- 9b9029a
feat(02.1-04): add type-safe routes and bottom bar destinations - 5634171
feat(02.1-04): add RootNavHost and navigateToTab extension - 41d9bf4
test(02.1-04): assert navigateToTab applies four-flag back-stack contract
Self-Check: PASSED
- FOUND: composeApp/src/commonMain/kotlin/dev/ulfrx/recipe/navigation/Routes.kt
- FOUND: composeApp/src/commonMain/kotlin/dev/ulfrx/recipe/navigation/BottomBarDestination.kt
- FOUND: composeApp/src/commonMain/kotlin/dev/ulfrx/recipe/navigation/RootNavHost.kt
- FOUND: composeApp/src/commonMain/kotlin/dev/ulfrx/recipe/navigation/NavExtensions.kt
- FOUND commit 9b9029a, 5634171, 41d9bf4