Skip to content

feat(minesweeper): game-view Tier-2 polish + Mac side-rail (#298) - #316

Merged
wei18 merged 5 commits into
mainfrom
feat/ms-board-polish-298
Jun 4, 2026
Merged

wei18 merged 5 commits into
mainfrom
feat/ms-board-polish-298

Conversation

@wei18

@wei18 wei18 commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Refs #298 (the MS build-out's final game-view pass). Landed 5 of 6 items; 2 cosmetic items deferred to a Leader-local snapshot re-record.

Designer: Aligned · CR: APPROVE-WITH-NITS (no Blocker/High). Verified: Mac side-rail leaves the compact Tier-0 board byte-unchanged; reveal-all-mines fires only on loss; .task(id:) ticker leak/re-fire-free; zero Sudoku changes; 71+75 tests green.

Deferred (Leader-local re-record follow-up): #8 covered/revealed contrast + raised-tile bevel, #11 compact spacing token — both churn the iPhone-covered snapshot baseline. Plus the pre-existing public import SwiftUI→internal in MinesweeperCellButton.

🤖 Generated with Claude Code

wei18 and others added 5 commits June 4, 2026 11:45
Add a horizontalSizeClass == .regular branch to MinesweeperBoardView so
the Mac/iPad detail pane no longer renders the iPhone vertical stack.
Mirrors Sudoku's BoardView.macLayout: centered + size-capped board (600pt
square) on the left, a 260pt control rail on the right carrying the status
bar + Reveal/Flag toggle (MS has no digit pad). Outer width capped at
900pt and centered.

Compact (iPhone) layout extracted unchanged; spacing literal 12 preserved
verbatim so the recorded covered-board snapshots don't churn. New Mac
layout uses theme.spacing tokens.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…#298 #7 #8)

#7: on a loss, surface every mine, not just the detonated cell. No engine
accessor needed — the actor snapshot already carries the full cells array
with isMine populated once mines are placed, so the renderer paints still-
hidden mines from cell.isMine when status == .lost. Detonated cell keeps
the bold mineHit red; surfaced mines use the soft mine fill. Correctly-
flagged mines keep their flag glyph. The Completion overlay (#292) sits on
top via the outer overlay, so the revealed board shows behind it.

#8 (partial): swap the mine glyph burst.fill -> xmark.octagon.fill for a
clearer hazard read. The covered-vs-revealed contrast raise + raised-tile
bevel are deferred — they churn the covered-board snapshot baseline, which
the sandbox can't re-record (see impl-notes).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…#298 #10)

Mirror Sudoku's BoardCellView AX. Each cell collapses into one element with
a "Row R, Column C, <state>" label (1-based, state covers hidden/flagged/
N/empty/mine incl. the lost-mine surfacing), the .isButton trait, and a
named Flag/Unflag accessibilityAction so VoiceOver users can flag without
the long-press / right-click accelerators (which VO can't reach). Flag
action is inert on revealed cells and once the board is terminal.

Threads zero-based row/column into MinesweeperCellButton from the grid.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…op (refs #298 #9)

The status bar drove its 1 Hz elapsed refresh via a TimelineView whose
nested .task re-fired on every timeline tick (a .task re-fire footgun).
Replace with Sudoku BoardView's pattern: a single .task(id:) on the body
owning a `while !Task.isCancelled { if playing { refresh }; sleep(1) }`
loop, cancelled automatically on disappear, keyed on the VM identity so
Retry restarts it. Status bar is now a plain HStack reading the @observable
snapshot. Non-visible; correctness/perf only.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…efs #298 #11)

Migrate MinesweeperBoardView's outer .padding() to theme.spacing.medium
(value-identical 16, no snapshot churn) and the new Mac layout to the
spacing scale. The compact VStack(spacing: 12) literal is deferred — it's
the only remaining spacing-scale literal and migrating it churns the
covered-board snapshot baseline (sandbox can't re-record). Grid geometry
constants (minCellSide, cellSpacing, cornerRadius) are tap-target/shape
values, left as literals. Also seals the #298 impl-notes.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@wei18
wei18 merged commit 93a15f5 into main Jun 4, 2026
@wei18
wei18 deleted the feat/ms-board-polish-298 branch June 4, 2026 04:04
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.

1 participant