Repository navigation
fix(navigation): wire RootView destination + BoardLoaderView async wrapper - #48
Merged
Merged
Conversation
…apper (#45) Closes #45. Critical v1 navigation gap — RootView.destination returned EmptyView, so tapping any HomeView card past Home led to a blank screen on device. Every View renders standalone in snapshots; the NavigationStack glue was never wired. Option A chosen: RootView.init grows to take the 4 protocol deps (puzzleProvider / persistence / gameCenter / telemetry) alongside its existing RootViewModel. Destination becomes a real switch over the 7 AppRoute cases, each constructing the matching View + VM inline. BoardView async-puzzle challenge resolved with shape (iii): - NEW BoardLoaderView.swift (110 lines): @mainactor View with LoadState .loading / .loaded(GameViewModel) / .failed(String) - .task(id: puzzleId) calls persistence.loadOrCreate + GameSession.restore + GameViewModel live ctor on success → .loaded - .failed surfaces Retry button that re-runs load() - GameViewModel.swift and BoardView.swift untouched (original fence preserved; lifted only for the new wrapper file) AppRoute.completion limitation: case doesn't carry difficulty/mode, so the Completion → Leaderboard route uses LeaderboardIDs.id(for: .dailyEasy) placeholder. Backlog entry filed in design.md §不在 v1 範圍 §導航 for expanding AppRoute.completion case in a future PR. design.md §How.1: DI Composition Root section amended to drop *ViewModelFactory references and document the actual inline-construction pattern. Cross-links issues #15 / #34 / #45 + PRs #33 / #44 as the trail. Verified: - swift build: 0 warnings - swift test: 364/364 in 69 suites - xcodebuild iOS scheme: ** BUILD SUCCEEDED ** (Leader-run; subagent was sandbox-blocked) - TODO sweep on Root/ + Board/BoardLoaderView.swift + AppComposition/ → 0 hits impl-notes: meetings/2026-05-20_route-destination-wireup.impl-notes.md
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.
Closes #45. Critical v1 fix — RootView.destination returned EmptyView, blocking all navigation past Home on device. Option A approved: RootView.init grows deps + real switch destination; BoardLoaderView (NEW) handles async puzzle fetch in shape (iii) wrapper. design.md §How.1 amended (drops factory pattern wording). AppRoute.completion expansion backlog filed.
364/364 tests, 0 warnings, xcodebuild BUILD SUCCEEDED.
🤖 Claude Code