Skip to content

fix(minesweeper): game-over screen fills screen, no board bleed-through (#388) - #390

Merged
wei18 merged 1 commit into
mainfrom
fix/388-ms-gameover-fullscreen
Jun 8, 2026
Merged

wei18 merged 1 commit into
mainfrom
fix/388-ms-gameover-fullscreen

Conversation

@wei18

@wei18 wei18 commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Fixes #388.

What

The Minesweeper game-over (Completion) overlay was inset ~16pt and the live exploded-mines board showed through the border and under the status bar / home indicator. It now fills the screen.

Root cause (corrected the plan's hypothesis)

The v2 plan guessed "move .overlay before .padding + .ignoresSafeArea()" — but that's wrong about .padding/.overlay ordering (an overlay already covers the full padded bounds). The real cause is frame inheritance: the .overlay was attached to a view whose frame is only the board's intrinsic height (the board sits vertically centered with large empty bands), so the completion surface's .frame(maxHeight: .infinity) had nothing to expand into and couldn't reach the edges.

Fix (surgical)

After .padding, before .overlay, add .frame(maxWidth: .infinity, maxHeight: .infinity) so the view fills the screen and the overlay is proposed the full screen; keep .ignoresSafeArea() on the surface for the safe-area edges. Alignment stays .center, matching how the host already positions the playing board → layout-neutral for the playing state. No AppRoute conversion (deferred with #386).

Verification

  • New MinesweeperBoardTerminalOverlaySnapshotTests (light + dark) render the production composition with the overlay mounted. Leader viewed the committed light baseline directly: completion surface fills the container edge-to-edge, exploded grid fully hidden — the reported 16pt-border / bleed-through bug is fixed and visually confirmed.
  • All pre-existing playing-state baselines (covered/midReveal/flagged/mineHit) pass unchanged → playing layout not regressed.
  • Full MinesweeperKit suite 107/107 green; new snapshot suite 2/2 (Leader-verified locally).

Verification limit (honest)

NSHostingView on macOS has no safe-area insets, so the snapshot proves container full-bleed (the primary symptom) but cannot prove status-bar / home-indicator coverage. .ignoresSafeArea() is the standard-correct modifier for that edge, but it is not test-proven here. A live iOS-simulator visual check was attempted and then cancelled (tooling: the sim MCP's tap tools need idb, not installed; osascript clicks blocked by Accessibility permission). Residual risk accepted as low.

🤖 Generated with Claude Code

…388)

The post-game Completion surface was inset ~16pt: the live exploded board
showed through the padding border and under the safe areas. Root cause was
NOT the hypothesised `.overlay`/`.padding` ordering — the overlay already
covers the padded bounds. The real cause: the overlay was attached to the
`.padding(16)` result, which on iPhone is only as tall as the VStack's
*intrinsic* height (the board content is centered, not full-screen). The
surface's own `.frame(maxHeight: .infinity)` had nothing to expand into, so it
could never reach the screen edges/safe areas.

Fix (surgical, no AppRoute change — route-pushed Completion deferred to #386):
- Pin the board's host frame to `.frame(maxWidth:/maxHeight: .infinity)` BEFORE
  attaching the overlay, so the overlay is proposed the full screen. Alignment
  stays `.center`, which is exactly how the host already positions the playing
  board (per the recorded covered/mid-reveal baselines), so the playing state's
  16pt padding + centered layout is unchanged.
- Add `.ignoresSafeArea()` to the completion surface so it bleeds past the
  status bar / home indicator.

Verification:
- New snapshot suite (MinesweeperBoardTerminalOverlaySnapshotTests) renders the
  production composition — a seeded `.lost` board WITH the Completion overlay
  mounted (via a new nil-default `completionViewModelForSnapshot` seam, mirroring
  the existing `suppressTickerForSnapshot` seam; production never sets it). Light
  + dark baselines confirm the surface covers the container edge-to-edge with no
  inset border revealing the live grid — the #388 regression guard. Starts #315
  board+overlay coverage.
- All existing playing-state baselines (covered/mid-reveal/flagged/mineHit) pass
  unchanged, confirming no playing-state regression.
- 107 tests in 20 suites pass.

Limit: NSHostingView has no safe-area insets on macOS, so the snapshot proves
container-frame coverage but NOT status-bar/home-indicator safe-area coverage;
that part still needs iOS-simulator visual confirmation.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@wei18
wei18 merged commit b9a1685 into main Jun 8, 2026
3 checks passed
@wei18
wei18 deleted the fix/388-ms-gameover-fullscreen branch June 8, 2026 07:15
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.

fix(minesweeper): game-over screen inset 16pt, live board bleeds through edges/safe area (P1-5)

1 participant