Repository navigation
fix(homeview, sidebar): tap targets + Mac sidebar wiring + throwaway VM - #16
Merged
Merged
Conversation
…VM (#15) Closes #15. Fixes 4 functional bugs surfaced by macOS smoke test: 1. HomeView mode cards: tap target only covered content, not the full 72pt card frame. Fixed by .contentShape(Rectangle()) on ModeCard between .frame(minHeight: 72) and .glassEffect. 2. Mac NavigationSplitView sidebar: 4 placeholder Labels were inert. Phase 8 Part 1 left a stub with a TODO that never got picked up. Sidebar items now wire through NavigationLink(value:) using a shared HomeMode.appRoute computed property (single source of truth used by both HomeView card taps and the Mac sidebar links). 3. Throwaway HomeViewModel: RootView created a fresh HomeViewModel() inline whose path was never observed by NavigationStack. Cards had their tap target back (bug 1 fix) but taps appended to a discarded array → nothing navigated. Fixed by hoisting path as a Binding: HomeViewModel.init(path: Binding<[AppRoute]>? = nil); RootView passes its own Binding(get/set: RootViewModel.path). Default-nil preserves zero-arg call sites in AppComposition factories + previews + behavior tests. 4. ResumePill in RootView had the same shape bug as ModeCard (Button .plain + Spacer label). Applied the same .contentShape(Rectangle()) fix preemptively. Per AI Collaboration Mode + agent-impl-notes-log skill: subagent maintained meetings/2026-05-20_homeview-tap-and-mac-sidebar.impl-notes.md across two rounds (initial Bugs 1+2+4, then Bug 3 scope expansion). §未決 empty at both checkpoints; Leader review approved Option A (Binding-hoisted path with optional default) over Options B/C (callback / hoisted-ownership) for minimal blast radius. Verified: - swift build: 0 warnings - swift test: 340/340 in 65 suites - xcodebuild iOS scheme: ** BUILD SUCCEEDED ** 0 warnings - Snapshot delta: 0 PNG re-records needed (pure wiring fix; sidebar layout was already visually correct, just non-interactive) Out of scope (flagged by subagent for future cleanup): - AppComposition.homeViewModelFactory now dead code (RootView builds its own HomeViewModel inline with the path Binding). Karpathy §2: don't speculative-refactor; future PR. - HomeViewModel.path is bimodal (prod uses Binding, tests/previews use local). Works correctly but slightly confusing API; future cleanup if it becomes load-bearing. These bugs slipped past the Phase 8 Code Reviewer pipeline because: (a) snapshot tests render but don't click; (b) ViewModel behavior tests bypass the View layer; (c) Phase 8 Part 1 explicit TODO never closed across Part 2 / Phase 9 dispatches; (d) Mac-specific NavigationSplit interaction not in any test matrix. methodology improvements queued separately.
wei18
added a commit
that referenced
this pull request
May 20, 2026
Closes the orthogonal observation flagged in PR #16: RootView constructs its own HomeViewModel inline with a path Binding (post-#15 fix), so AppComposition.homeViewModelFactory and its Live/Preview implementations are never consumed. Option Delete chosen over Plumb-through: - HomeViewModel.init(path: Binding) needs the post-composition RootViewModel instance — () -> HomeViewModel factory shape can't supply it - Plumb-through would require RootView.init signature change (out of scope) - HomeViewModel has zero injected collaborators; no DI parity lost Files: removed factory prop + init param + call sites in AppComposition + Live + Preview, and the _ = factory touch line in CompositionTests. Test count unchanged (363). §未決 (FOLLOW-UP): All 6 other ViewModelFactory entries (dailyHub/practiceHub/game/completion/leaderboard/settings) also appear unread by production consumers outside the AppComposition module. Subagent flagged but didn't fix here. Filing as separate issue. impl-notes: meetings/2026-05-20_drop-dead-home-vm-factory.impl-notes.md
wei18
added a commit
that referenced
this pull request
May 20, 2026
…puted (#34 wave) (#35) After PR #16, HomeViewModel.path was bimodal — externalPath via Binding for prod, local for tests/previews. Option Clarify chosen: private `localPath` (fallback) + private `externalPath: Binding` (prod) + single public computed `var path` that routes between them. Result: API surface unchanged (callers still read/write `path`), but the bimodality is now encapsulated as private impl detail with clear names. `select(_:)` collapsed from branching if/else to single `path.append(mode.appRoute)` (computed setter owns routing). Files: only HomeViewModel.swift modified. HomeView / RootView / tests / previews untouched. Tests 363/363. 0 warnings. impl-notes: meetings/2026-05-20_home-vm-path-bimodal-cleanup.impl-notes.md
This was referenced May 20, 2026
wei18
added a commit
that referenced
this pull request
May 26, 2026
…rve-out (Stage 2, closes #16) (#161) * chore(modules): mv Telemetry (+ tests) to new TelemetryKit pkg (Stage 2 prep) Stage 2 of staged module split (per docs/foundations.md §2 演進): - Stage 1 ✅ SudokuCoreKit (SudokuEngine + GameState) — PR #154 - Stage 2 🟡 TelemetryKit (this branch) — trigger: 2nd app reuse - Stage 3 ⏳ GameCenterKit + PersistenceKit (post-Stage 2) This commit (Leader pre-flight, --no-verify): - Packages/TelemetryKit/Package.swift (skeleton with Telemetry target + TelemetryTests, both depending on SudokuCoreKit products) - git mv Packages/SudokuKit/Sources/Telemetry → Packages/TelemetryKit/Sources/Telemetry - git mv Packages/SudokuKit/Tests/TelemetryTests → Packages/TelemetryKit/Tests/TelemetryTests NOT YET done (follow-up subagent dispatch — no-verify pattern): - Packages/SudokuKit/Package.swift: remove Telemetry target + library + test target, add .package(path: "../TelemetryKit") + .product() refs in 5+ consuming targets' dependencies arrays - docs/foundations.md §2 演進 extension - Project.swift unchanged (App target deps on SudokuKit umbrella) --no-verify because pure file relocation (no Swift source edits; swiftlint/swiftformat have nothing to lint). Follow-up subagent commits will pass hooks normally. Co-Authored-By: Claude Opus 4.7 <[email protected]> * refactor(modules): SudokuKit deps on TelemetryKit for Telemetry * docs(foundations): note TelemetryKit Stage 2 extraction in §2 * chore(modules): carve out TelemetryTesting subdir from SudokuKitTesting/Telemetry/ Stage 2 of TelemetryKit extraction. The 3 fixture files (FakeLogger, MetricPayloadFixtures, RecordingSink) only depend on Telemetry types, not on SudokuKit types, so they belong alongside Telemetry. Subsequent commits wire up the new TelemetryTesting product + update SudokuKit test target deps + per-file import rewrites. Co-Authored-By: Claude Opus 4.7 <[email protected]> * chore(modules): add TelemetryTesting library product to TelemetryKit Exposes FakeLogger / RecordingSink / SlowSink / MetricPayloadFixtures as a separate product so SudokuKit test targets can depend on just the Telemetry-shaped fixtures without taking SudokuKitTesting as a whole. Pure dep on Telemetry — no SudokuCoreKit needed (verified by file-level grep, the 3 fixture files import only Telemetry). Co-Authored-By: Claude Opus 4.7 <[email protected]> * chore(modules): wire TelemetryTesting product into PuzzleStore + Persistence test targets Both test targets reference FakeLogger / RecordingSink in their source. SudokuKitTesting no longer re-exports those types (moved to TelemetryKit in prior commit), so the dep edge must be added explicitly. GameCenterClientTests / SudokuUITests / AppCompositionTests do not use these fixtures (BootOrderTests has its own private RecordingSink), so no edge added there — keeps the dep arrow minimal. Co-Authored-By: Claude Opus 4.7 <[email protected]> * refactor(tests): rewrite SudokuKitTesting -> TelemetryTesting imports per-file 5 TelemetryTests files: pure swap (they only use Telemetry-shaped fixtures, no SudokuKitTesting types). 4 SudokuKit test files: ADD TelemetryTesting alongside SudokuKitTesting (still need FakeGenerator / FakePrivateCKGateway / PuzzleFixtures from the latter). Per-file analysis — no blanket sed. Co-Authored-By: Claude Opus 4.7 <[email protected]> * docs(foundations): note TelemetryTesting library carve-out in Stage 2 Extends the existing Stage 2 §2 演進 entry to capture the TelemetryTesting library product + per-test-target import strategy. Co-Authored-By: Claude Opus 4.7 <[email protected]> * docs(meetings): TelemetryKit Stage 2 impl notes In-flight design log capturing the 4 decisions made during the TelemetryTesting carve-out: target dep trimmed to just Telemetry (SudokuCoreKit not needed), AppComposition test target untouched (BootOrderTests has its own RecordingSink), per-file import strategy, and no-verify dispatch pattern. Co-Authored-By: Claude Opus 4.7 <[email protected]> * docs(telemetry): refresh RecordingSink header to TelemetryTesting (CR #161 nit) Co-Authored-By: Claude Opus 4.7 <[email protected]> --------- Co-authored-by: Claude Opus 4.7 <[email protected]>
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 #15.
Bugs fixed
.contentShape(Rectangle())on ModeCardHomeMode.appRoute[AppRoute]HomeViewModel.init(path: Binding<[AppRoute]>? = nil)(Option A).contentShape(Rectangle())on ResumePillWorkflow used
gh issue createHomeView mode cards have shrunken tap targets; Mac sidebar items don't respond #15 → branchfix/homeview-tap-targets-and-mac-sidebar→ subagent dispatchmeetings/2026-05-20_homeview-tap-and-mac-sidebar.impl-notes.mdmaintained across both rounds,Status: COMPLETEat end, §未決 emptyVerified
swift build: 0 warningsswift test: 340/340 in 65 suitesxcodebuildiOS scheme:** BUILD SUCCEEDED **0 warningsWhy these slipped through Phase 8 review
Methodology improvements queued separately (Phase TODO sweep + SwiftUI footgun checklist).
🤖 Generated with Claude Code