Repository navigation
chore(polish): spacing token, MotionGate routing, mode-toggle contrast (#786 follow-ups) - #798
Merged
Merged
Conversation
…ode-toggle contrast Three non-blocking follow-ups from the #780/#783 reviews (issue #786): 1. Spacing literal (MinesweeperBoardView.modeToggle): `.padding(.horizontal, 12)` snapped to `theme.spacing.small` (8) — SpacingTokens names no 12 step, and `medium` (16) is reserved by the design-system pairing table for card-level internal padding. The chip's `.frame(minWidth: 44, minHeight: 44)` keeps the HIG tap-target floor independent of the padding value. 2. MotionGate consistency (SudokuKit BoardCellView error pulse): the hand-written `guard !reduceMotion` now routes through the shared `MotionGate.animation(_:reduceMotion:)` via `guard let`, matching the two `.animation` modifiers in the same file. `guard let` (not `withAnimation(nil)`) keeps behavior identical: reduce-motion on means no pulse at all — the opacity value never dips. 3. Mode-toggle contrast (MinesweeperBoardView.modeToggle reveal state): `.white` on `accent.primary` hard-failed AA in dark mode. WCAG ratios: - before: white / 0x3E6B8C light = 5.70:1 (pass); white / 0x7FAFCF dark = 2.35:1 (FAIL) - no text.* token passes dark either (text.primary 0xEEF1F4 / 0x7FAFCF = 2.07:1) — the accent ramp flips light<->dark opposite to the text ramp - after: `theme.surface.primary` (0xFFFFFF light / 0x1C2026 dark) = 5.70:1 light / 6.96:1 dark — both AA (>= 4.5:1). Light mode renders byte-identically (still white). Re-recorded the 11 MS board baselines that contain the mode toggle (covered light/dark/iPad, banner-reserved light/dark, flagged/midReveal/mineHit light/dark); terminal-overlay baselines are pixel-identical (overlay covers the toggle) and were left untouched. Pixel-diff confined to the toggle chip bbox in every re-recorded PNG; eyeballed light (white on slate, narrower chip) and dark (dark ink on light blue, readable). Note for the record: the first re-record attempt captured Flag mode because the swiftpm test host's UserDefaults domain (`swiftpm-testing-helper`) carried a leaked `com.wei18.minesweeper.board.tapMode = flag` from an earlier run (#720 G3 seeds the toggle from UserDefaults.standard at view init). The key was cleared before the final recording; the snapshot render's dependence on host defaults remains a latent recording hazard. Part of #786. Co-Authored-By: Claude Fable 5 <[email protected]>
wei18
enabled auto-merge (squash)
July 13, 2026 08:51
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.
What
Closes #786 — the three non-blocking follow-ups from the #780/#783 reviews:
.padding(.horizontal, 12)→theme.spacing.small(8). SpacingTokens names no 12 step;medium(16) is reserved for card-level internal padding. Tap target unaffected (explicitminWidth/minHeight: 44frame).MotionGateviaguard let— behavior identical (reduce-motion → no pulse at all;withAnimation(nil)would still dip the value one frame)..whiteonaccent.primaryhard-failed dark-mode AA (2.35:1 on 0x7FAFCF). Notext.*token passes (accent ramp flips opposite to text ramp) — switched totheme.surface.primary: 5.70:1 light / 6.96:1 dark, light mode byte-identical.11 MS board baselines re-recorded (pixel-diff confined to the toggle chip bbox; light + dark eyeballed, incl. by the Leader). Terminal-overlay baselines pixel-identical, untouched.
Follow-ups filed from this pass
Verification
MinesweeperKit full suite 244/244 · SudokuKit BoardCell/BoardView/BoardSnapshot 26/26 · swiftlint --strict clean · pre-commit hooks green.
🤖 Generated with Claude Code