You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(minesweeper): practice "Play Again" leaves the exploded board frozen, no new game #910
Minesweeper → Practice → any difficulty → hit a mine (boom/loss) → tap Play Again. The board does NOT restart: it stays frozen on the exploded state, still showing the revealed mine positions from the lost game.
Root cause (mirror drift, MS-only, Practice-only)
The onPlayAgain closure DOES fire a real new-board path (MinesweeperBoardView.swift:1163-1169 → LiveRouteFactory+DailyBoardOpen.swift:100-107 mints a new seed → presentGame), so it's not a closure-level no-op. The break is SwiftUI identity:
MinesweeperBoardView builds its game state inline: @State private var viewModel = State(initialValue: MinesweeperGameViewModel(...)) (MinesweeperBoardView.swift:72,225-235). On Play Again the route changes but the view's structural identity does not (same type, same tree position in GameRoot's GameModalContent, GameRoot.swift:216-229, no .id(route)), so SwiftUI treats the new MinesweeperBoardView(seed:…) as an update — @State's initialValue is only honored on first creation per identity, so the new seed is discarded and the old exploded-board @State survives.
Why Sudoku works: Sudoku wraps BoardView in BoardLoaderView with .task(id: puzzleId) (BoardLoaderView.swift:152-159); puzzleId updates on every re-render and .task(id:) re-fires on change → forces a fresh GameViewModel. MS Practice has no such loader wrapper (only Daily has an indirection layer, and Daily's onPlayAgain is hard-nil by design — one-per-day). MS never got the #652 Play-Again snapshot/debug-hook regression test that Sudoku has, so this went undetected.
Fix direction
Give MS Practice boards the same identity-reset Sudoku has — either a .task(id: seed/difficulty)-gated rebuild (mirror BoardLoaderView) or .id(seed) on the mounted content — NOT a dismiss/present reordering (Sudoku proves ordering isn't the problem). Add the missing MS Play-Again regression test.
Verification required
Sim repro (Practice → lose → Play Again → confirm fresh board). Mute BGM first. Add regression test mirroring Sudoku #652.
Activity
wei18 commentedon Jul 20, 2026
🔒 Claiming — dispatching to an implementation agent (Leader session 064a54f6). Fix mirrors Sudoku's BoardLoaderView identity-reset; MS Practice-only.
docs(contracts): sync screen contracts and navigation flows to as-bui…