Repository navigation
fix(minesweeper): game-over screen fills screen, no board bleed-through (#388) - #390
Merged
Merged
Conversation
…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]>
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 #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
.overlaybefore.padding+.ignoresSafeArea()" — but that's wrong about.padding/.overlayordering (an overlay already covers the full padded bounds). The real cause is frame inheritance: the.overlaywas 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
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.covered/midReveal/flagged/mineHit) pass unchanged → playing layout not regressed.Verification limit (honest)
NSHostingViewon 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 needidb, not installed; osascript clicks blocked by Accessibility permission). Residual risk accepted as low.🤖 Generated with Claude Code