Repository navigation
fix(minesweeper): give the pre-first-tap board an exit - #693
Merged
Merged
Conversation
The MS board's pause toggle was gated to `.playing || isPaused`, but MS defers session start to the first reveal (first-click-safe mine placement), so a just-mounted board sits in `.idle` with NO exit — no back button, no pause control, and edge-swipe-back is a no-op (#660). Fat-fingering the wrong difficulty (e.g. Expert 16x30) stranded the player with force-quit as the only escape. Sudoku is immune: `BoardLoaderView.startOrResume()` drives its session to `.playing` at mount, so its board never renders in `.idle` (no SudokuKit change). Fix: widen the toggle gate to also render in `.idle`. Tapping it there sets a view-local `showIdleLeaveOverlay` flag that mounts the SAME `PauseOverlayView` (leave-confirm semantics, existing `leave.game.*` strings, no new chrome) WITHOUT calling `viewModel.pause()` — the session actor deliberately no-ops pause on `.idle` (no clock to freeze), so an idle-aware view branch is required, not optional. Resume from the idle overlay just clears the flag (no session call); Leave dismisses as before. Play -> pause -> resume is untouched. Also: - Add `resumeBeforeFirstActionIsNoop` VM test backing the design decision that `resume()` is a safe no-op on an `.idle` session. - Re-record the 3 intentionally-affected covered-board baselines (iPhone light/dark + iPad light) — the Ready-state status bar now carries the pause button. - Update `docs/screen-contracts.md` (MS-BOARD idle row + #681 delta note; PAUSE-OVERLAY entry/Resume rows) and `docs/navigation-flows.md` (dated #681 delta under the unified pause menu section). Verified: MinesweeperKit 174/174 green (--no-parallel), MinesweeperCoreKit 87/87 green, swiftlint --strict clean on changed files. Sim walkthrough skipped per coordinator (watchdog stall); covered by re-recorded baselines + VM tests. Co-Authored-By: Claude Fable 5 <[email protected]>
CR follow-up: the `.idle` exit control still showed the pause glyph / "Pause" a11y label while its tap opened the Leave confirmation — a label/behavior mismatch (VoiceOver announced "Pause"). Add a third label branch for `.idle`: glyph `xmark`, visible Label text (regular width) and `.accessibilityLabel` both reuse the pause overlay's own `leave.game.leave` key (verified present in the MS app catalog with all 7 locales; `mise run scan:l10n` green incl. the #594 dotted-key gate — no new string). `.playing` / `.paused` branches are byte-identical. Re-recorded the same 3 covered-board baselines: iPhone light + iPad light now show ✕ instead of ⏸ in the Ready state (iPad rail renders the raw key text — a harness artifact: the snapshot host bundle has no app catalog, so LocalizedStringKey falls back to the literal; at runtime Bundle.main is the MS app and resolves "Leave", the exact mechanism PauseOverlayView's own keys use). Dark iPhone: status-bar text remains invisible in this harness (pre-existing quirk). Also noted the ✕/Leave label on the MS-BOARD idle contract row in docs/screen-contracts.md. Verified: MinesweeperKit 174/174 green (--no-parallel), scan:l10n green, swiftlint --strict clean. Co-Authored-By: Claude Fable 5 <[email protected]>
wei18
enabled auto-merge (squash)
July 5, 2026 14:04
wei18
added a commit
that referenced
this pull request
Jul 5, 2026
…ain (#695) Session log: 4-screenshot bug wave (#673-#677), three-lane dual-app UIUX/spec audit, navigation-flows + screen-contracts spec (#683), the screen-contract-spec skill (#684), the contract-driven static pass, the 4-PR fix train (#690-#693), two evidence-based environmental downgrades, and the gated open items (#685/#468/B1-B4/#694). Co-authored-by: Claude Fable 5 <[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.
Fixes #681 (P1 user trap): MS defers mine placement to the first reveal, so the board mounts in
.idle— where the pause toggle (gated.playing || isPaused) never rendered, edge-swipe is intentionally disabled (#660), and the ONLY escape was force-quitting. Fat-fingering Expert 16×30 stranded the user.Fix: widen the toggle gate to include
.idle; tapping there mounts the SAMEPauseOverlayViewvia a view-localshowIdleLeaveOverlayflag (MinesweeperSession.pause()/resume()deliberately guard.playing/.paused, so routing through the session would silently no-op — the idle-aware branch is required). Resume-from-idle just clears the flag (no session call, no illegal transition — pinned by the newresumeBeforeFirstActionIsNooptest); Leave dismisses. CR round 2: the.idlebutton now shows ✕ + the existingleave.game.leavekey (label/behavior parity; zero new strings, 7 locales verified, scan:l10n green). Sudoku immune —BoardLoaderView.startOrResume()enters.playingat mount (cited, SudokuKit untouched).Verification: MinesweeperKit 174/174 + MinesweeperCoreKit 87/87; 3 BeginnerCovered baselines re-recorded (eyeballed; dark-harness text-invisible quirk confirmed PRE-existing by extracting the old baseline). Leader sim walkthrough: Ready board shows the exit control → tap → 'Leave Game?' overlay (a11y tree = 5 elements, live-confirming #691's
.isModalon the new path) → Leave → lands on the Practice hub. Dual CR APPROVE ×2 (sonnet verified dual-trigger exclusivity, idle-teardown writes nothing per the #675 guard, clock can't start from idle). Spec rows updated (#681-tagged).🤖 Generated with Claude Code