Skip to content

fix(navigation): wire RootView destination + BoardLoaderView async wrapper - #48

Merged
wei18 merged 1 commit into
mainfrom
fix/route-destination-wireup
May 20, 2026
Merged

wei18 merged 1 commit into
mainfrom
fix/route-destination-wireup

Conversation

@wei18

@wei18 wei18 commented May 20, 2026

Copy link
Copy Markdown
Owner

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

…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
@wei18
wei18 merged commit 05efe59 into main May 20, 2026
@wei18
wei18 deleted the fix/route-destination-wireup branch May 20, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RootView destination closure returns EmptyView — app navigation beyond Home is broken

1 participant