Repository navigation
fix(minesweeper): board scaling + reveal/flag mode toggle (#278 Tier-0) - #282
Merged
Merged
Conversation
Tier-0 UX blockers from the Designer critique (#278), all in MinesweeperBoardView. Three coupled fixes, one dispatch: #1 Board scaling. The cell button was hardcoded frame(30,30) inside a naked VStack/HStack with no GeometryReader, so Expert (16x30 ~ 960pt) overflowed every iPhone and most Mac windows. The grid is now wrapped in a GeometryReader that derives a single square cell side fitting the NON-square board by its longer axis: cellSide = floor(min(availW/cols, availH/rows)) where availW/availH subtract the inter-cell spacing first. The cell frame and the number/flag/mine glyph (font ~ cellSide * 0.55, replacing the literal 16) both scale from it. #2 Tap-target floor. minCellSide = 32pt. When the fitted side would drop below the floor (e.g. Expert on iPhone fits ~10pt), cellSide is clamped to 32 and the board scrolls (ScrollView([.horizontal,.vertical])) instead of shrinking into an un-tappable grid. When it fits, the ScrollView is inert. #3 Discoverable reveal/flag toggle. Added an on-screen segmented Picker (Reveal / Flag) above the board, modeled on Sudoku's pencil-mode toggle. In Flag mode a tap flags; in Reveal mode a tap reveals. Long-press (iOS) and right-click contextMenu (Mac) stay as flag accelerators in either mode — Mac users no longer depend on an invisible right-click. Mode is view-local @State (no engine semantics). Added .contentShape(Rectangle) so the whole cell square is hit-testable. Deferred: Tier-1 theme tokens, Tier-2 Mac side-rail (#6), win/lose overlay (#7), VoiceOver (#10), .task loop cleanup (#9) — separate dispatches. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…entering CR REQUEST-CHANGES: - iOS .flag-mode long-press double-toggle: in .flag mode the button tap + long-press both fired onToggleFlag, netting a no-op. Long-press now only flags in .reveal mode (redundant in .flag mode where tap already flags). - Fitted board was pinned top-leading; now center the floored grid in the offered rect (mirrors Sudoku BoardView), only scrolling when clamped to floor. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This was referenced Jun 3, 2026
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.
Refs #278 (Tier-0 of the Designer critique — Tier-1 theme extraction + Tier-2 polish remain tracked on the issue).
Fixes the 3 theme-independent Blockers:
MinesweeperBoardViewboard grid now sizes viaGeometryReader—cellSidederived from the offered rect, fitting the non-square board (Expert 16×30) by its longer axis; glyph size trackscellSide. No more 960pt overflow.Code Review: REQUEST-CHANGES → resolved. Two CR findings fixed: (1) iOS
.flag-mode long-press double-toggle (long-press now only flags in.revealmode); (2) fitted board was pinned top-leading — now centered in the offered rect (mirrors Sudoku BoardView), scrolling only when clamped. CR confirmed theGeometryReader + .aspectRatiosizing is sound (no collapse/starve — same proven pattern Sudoku ships).Verified: MinesweeperKit builds + 34 tests pass.
🤖 Generated with Claude Code