Skip to content

feat(board): unified pause + leave menu (both apps) - #660

Merged
wei18 merged 2 commits into
mainfrom
feat/unified-pause-leave-menu
Jul 1, 2026
Merged

wei18 merged 2 commits into
mainfrom
feat/unified-pause-leave-menu

Conversation

@wei18

@wei18 wei18 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Merges the board's Close(✕) and Pause(‖) into ONE button → a full-screen pause menu. Owner-designed + UX-reviewed; sim-verified on Sudoku (and shared code / earlier verify on Minesweeper).

What

  • Tapping the single button pauses the game (timer frozen) and shows a full-screen .ultraThinMaterial mask (original pause blur, anti-cheat — board hidden) with a screen-centred "Leave Game?" card: Resume (primary, .borderedProminent, brand-accent — sage-green Sudoku / steel-blue MS) + Leave (subtle .bordered destructive red). Tap the mask = Resume.
  • Removed the separate ✕ close button, the leave confirmationDialog, and the now-dead leave-confirmation VM plumbing from GameRoot/GameRootViewModel (deleted the 4 orphaned Epic-2 tests).
  • Top chrome (timer) hidden while paused so the mask isn't pierced.
  • Shared PauseOverlayView (Resume/Leave/title/message threaded, localized — added game.paused then switched title to reuse leave.game.title; 7-locale scan:l10n green).

Verified

  • Sudoku sim: full mask, centred contained card (maxWidth 340), prominent Resume, no timer bleed, localized (zh-Hant).
  • GameShellKit 21 / GameAppKit 23 pass; swiftlint --strict 0 (BoardView at the 400-line ceiling).

Follow-up: orphaned game.paused L10n key (harmless; scan:l10n doesn't flag it).

🤖 Generated with Claude Code

wei18 and others added 2 commits July 1, 2026 13:44
Replace two-button chrome (✕ + ‖) with single pause button that shows a
unified pause menu with Resume (primary) and Leave (destructive). Removes
the confirmationDialog and close-button from GameRoot. PauseOverlayView
gains title/message/leaveLabel/onLeave params; both boards wire onLeave
via @Environment(\.dismiss). String params default to the existing
leave.game.* keys so callers only need to pass onLeave + onResume.

Removes: isShowingLeaveConfirmation, requestLeave, confirmLeave,
cancelLeave, onClose/onCancelLeave/onConfirmLeave from GameRoot/VM.
GameRootViewModelLeaveTests updated: Epic 2 tests removed, Epic 1 kept.

Adds "game.paused" key to both app xcstrings (7 locales); fixture synced.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
UX-review adjustments to the unified pause/leave menu:
- Full-screen .ultraThinMaterial mask (original pause blur, anti-cheat) at the
  board-body overlay level so it covers the whole screen and the card is
  SCREEN-centred (was framed to the board square).
- Card titled "Leave Game?" (reuses leave.game.title), contained to maxWidth 340.
- Resume = .borderedProminent (accent-filled primary/safe); Leave = .bordered
  (subtle destructive) — clear hierarchy, avoids accidental leave.
- Top chrome (timer) hidden while paused so the mask isn't pierced.
- Shared PauseOverlayView; Sudoku green / Minesweeper steel-blue.

Co-Authored-By: Claude <[email protected]>
@wei18
wei18 merged commit 08466df into main Jul 1, 2026
4 checks passed
@wei18
wei18 deleted the feat/unified-pause-leave-menu branch July 1, 2026 08:02
wei18 added a commit that referenced this pull request Jul 1, 2026
…ghting (#662)

Records the unified pause/leave menu (#660, 4 owner-driven design rounds), the 3×3 keypad (#658), in-board peer+same-digit highlighting (#661), the CI PR-title relax (#659), and the session's lessons (ground UX in the actual screen; check worktrees before force-remove; don't trust subagent test claims).

Co-authored-by: Claude <[email protected]>
wei18 added a commit that referenced this pull request Jul 5, 2026
* fix(minesweeper): give the pre-first-tap board an exit (refs #681)

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]>

* fix(minesweeper): idle exit button reads as leave, not pause (refs #681)

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]>

---------

Co-authored-by: Claude Fable 5 <[email protected]>
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