Skip to content

feat(sudoku): peer + same-digit cell highlighting - #661

Merged
wei18 merged 1 commit into
mainfrom
feat/sudoku-cell-highlighting
Jul 1, 2026
Merged

wei18 merged 1 commit into
mainfrom
feat/sudoku-cell-highlighting

Conversation

@wei18

@wei18 wei18 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Owner-approved in-board UX: highlight the selected cell's peers and all cells sharing its digit. Sudoku-only, pure-visual (no game-logic/determinism).

What

  • Peer highlight: selecting a cell faintly tints its row + column + 3×3 box (wires the previously-defined-but-unused cell.highlighted token).
  • Same-digit highlight: all cells holding the selected cell's digit get a distinct vivid tint (new cell.sameDigit token — 0xC8E1B4 light / 0x2A3C20 dark, deliberately distinct from selected/peer).
  • Background priority: error > selected > sameDigit > peer-highlight > given > base.
  • cell() extracted to BoardView+Highlighting.swift (BoardView 400→366, back under the file-length ceiling).

Verified

  • Eyeballed re-recorded snapshotInProgress_iPhone_light: selected = medium sage, peers = faint pale-green, other same-digit cells = vivid leaf-green — three distinct tiers, board fully readable.
  • 9 board baselines re-recorded (inProgress + almostComplete). BoardViewTests 18/18 pass; swiftlint 0.

🤖 Generated with Claude Code

When a cell is selected, faintly highlight every cell sharing its
row, column, or 3×3 box (peer highlight), and distinctly highlight
all cells showing the same digit (same-digit highlight).

Background priority chain: error > selected > sameDigit > highlighted
(peer) > given > base.

Token additions:
- CellTokens.sameDigit (light 0xC8E1B4, dark 0x2A3C20) — vivid leaf
  green, clearly distinct from cell.highlighted (0xEBF0E2) and
  cell.selected (0xDCE6D0).
- cell() moved to BoardView+Highlighting.swift to keep BoardView.swift
  at 366 lines (under the 400-line SwiftLint ceiling).

Re-recorded 9 snapshot baselines affected by the new tinting
(snapshotInProgress_* + snapshotAlmostComplete_*). Empty and
completed-board fixtures are unchanged.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@wei18
wei18 merged commit 040b2ae into main Jul 1, 2026
4 checks passed
@wei18
wei18 deleted the feat/sudoku-cell-highlighting branch July 1, 2026 08:26
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