Skip to content

feat(sudoku): grid digit keypad (3×3) with per-key remaining count - #658

Merged
wei18 merged 1 commit into
mainfrom
feat/sudoku-3x3-keypad
Jul 1, 2026
Merged

wei18 merged 1 commit into
mainfrom
feat/sudoku-3x3-keypad

Conversation

@wei18

@wei18 wei18 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Owner-requested: replace the iPhone single-row 1–9 digit strip with a 3×3 grid (九宮格), plus a per-key remaining-count.

What

  • iPhone digit pad → 3×3 Grid (1-2-3 / 4-5-6 / 7-8-9), reusing the Mac macDigitGrid pattern. Control row (Undo/Redo/Notes/Erase) unchanged, above the grid.
  • Per-key remaining count (9 − placed), derived in BoardView from viewModel.board.cells: shown for every digit; ==1 tinted sage-green (last-one cue); ==0 dimmed + disabled.
  • Notes mode: pad gets a 1pt sage border + ~6% wash as a peripheral annotation-mode signal.
  • ≥44pt targets, Dynamic Type capped .xLarge (same as the old row), a11y value "N remaining" / "fully placed". Sudoku-only (Minesweeper has no digit pad); Mac path unchanged.

Verified

  • Eyeballed re-recorded baselines: 3×3 grid renders cleanly with counts, board not crowded; almost-complete board shows dimmed/disabled digits + the sage "1" last-one cue.
  • 6 iPhone board baselines re-recorded (Mac/iPad/Completion byte-identical). SudokuKit tests pass; swiftlint 0.

Follow-up: iPhone SE fit uses minHeight 56; a ViewThatFits→44 fallback is the next move if a real SE run shows crowding.

🤖 Generated with Claude Code

…g counts

Replace the single-row nine-button strip (compact layout only) with a
`Grid(horizontalSpacing:8, verticalSpacing:8)` layout matching the
existing `macDigitGrid` pattern. Per-key changes:

- VStack shows the digit (`.title2.weight(.medium)`) above a small
  remaining count (`.caption2`). Remaining = 9 − placed count, derived
  at the `BoardView` call site from `viewModel.board.cells`.
- remaining == 1 → count tinted sage-green ("last one" cue).
- remaining == 0 → `.disabled(true)`, `.opacity(0.35)`, no count label.
- Notes mode → 1 pt sage border + ~6 % sage wash around the grid via
  zero-lineWidth / zero-opacity fallback (avoids view-type mismatch).
- Accessibility: `.accessibilityValue("\(n) remaining")` / "fully placed".
- Dynamic Type capped at `.xLarge` (same rationale as the old strip, #540).

`DigitPadView` receives a new `remainingCounts: [Int]` (9 elements,
index i = digit i+1). `BoardView.digitPad` computes it inline:
`(1...9).map { dgt in max(0, 9 − cells.filter { $0 == UInt8(dgt) }.count) }`.

Mac path (`macDigitGrid`), `compactControlRow`, and all public callbacks
are untouched.

Snapshot baselines: 6 iPhone fixtures re-recorded; 7 Mac/iPad fixtures
byte-identical.

Co-Authored-By: Claude <[email protected]>
@wei18 wei18 changed the title feat(sudoku): 3×3 digit keypad with per-key remaining count feat(sudoku): grid digit keypad (3×3) with per-key remaining count Jul 1, 2026
@wei18
wei18 merged commit 33e4df6 into main Jul 1, 2026
7 of 8 checks passed
@wei18
wei18 deleted the feat/sudoku-3x3-keypad branch July 1, 2026 05:09
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]>
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