Repository navigation
feat(board): full-bleed board + G4 two-group floating glass control cluster - #1056
Conversation
…fold Checkpoint of #1022 phase 1 (Sudoku). Not yet verified — snapshot baselines are deliberately NOT re-recorded; see the open question below. - GameShellUI: new `BoardControlCluster`, the shared G4 shape both games mirror. Two glass groups (edit / input), each its own `GlassEffectContainer` so the two can never blend into one background; system default spacing throughout per design.md §4.6. A single-group initializer exists for Minesweeper, which has no edit-group controls (it has no undo at all — see #1052). - BoardView: the blanket `.padding(theme.spacing.medium)` screen margin is off the body. `compactLayout` now pads only its chrome, leaving the board edge-to-edge (design.md §3.4); `macLayout` re-applies the same 16pt it used to inherit, since the Mac board sits in a capped detail column and full-bleed does not apply there. - BoardView: G4 unmounts whenever `modalOverlayPresentation != nil` — the one value that already drives every board modal, so completion, pause and leave-confirmation are all covered with no new observer, no preference key and no `.disabled()` on the shell (§4.3 scene exclusivity). - DigitPadView: rebuilt as the two groups, per-button glass, never on the container (§12 error #8). §4.7 coloring pass — the whole-grid pencil-mode wash is gone and Erase/Undo/Redo lost their accent ink, leaving exactly one colored control per group. The #855 F-5 disabled gray-out and the #797 on-accent-ink placement both survive. Measured full-bleed cell side at 393pt = 43.7pt (786px / 9 / 2), at or above design.md §3.4's 43.2pt — the table deducts a 4pt outer frame this board does not have. Open: `.buttonStyle(.glass)` renders fully transparent in the headless macOS snapshot renderer (the previous `.bordered` keys rendered visible backgrounds). Investigating whether explicit `.glassEffect()` — the other spelling §4.6 allows and #1029's B-7 verified — renders, before touching any baseline. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…files #1022's G4 rework pushed both files past SwiftLint's 400-line file_length ceiling. Repo convention is to extract a `+Feature.swift` sibling rather than disable the rule, so: - `BoardView+Layout.swift` takes both size-class arrangements; BoardView.swift keeps the view's state, `body` and lifecycle. - `DigitPadView+Mac.swift` takes the Mac rail arrangement. `adProvider` / `adGate` / `theme` / `compactLayout` / `macLayout` drop to `internal` for the cross-file reads, matching the same convention the existing BoardView+AccessibilityHeader.swift split already established. Also corrects BoardView's file header: the "NO .glassEffect on the board" rule still holds for the GRID (design.md §3.4 keeps the content layer glass-free) but no longer describes the control cluster around it. `swift build` clean; `swiftlint --strict` clean on GameShellUI/BoardControlCluster.swift and all of SudokuUI/Board/. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
§7's rule is a layout rule ("幾何不隨開關改變,必須以最壞情況(IC+RT)為設計基準"),
so a screenshot at one width cannot establish it. `BoardControlClusterLayout`
states the compact board screen's top-down band assignment — margin, header,
full-bleed board square, flexible gap, cluster groups — as pure geometry, and
the suite sweeps §3.4's three breakpoint widths against cluster heights from a
lone edit row up past anything the `.xLarge` Dynamic Type cap can render,
asserting at every point that no glass group's rect intersects any cell rect.
Also pinned: the two groups are disjoint bands rather than one merged surface;
a single-group cluster (Minesweeper, #1052) reports one group and not an empty
second one; Minesweeper's non-square 16×16 / 16×30 boards obey the same rule;
and a taller cluster shrinks the BOARD rather than encroaching on it, with the
board clamped at zero so a flipped rect can never sneak past `intersects`.
Nothing here samples the eight Reduce Motion × Increase Contrast × Reduce
Transparency combinations: `bands(...)` takes no accessibility input because
those switches change how glass is painted, and painting is not layout — so
sampling them would be sampling one call eight times. Dynamic Type is the input
that can genuinely grow the cluster, and that is what the sweeps vary.
Deliberately takes the group heights as INPUTS rather than freezing a metrics
table: fixing them here and rendering with `.frame(height:)` would make the
numbers true by force and hide a real overflow behind a clip.
GameShellKit 122/122 green; swiftlint --strict clean.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Phase 2 of #1022 — Minesweeper's half, mirroring Sudoku's SHAPE rather than copying DigitPadView (the two games' controls genuinely differ). - `MinesweeperControlClusterView` is new and builds the same shared `GameShellUI.BoardControlCluster`, takes plain values plus closures like DigitPadView does, and keeps the mode toggle's full a11y contract (label / value / hint / identifier) and its #786 on-accent ink, which must sit on the label content because a prominent style resolves its own label ink (#797). - It ships ONE group. design.md §3.4 and #1022 both describe MS's cluster as "揭開/旗標模式切換 + undo", but Minesweeper has no undo at any layer — no `canUndo`, no `undo()`, and the scope comments in `MinesweeperSession` and `MinesweeperGameViewModel` say so outright; the engine's `moves` array is a forward-only replay log that state restore discards. The edit group is omitted rather than rendered empty or filled with a disabled placeholder, which would be a dead control. Undo is engine work, tracked as #1052. - The MS board goes full-bleed the same way Sudoku's did: the blanket `.padding(theme.spacing.medium)` leaves `body`, chrome pads itself, and `macLayout` re-applies the margin it used to inherit. - The cluster unmounts whenever `modalOverlayPresentation != nil`, off the same single value that already drives every board modal. - Tap-mode persistence moves into `toggleInteractionMode()` unchanged, still writing through the injected store (#796) rather than `.standard`. Sudoku's board now centres in its vertical band instead of sitting under the header. Removing the padding had left the two apps disagreeing on the same screen — MS's grid already centres in its fitted branch (#764) — and §3.4's ASCII shows breathing room above and below the board. `BoardControlClusterLayout` models the band accordingly; centring can only move the square away from the header, never past the band's bottom edge, so §7's rule is unaffected. Board baselines re-recorded, and they legitimately show the cluster's controls as bare glyphs with no key surfaces. That is NOT "the controls disappeared": Liquid Glass renders as nothing in this repo's NSHostingView capture path, while standard materials and `.bordered` render fine — measured both ways, see the PR body. The App Store `03-board` slots read from these same baselines, so that consequence is tracked separately as #1054; it is not fixed here. MinesweeperKit 409/409 green. SudokuKit Board|DigitPad batch back to its pre-existing 104 tests / 2 issues (the load-sensitive `BoardLeaveOrPauseStateTests` clock flake, which passes in isolation). GameShellKit 122/122 + 6 new §7 geometry tests. swiftlint --strict clean. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…points The existing board matrix only ever renders 393pt, the middle row of §3.4's cell table. These add 320 (iPhone SE) and 430 (Pro Max) so a horizontal inset creeping back in is caught at the widths the table is actually about. Measured from the recorded baselines (board width in pt / resulting cell side, against §3.4's figure): 320 → 235.0 pt wide, 26.1 pt cells (table 35.1) — NOT full-bleed, see below 393 → 393.0 pt wide, 43.7 pt cells (table 43.2) — full-bleed 430 → 430.0 pt wide, 47.8 pt cells (table 47.3) — full-bleed At 393 and 430 the board is width-bound, so it spans the screen exactly and the cell side lands above the table (the table deducts a 4pt outer frame this board does not have — 附錄 B's "扣除外框"). At 320 it is HEIGHT-bound: the header plus the control cluster plus the margins leave only ~235pt of vertical room, so the square is capped by height and removing the horizontal inset buys nothing. That is a property of the cluster's height on a 568pt screen, not of this change — the same chrome dominated before #1022 — but it does mean §3.4's SE row is not reachable with G4 at its current size, and 26.1pt sits under the 28pt absolute floor §3.4 itself cites. Raised with the PM rather than silently recorded. The baselines show the cluster's controls as bare glyphs. That is the NSHostingView capture path's Liquid Glass blind spot (#1054), not missing controls; `testName` is forwarded through the helper so each baseline files under its own `@Test` rather than all three under the helper's name. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
… G3 row Four corrections #1022's implementation forced, each anchored to what the code actually does rather than what the spec assumed. §3.4 格徑表 — the "3.0 滿版" column is `(W − 4) / 9`: 附錄 B's "扣除外框" deducts a 4pt outer frame the board does not have (only 0.5pt per-cell hairlines). The real full-bleed side is `W / 9`, slightly LARGER than the table. Measured from the recorded baselines: 393 → 43.7pt and 430 → 47.8pt, both true full-bleed. §3.4 SE row — 320pt measures 26.1pt, not 35.1pt, because the board there is bound by HEIGHT, not width: header + G4 + margins leave ~235pt, so removing the horizontal inset buys nothing. The table's width-bound assumption never held on that device — the pre-3.0 "現況 32.0pt" figure was unreachable for the same reason — so this is a long-standing table error, not a #1022 regression. 26.1pt is under the 28pt absolute floor the section itself cites; the fix is a shorter cluster variant for short screens, tracked as #1055. §3.4 MS controls — the ASCII said "MS:揭開/旗標模式切換 + undo", but Minesweeper has no undo at any layer: no `canUndo`, no `undo()`, and both `MinesweeperSession` and `MinesweeperGameViewModel` say "no undo" in their scope comments. The engine's `moves` is a forward-only replay log that state restore discards. So MS ships ONE group and the edit group is not drawn at all — no disabled placeholder, because a dead control is worse than an absent one. Tracked as #1052. §4.1 — G3's row still says 刪除, but nothing has deleted it: #1022 left the header alone because the iPhone board is a `fullScreenCover` with no NavigationStack, so `.toolbar` draws nothing, and adding one would change BoardView's frame such that the in-place pause overlay stops covering the toolbar — the exact #763 guarantee #1019/#1038 paid to restore. Marked ⏳ with #1053 rather than left reading as done. §4.1 also gains the snapshot caveat: this repo's `NSHostingView` + `cacheDisplay` path renders standard materials and `.bordered` but draws Liquid Glass as nothing, so G4/G6 glass can only be verified on a simulator — and the App Store `03-board` slots read those same baselines (#1054, pre-submission blocker). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ed by #1054 `scan:store_frame_drift` flags four changed baselines feeding the `03-board` slot for both apps across iphone-6.9 / ipad-13 / mac. Regenerating is the gate's prescribed fix, and it is the right one here even though the output is wrong: The regenerated frames show the board with NAKED, SURFACE-LESS CONTROLS — bare undo/redo/pencil/erase glyphs and bare digit keys with no backgrounds — because this repo's snapshot renderer draws Liquid Glass as nothing (measured both ways; see #1054). On device the same build renders the two glass groups correctly. Committing them anyway, deliberately. A stale frame depicting a design the app no longer has is the #1051 orphaned-baseline failure mode: it looks fine, so nobody investigates. A current frame we have measured, know is wrong, and have filed as a submission blocker is strictly safer — the artifact matches the app, and the "submit before it is fixed" risk is held by #1054 (labeled `pending`, referenced from the epic) rather than by anyone's memory. NOT using the gate's `frame-drift-verified` escape hatch. That hatch attests the baseline change does not alter any ASC frame; this one demonstrably does, so the trailer would be a false statement that happened to turn the gate green. 168 slots regenerated, 28 files changed, all matching their device ASC pixel size and RGB with no alpha. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…nest §7 anchor Two blockers and the must-fix list from the #1056 review. BLOCKER 2 — a baseline was committed with ZERO opaque pixels (`BoardViewDigitFirstTests/snapshotArmedDigit_iPhone_light`) and every gate stayed green: a blank capture matches a blank reference, the drift gate only fires on change, the orphan gate only proves a recording test exists. Root cause isolated with a throwaway probe, and it is narrower AND broader than the review's hypothesis: it is not `GlassEffectContainer` and not `.glassProminent` — it is **TINT**. Opaque-pixel counts through this exact capture path on a 300×200 ground: no glass at all 26800 .buttonStyle(.glass), untinted 26800 .buttonStyle(.glassProminent) 0 .buttonStyle(.glass) + .tint 0 .glassEffect(.regular.tint(_)) 0 .glassEffect(.regular.tint(_).interactive) 0 Any tinted glass blanks the WHOLE capture, background included. Untinted glass leaves the rest of the screen intact (the glass itself is still invisible — that is #1054's separate blind spot). On device the same build renders fine. Fixes: - `SnapshotBlankBaselineGuardTests` in BOTH apps — walks every committed baseline and fails on any with no opaque pixels. Content-agnostic, no per-fixture bookkeeping, and it would have caught this immediately. - `BoardViewDigitFirstTests` split by what this renderer can actually capture. The `isSameDigit` cell tint is ordinary board content, so it stays a pixel snapshot — now on `BoardCellView` directly, WITH an untinted control cell beside it, because one image proves nothing about a highlight (the pair differ in 98% of pixels, so the assertion has real discriminating power). The armed KEY's own highlight is uncapturable here and is verified on the simulator instead. Re-recording the old fixture would just re-commit a blank. BLOCKER 1 — three MS baselines were silently stale, not one. A full-suite re-record (never a filtered subset — a filter changes the execution set and order-dependent fixtures then bake a different state) found the iPad case the review named plus both Mac `snapshotFlagged_*`: 0.41% / 1.07% / 1.07% drift, every one a 224×104pt hit on the mode-toggle chip, every one inside `.tolerantImage`'s 5% budget. Sudoku is clean. `minesweeper/ipad-13/*` ASC frames regenerated (7 locales); the Mac ASC frame did NOT move despite its baseline drifting, because the drifted region sits outside the marketing crop — so the drift gate is not a proxy for baseline correctness. Class tracked as #1057. §7 suite — the review is right that it was self-consistent algebra: `boardSide` and the board band are the same quantity restated, so the non-overlap assertion could not fail. It now has an empirical anchor: real frames read off a running app with `idb ui describe-all`, asserted against the model. That immediately earned its keep — fed the measured chrome WITHOUT safe-area terms the model predicted a 402pt board where the device renders 392.5pt. Adding `safeAreaTop`/`safeAreaBottom` brings the cluster's top to the measured 539.0 exactly and the board within 4.5pt. The anchor also corrected a claim I had made from the same data: the cell PITCH is 43.61pt, not the 44.17pt `describe-all` reports as each cell's frame width — the hit rects are ~0.55pt wider than the pitch and overlap slightly. 43.61 clears §3.4's 43.2 but sits just UNDER the HIG 44pt default, exactly as §3.4's ruling anticipates. And on a real 402pt device the board spans 392.5, not 402: the layout applies no horizontal inset, but with real safe areas the square is still height-bound by ~9.5pt, so "full-bleed" describes the layout rule, not a guarantee of edge-to-edge on every device. Both are pinned by assertions now. Also in this batch: - M1: design.md §4.6 amended — each group gets its OWN `GlassEffectContainer`, with the B-7 reasoning (merging is proximity-driven, so one shared container makes "text and icons never share a background" depend on the gap between them; separate containers make it structural). - M2: `fullBleed_iPhoneSE_320` renamed `heightBound_iPhoneSE_320` (baseline follows) — a test named for a claim its own subject disproves is the contradiction §3.4 just had to be corrected for. `fullBleedCellSide`'s table comparison scoped to 393/430, where the board actually IS width-bound; at 320 `W/9 >= (W−4)/9` is true for every W and proved nothing. - M4-lite: `BoardControlClusterLayout` dropped to internal, header rewritten to claim only what it proves, and `stackSpacing * 3` replaced by a caller-supplied `stackGapCount` so it stops asserting a correspondence nothing checks. - M5: MS's dead `Spacer(minLength: 0)` deleted (the board already expands, so it resolved to zero height while still costing a stack gap); Sudoku's comment no longer describes a `Spacer` its stack does not have. - Cosmetic: `DigitPadView+Mac.swift`'s `}}`. GameShellKit 125/125, MinesweeperKit 410/410, SudokuKit Board|DigitPad|Snapshot 122/122. swiftlint --strict clean. Both store gates PASS. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The direct answer to CR B1: a glass restyle of one control drifted three Minesweeper board baselines by 0.41-1.07% and passed, because the whole-board suites use `.tolerantImage` (precision 0.95) for the antialiasing-heavy grid. Rendering the cluster ALONE gets strict comparison on the part that must not drift silently, without turning the board tests strict and flaky — `strict content / tolerant board` is already the repo's convention, and this is a content fixture. Chosen over region-masking inside the board snapshots: same targeting, far less machinery, and it lands where strict already belongs. Both apps, default (untinted) cluster state only. A tinted glass control blanks this entire capture path, so armed-digit / notes-on / flag-mode cannot be pixel-tested here at all and stay simulator-verified; `SnapshotBlankBaselineGuardTests` fails loudly if a future state change ever lands one of them in a fixture. Two fixtures were checked for discriminating power rather than assumed to have it, since a snapshot that cannot fail is worse than no snapshot: - Sudoku enabled vs history-disabled differ in 0.14% of pixels — the #855 F-5 gray-out is genuinely captured. - That case is COMPACT deliberately. The conditional ink #855 installed lives only in the compact row; the Mac rail leaves disabled styling to the system and renders byte-identical enabled vs disabled through this path, so a regular-class variant would have asserted nothing. Whether the rail dims on a real Mac is not answerable here — #1039 owns macOS interaction. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…he old design I got these wrong once and want the reasoning on the record, because the way I dismissed them is a trap anyone re-recording under a tolerant comparator will hit. `BoardViewBannerTests/snapshotAdsEnabledUnloadedSlot_iPhone_light` and `BoardViewTests/snapshotEmpty_Mac_light` were never re-recorded in this PR (`git log origin/main..HEAD -- <file>` is empty for both). They still showed the PRE-#1022 board: 16pt inset and `.bordered` key fills. A full-suite re-record produces something 35.91% / 17.12% different. My first sweep DID flag both, and I dismissed them as artifacts of my own harness on the grounds that "they pass against HEAD, so HEAD must be correct." That inference is invalid, and here is why: `.tolerantImage` is `.image(precision: 0.95, perceptualPrecision: 0.95)`. The perceptual term means a pixel counts as matching when its delta is small — and these boards are a low-contrast cream/white/light-grey palette, so an ENTIRE layout and styling change is composed almost entirely of small per-pixel deltas. A visibly different design passes. So under a tolerant comparator, "the suite is green" says nothing about whether a baseline matches the code. Staleness can only be established by re-recording and diffing. The magnitude heuristic I proposed earlier — that ~1% is real drift and 36% means the measurement is broken — was exactly backwards here: the large number was the honest signal and I explained it away. Sweep redone properly, deleting and re-recording EVERY baseline in both apps from a full-suite run and treating any difference as real: - Sudoku: these 2, now fixed. Nothing else. - Minesweeper: 0 remaining (the 3 fixed earlier were the whole set). Neither of these two feeds an ASC slot, so no marketing frame moved. SudokuKit 412/412, MinesweeperKit 412/412, both store gates PASS. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…where it can't NEW-1: two of the six strict cluster tests were asserting nothing. Diagnosed before fixing, and the cause is neither of the two the review offered. The dark variants were not byte-identical — they differ in 1469 / 6615 pixels — but every one of those differences is alpha ≤7 antialiasing residue. Visually identical, so the finding stands; my first measurement said "1469 differ" and was the same over-literal reading that nearly buried the stale baselines last round, just pointing the other way. The real cause is fixture SCOPE, not a broken colorScheme injection and not a capture-path limit. This path DOES flip theme-token ink (`Color(light:dark:)` resolves through SwiftUI's `\.colorScheme`); it does NOT flip system default label colours, which resolve from the AppKit drawing appearance `cacheDisplay` never applies. Measured on these exact fixtures: compact light vs dark 5998 VISIBLE differing px, ink (20,22,25) → (239,239,242) rail light vs dark 0 visible MS light vs dark 0 visible The compact row carries always-on theme ink (#855 F-5's conditional icon colours), so its dark variant is real coverage — ADDED, it did not exist before. The rail and MS fixtures contain no theme ink in any state this path can capture: their only `foregroundStyle` uses sit in the PROMINENT branches (armed digit / notes-on / flag mode), prominent means tinted, and tinted glass blanks the whole capture. No capturable state of those views can carry a dark-mode signal, so both dark tests are DELETED rather than left advertising coverage they never had. Dark appearance there is simulator-verified. M2 residual, and I got this wrong once more before getting it right. The first replacement compared `side > tableFigure` and I wrote a comment claiming a re-introduced 16pt inset would fail it. That was false: `fullBleedCellSide` is a pure function of screen width and knows nothing about the app's layout, so it could not fail either. Deleted. The table comparison now lives on the MEASURED device geometry — `#expect(cells[0].width > 43.2)` plus an upper bound below the HIG 44 default — where it is a statement about the board the device actually rendered rather than a rearrangement of W/9. The surviving pure-function test is renamed `fullBleedCellSideIsWidthOverColumns` and its doc comment says outright that it is an identity and cannot catch an inset regression. §3.4 backs the upper bound: it predicts this device class does NOT reach 44 ("仍未達,差距 3.9→0.8pt"), only Pro Max does ("首次跨過"). GameShellKit 124/124, MinesweeperKit 411/411, SudokuKit Board|DigitPad|Snapshot|Cluster 126/126. swiftlint --strict clean on every file touched. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
T6 ACCEPT Fresh-context acceptance at PR head 1. Issue #1022 mechanical criteria
2. Deferral annotations honest — all six (#1053, #1054, #1039, #1055, #1057, #1052) verified via 3. Deleted-coverage audit
4. Blank-baseline guard — 5. Baseline currency (strongest check) — flipped
6. Tests — GameShellKit 124/124 ✅ (exact match). MinesweeperKit 411/411 ✅ (exact match). SudokuKit filtered 7. PR body honesty — cross-checked every disclosure item requested: MS 6pt shift arithmetic (traced to the PR's own commit history — a 8. Issue references — extracted all 42 distinct Verdict: ACCEPT. One non-blocking process note recorded in §3(b) above for the record (the §7 layout suite isn't wired to production layout code, so its regression protection is a hand-anchored constant, not automatic) — does not block, since the alternative (pixel snapshot) is structurally blind to Liquid Glass in this repo's capture path, which the PR already documents at length. |
Sibling of the PR-body correction, found by auditing my own claims against `main` instead of against the current head — the habit that would have caught the original mistake. The comment introduced in 7d303e4 read "No `Spacer` here: `boardGrid` already expands into the slack…", which presupposes a `Spacer` existed on this stack and was removed. It never did on `main`: the compact stack has no `Spacer` before or after this PR, and the one deleted in round 1 was added by this PR's own cluster extraction in 01c6965. A future reader would have taken the comment as the aftermath of a real removal. Rewritten to say what is actually true — this stack never had one, here is why it should not gain one — with the intra-PR history noted explicitly so the comment cannot be misread the same way again. Audited the PR body's other net-change claims against `main` at the same time; all three verified as real deltas rather than intra-PR artifacts: - MS mode toggle moved below the banner: main `boardGrid / modeToggle / bannerSlot` → `boardGrid / bannerSlot / controlCluster`. Real. - Sudoku board centres in its band: `.frame(maxHeight: .infinity)` + `.layoutPriority(1)` are absent on main. Real. - MS Reveal was `.borderedProminent` + accent tint on main. Real. MinesweeperKit 411/411; swiftlint --strict clean; comment-only change. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
T6 addendum — mutation probe on new/changed assertions Per request, applied "make it fail" mutation testing to the assertions this PR added/changed, in a second throwaway worktree at
All five probes reproduce the implementer's claimed numbers/behavior exactly. No vacuous assertions found among the ones checked. This is additive to my earlier T6 ACCEPT (#1056 (comment)) — verdict unchanged. |
|
T6 ACCEPT — fresh-context acceptance of dd02a55 (base 714a58c), done in a throwaway detached worktree at 1. Mutation checks on new/changed assertions — all real, none tautological ✅
2. Deleted-coverage audit (rail/MS dark cluster snapshots) ✅Re-added the two deleted dark tests ( 3. Issue #1022 acceptance criteria, mechanically checked ✅
4. Baseline currency + blank guard ✅
5. Test counts — match the PR body's claims exactly ✅
6. PR body honesty ✅
No fabricated or unverifiable claims found in this pass. Recommend merge. 🤖 T6 acceptance by Claude Opus 5 |
|
T6 ACCEPT (carried forward to 13c7a77) — correction to my own review above, plus head-move verification. Correction to §6 of my prior comment. My statement that the "MS 6.0pt shift" checked out "against real code, not just narrative" was true only in a narrow, misleading sense: the arithmetic ( Head-move verification.
Since the only delta since Net verdict unchanged: ACCEPT. 🤖 T6 acceptance by Claude Opus 5 |
Rebuilds the board screen per design.md §3.4/§4.6/§4.7/§7: the board goes edge-to-edge and the bottom controls become G4, two glass groups with per-button glass, on both apps.
What changed
Full-bleed board. The blanket
.padding(theme.spacing.medium)screen margin leaves both boards'body; chrome pads itself and the grid gets no horizontal inset at all.macLayoutre-applies the margin it used to inherit, because the Mac board sits in a capped 960/640 detail column where full-bleed does not apply.G4 = two glass groups. The shared shape is
GameShellUI.BoardControlCluster. Each group is its ownGlassEffectContainer, so text keys and icon keys can never blend into one background regardless of how close they are laid out — the §4.6 rule stops being a function of the gap. Every BUTTON carries its own.buttonStyle(.glass)/.glassProminent; no container ever gets.glassEffectapplied to itself (§12 error #8, confirmed on device by #1029's B-7 spike). Container and stack spacing are left at system defaults throughout.Scene exclusivity. G4 unmounts whenever
modalOverlayPresentation != nil— the one value that already drives every board modal, so completion, pause AND leave-confirmation are covered by a singlenilcheck. No new observer, no preference key, no.disabled()on the shell: #1020 removedBoardModalOverlayActivePreferenceKeybecause observing it from the shell root unmounted the pushed board on macOS, and #1019 proved.disabled()deadlocks the overlay's own CTA. Reading the value the overlay is keyed on cannot drift from it.Minesweeper mirrors the shape, not the code.
MinesweeperControlClusterViewis new and builds the sameBoardControlCluster, but MS ships ONE group — because Minesweeper has no undo at any layer, contrary to §3.4 and this issue's own text. NocanUndo, noundo();MinesweeperSession.swiftandMinesweeperGameViewModel.swiftsay "no undo" in their scope comments; the engine'smovesis a forward-only replay log that state restore discards. The edit group is omitted, not rendered empty and not filled with a disabled placeholder — a dead control is worse than an absent one. Undo is engine work, tracked as #1052.Behaviour changes a reviewer should not have to infer from a baseline diff
.borderedProminenttintedaccent.primary. Flag keeps itsaccent.mutedtint. §4.7 applies colour sparingly and reserves it for state indicators, and this makes the two apps' clusters read alike (Sudoku's pencil is likewise neutral when off).boardGrid → modeToggle → bannerSlottoboardGrid → bannerSlot → controlCluster, so the toggle now sits under the banner rather than between it and the board. That is the cluster taking its place as the bottom-anchored G4 group; it is a placement change to a shipping control and should not have to be inferred from a baseline diff.Spacerchange, and the board does not move relative tomain. An earlier revision of this section claimed the board sits 6pt lower. That was wrong, and it is worth spelling out because it is the exact failure this section exists to prevent.git diff main...HEADshows no netSpacerchange:mainhas exactly oneSpacer(minLength: 0), in the Mac rail (statusBar / modeToggle / Spacer), and so does this PR (statusBar / controlCluster / Spacer) — the intermediate commit01c69654briefly had two, because this PR's own cluster extraction added one to the compact stack, and round 1's review removed it again in7d303e46. The 6.0pt figure and its 12 ÷ 2 arithmetic were real but describe a delta between two intermediate commits of this PR, not anything a user or a future reader would ever see. The MS iPhone baseline changes in this PR are attributable to full-bleed and the cluster, not to a stack-gap shift.Measured, not asserted
Cell sides, measured from the recorded baselines at §3.4's three breakpoints:
393 and 430 are exactly full-bleed and land above the table, because §3.4's figures are
(W − 4) / 9— 附錄 B's "扣除外框" deducts a 4pt outer frame this board does not have (only 0.5pt per-cell hairlines). On a real iPhone 17 Pro the cell PITCH measures 43.61pt — above §3.4's 43.2 and just under the HIG 44pt default, exactly as §3.4's ruling anticipates. (An earlier revision of this body said 44.17pt "clearing HIG 44". That was wrong: 44.17 is the frame widthidb ui describe-allreports per cell, and those hit rects overlap the pitch by ~0.55pt. The §7 anchor test now pins the honest number.)This is a corrected measurement, not a new failure. §3.4's table never claimed the 393-class clears 44 — its own rows read
iPhone 15/17 Pro 393pt … 仍未達,差距 3.9→0.8ptandiPhone Pro Max 430pt … 首次跨過. 43.61pt landing just under the HIG default is exactly what the design predicted; the 44.17pt figure had in fact contradicted the design table.Also measured, and worth stating plainly: on a real 402pt device the board spans 392.5pt, not 402 — a 4.75pt gap each side. The layout applies no horizontal inset (that is what this PR removed), but with real safe areas the square is still bound by HEIGHT by ~9.5pt, so it stops short of the edges. "Full-bleed" describes the layout rule, not a guarantee that every device renders edge-to-edge.
320 is not full-bleed: header + cluster + margins leave ~235pt of vertical room, so the square is bound by HEIGHT and removing the horizontal inset buys nothing there. 26.1pt is under the 28pt absolute floor §3.4 itself cites. This is a long-standing table error rather than a regression — the pre-3.0 "現況 32.0pt" figure assumed the same width-binding that never held on that device. §3.4 is corrected in this PR; the actual fix (a shorter cluster variant for short screens) is #1055.
Acceptance evidence
BoardControlClusterLayoutTests, 6 tests. Sweeps the three breakpoint widths against cluster heights from a lone edit row up past anything the.xLargeDynamic Type cap can render, asserting no glass group's rect intersects any cell rect. Also pins: the two groups are disjoint bands; a single-group cluster reports one group and not an empty second one; MS's 16×16 / 16×30 boards obey the rule; a taller cluster shrinks the BOARD rather than encroaching, with the board clamped at zero so a flipped rect cannot sneak pastintersects. Nothing samples the eight IC × RT × RM combinations —bands(...)takes no accessibility input, because those switches change how glass is painted and painting is not layout.rg "glassEffect|GlassEffectContainer|buttonStyle\(\.glass"over the four cluster sources returns twoGlassEffectContainerhits, both inBoardControlCluster, neither carrying.glassEffect; every other hit is.buttonStyle(.glass)/.glassProminenton an individual button.Evidence provenance for the Minesweeper rows: they were captured at
a18d4ada, which sits between this PR's own addition of a compact-stackSpacer(01c69654) and its removal (7d303e46). So they were measured with that extra stack gap present, and at the final head the same board sits 6pt lower — clearance ~125pt rather than the 131pt shown. That is a difference between my evidence and the final head, NOT a change versusmain, where the compact stack is unchanged (see behaviour changes above). The delta is a pure vertical translation of a same-sized board, so the control and label counts cannot move; not re-run, because arithmetic settles it.iPad regular re-verified independently: 14 controls, 0 empty labels, 0 during pause, 0 during completion.
Board|DigitPad|Snapshot|Cluster126/126. (SudokuKit's full suite is not runnable locally — the documented segfault near theToastController/SettingsViewNSWindow tests — so it runs in filtered batches here and in full on CI.)swiftlint --strictclean on every file this PR touches; three pre-existing violations elsewhere inSudokuCoreKit/AppMonetizationKitare untouched and out of scope, and CI lints changed files only.Review round 1 — what it found, and what it changed
Both reviewers found real defects. The two blockers are worth reading even if you skip the rest, because each one is a class rather than an instance.
A baseline was committed completely blank — zero opaque pixels — and every gate stayed green.
swift testcompares a blank capture to a blank reference and finds them identical; the drift gate only fires on change; the orphan gate only proves a recording test exists. Root cause isolated with a throwaway probe, and it is narrower and broader than first suspected: it is not.glassProminentand notGlassEffectContainer, it is tint. Opaque-pixel counts through this capture path on a 300×200 ground:.buttonStyle(.glass), untinted.buttonStyle(.glassProminent).buttonStyle(.glass)+.tint.glassEffect(.regular.tint(_)).glassEffect(.regular.tint(_).interactive())Any tinted glass blanks the whole image, background included.
SnapshotBlankBaselineGuardTestsnow walks every committed baseline in both apps and fails on any with no opaque pixels — content-agnostic, and it would have caught this immediately. The affected fixture was split by what this renderer can capture: theisSameDigitcell tint stays a pixel test (onBoardCellViewdirectly, with an untinted control cell beside it — the pair differ in 98% of pixels, so the assertion can actually fail), while the armed key's own highlight is simulator-verified.Five baselines were silently stale, and the tolerance that hid them is looser than anyone thought.
.tolerantImageis.image(precision: 0.95, perceptualPrecision: 0.95). The perceptual term means a pixel counts as matching when its delta is small — and these boards are a low-contrast cream/white/light-grey palette, so a large change decomposes into very many very small deltas. A visibly different design passes. Three Minesweeper baselines (0.41% / 1.07% / 1.07%, all the mode-toggle chip) and two Sudoku ones (35.91% / 17.12%, still showing the 16pt inset and.borderedkeys) were carrying the old design. All five re-recorded here. The corollary is the uncomfortable one: under a tolerant comparator, a green suite says nothing about whether a baseline matches the code — staleness can only be established by re-recording and diffing, and only from a full-suite run (a filtered subset changes the execution set for order-dependent fixtures). Class tracked as #1057. Note also thatmac/minesweeper/03-boarddid NOT move despite its baseline drifting, because the drifted region sits outside the marketing crop — so the drift gate is not a proxy for baseline correctness either.Strict cluster-only snapshots now exist for both apps: the cluster is where silent drift happened, and rendering it alone gets strict comparison there without making the antialiasing-heavy board tests strict and flaky.
The §7 suite was self-consistent algebra and is now anchored to reality.
boardSideand the board band were the same quantity restated, so the non-overlap assertion could not fail. It now checks the model against real frames read off a running app, which immediately earned its keep: without safe-area terms the model predicted a 402pt board where the device renders 392.5pt. With them the cluster's top matches the measured 539.0 exactly and the board lands within 4.5pt. That anchor is also what caught the 44.17 → 43.61 correction above.Accessibility sweep (§7's second obligation). Increase Contrast and Reduce Transparency, driven on the simulator:
Geometry is byte-identical across all three. §7's "幾何不隨開關改變" was an argument before this PR; it is now measured. Both degraded states remain readable, so no IC colour variants are needed.
One acceptance row is WAIVED, explicitly rather than quietly dropped: a Sudoku simulator row with a live ad banner. Attempted via
-uitest-fake-ad-gate-repoll, which by design only opens the gate after a genuine background→foreground cycle.simctlcannot produce one — launching another app and relaunching restarts the process, which either drops the near-win flag or lands on the ATT primer instead of the board. I got as far as a board with the gate flag set and identical geometry (8.75pt clearance), but with no banner rendered, so the row is not claimed. Not obtainable with the available tooling; snapshot coverage stands in:snapshotAdsEnabledUnloadedSlot_*exercises banner × cluster in both apps, and Sudoku's light variant was one of the five stale baselines found here, so it is current and genuinely exercising the new layout rather than the old one.Two things this PR does not fix, and one it deliberately leaves ugly
Snapshot baselines are re-recorded showing bare glyphs, and that is not "the controls disappeared". This repo's
NSHostingView+cacheDisplaycapture path renders standard materials and.borderedcorrectly but draws Liquid Glass as nothing — measured through both that path andImageRendereron identical views. Neither renderer is faithful (ImageRenderer draws glass as a flat opaque fill and shifts material colours), so no second snapshot helper was added; two capture paths with different colour fidelity would become two competing truths in the suite. The glass is proven structurally by the geometry suite and visually on the simulator.The ASC
03-boardmarketing frames are committed knowingly wrong (docs/app-store/screenshots-ascspec/, 28 files). They inherit the same blind spot and now show a board with surface-less controls under the headline "Notes the way you write them." Regenerating them is the drift gate's prescribed fix and the safer option: a stale frame depicting a design the app no longer has is the #1051 orphaned-baseline failure mode — it looks fine, so nobody investigates. #1054 holds this as a pre-submission blocker. The gate'sframe-drift-verifiedhatch was deliberately NOT used: it attests that a baseline change does not alter any ASC frame, and this one demonstrably does.G3 → G2 is deferred to #1053. The iPhone board is a
fullScreenCoverwith no NavigationStack (GameRoot.swift), so.toolbardraws nothing; adding one changesBoardView's frame such that the in-place iOS pause overlay stops covering the toolbar — the exact #763 guarantee #1019/#1038 paid to restore. §4.1's inventory is marked ⏳ rather than left reading as done.Also in here
BoardView.swiftandDigitPadView.swiftboth crossed SwiftLint's 400-line ceiling, soBoardView+Layout.swiftandDigitPadView+Mac.swiftsplit off per repo convention..mise.tomlwas untrusted in this worktree, so lefthook'sgitleaks/hygiene/swiftlintpre-commit hooks were all erroring out while commits still succeeded — they fail open.mise trustfixes it; worth knowing on any fresh worktree.#1022's body now carries explicit deferral annotations for the four items this PR does not deliver (G3→G2 → #1053; the "snapshot tests confirm two glass groups" acceptance line → superseded by structural + simulator evidence, #1054/#1057; macOS idb → #1039; SE cell size → #1055), so the close is honest rather than silent.
closes #1022
part of #1014
🤖 Generated with Claude Code