Repository navigation
fix(board): let the iPad regular-width Sudoku board fill its column through the shared RegularBoardContainer seam - #1115
Conversation
T6 acceptance (fresh context)驗收員:fresh-context subagent(隔離 worktree,與 session/sudoku-ipad-board-1105 其他 worktree 完全不共用磁碟)。 跑過並通過的檢查:1, 2, 3, 4, 5(含突變), 6(含 build-ascspec 重現), 7, 8, 10 1. 共用 seam,一份實作 — PASS各一處,都在 2. Minesweeper 行為不變(blob 等同) — PASS
3. Mac 與 iPhone 基準不動 — PASS
4 個全含 4. capped 路徑逐字不變 — PASS
5. 平台預設被釘住且可變紅(重工作,實跑) — PASS綠批: 無 skipped;逐一確認四支新增/相關測試都出現在 started/passed 清單裡: 突變( 如預期變紅(連帶其餘 4 個 Mac snapshot 也紅,屬合理副作用,因為突變改的是全平台預設值)。已 6. frame 與基準一致 — PASS(三部分全跑)a) b) PR 無 label( 隨後 7. frame 用眼睛判 — PASS裁 en、ja 的
8. PR 不會誤關別的 issue — PASS
全部存在,無虛構編號。 9. 明說「這個 PR 不改變什麼」 — 部分 PASS / 部分無法驗證可機械驗證、已驗證的「不變」:
10. diff 範圍內 TODO/FIXME/stub/placeholder — PASS(無命中,無需比對)零輸出,無需對照 PR body 交代。 總判定:ACCEPT條件 1–8、10 全數機械驗證 PASS(含兩項重工作:SudokuKit 篩選批次綠 + 平台預設突變正確變紅且已復原;build-ascspec 168/168 重現 docs/ 內容逐 byte 相同)。條件 9 的裝置即時量測數字本次未重新量測(時間預算優先序排在重工作 5、6 之後,且量測需要互動式模擬器操作,不在 30 分鐘機時內可完成的範圍),這是驗收覆蓋的已知缺口,非 FAIL——與之矛盾的機械證據一項也沒有,且 PR body 本身已明確區分「量測」與「未實作」兩類數字。建議:若要完全閉環,另排一次 XCUITest 量測覆核(可在合併後或下一個驗收週期補跑,不阻塞本次合併)。 |
Code review (independent) — APPROVE-WITH-NITSScope: head Diff reviewThe seam move is clean.
The ruling-B divergence from Minesweeper's Test placement is sound: the platform-default/un-injected-default pins moved to The landscape pin's own comment states why it is the only baseline where the Nits
No correctness, concurrency, or consistency issues found. Swift 6 strict-concurrency shape ( Mutation evidence (independently re-run, warm
|
…games share the seam The #1101 regular-width board-container seam (`RegularBoardContainer` + `\.regularBoardContainer`) lived in MinesweeperUI. Sudoku has the identical Mac-detail-pane cap defect on iPad (960/640), and the mirror principle says one shared implementation, so the type moves verbatim into the zero-dependency GameShellUI target; MinesweeperUI already `public import GameShellUI` and keeps reading it unchanged. The platform-default pins move to GameShellUITests; the MS-specific `fittedAlignment` mapping test stays in MinesweeperUITests. Minesweeper is provably untouched: the iPad and regularCapped board baselines are the same git blobs before and after (37eb623 / 678fe53), and the full MinesweeperKit suite passes (424 tests in 72 suites). part of #1105 Co-Authored-By: Claude Fable 5.1 <[email protected]>
…nstead of inheriting the Mac caps Sudoku `BoardView.macLayout` is selected by `horizontalSizeClass == .regular`, so iPad inherited the Mac detail-pane caps (outer 960 pt centred, board 640 pt square). Measured on an iPad Pro 11-inch (M5) simulator: landscape held the board at 640 pt in a column that allows ~686 and centred the layout with 125 pt of dead margin per side; portrait floated the whole stack vertically centred (261 pt above the header, 326 below the board). The layout now reads the shared `\.regularBoardContainer` seam (GameShellUI): - `.cappedDetailPane` (macOS default): every modifier argument-for-argument as before — 960 / 640 caps, centred stack. Mac baselines are the same blobs. - `.fillsColumn` (iOS default): both caps lift to `.infinity`, and the board frame aligns `.topLeading`, so the fitted square sits flush under the header at the column leading edge with leftover height below it (PM ruling, same shape as #1101 for Minesweeper). The three mappings are pure static funcs pinned by `BoardViewRegularContainerTests`. Tests: the two iPad board snapshots inject `.fillsColumn` and are re-recorded (rendered vs rendered: board 640 → 684 pt at 1032×1376, top-left instead of centred). `snapshotPencilNotesWithError_regularCapped_light` (macOS-only, un-injected) keeps the pre-#1105 iPad PNG byte-for-byte (blob 8e82576) and passes without re-recording; flipping `platformDefault` macOS branch turns it red. `emit_iPad_board` injects `.fillsColumn` like Minesweeper. Mutating the fillsColumn alignment to `.center` turns both iPad snapshots and the unit test red. iPhone + Mac board baselines unchanged (same blobs). part of #1105 Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ills-column board The ipad-13 03-board slot is still snapshot-sourced (its live capture is deferred to #1110), so the re-recorded Board-iPad-light-pencilNotesWithError baseline changes the composited frame. `mise run store:screenshots build-ascspec`: 168 slots, 0 failures; exactly these 7 frames changed, every other frame byte-identical. part of #1105 Co-Authored-By: Claude Fable 5.1 <[email protected]>
…M ruling B) and pin landscape Ruling B on #1105 (contact point 2, 2026-10-28): the first cut aligned the fills-column board `.topLeading`, and the regenerated ipad-13 03-board frame got worse — the fixed-fraction callout chip landed on grid rows 3–4 and the leader dot left the red cell, with no free band for the chip that would not need a line across the whole grid. #1101 top-aligned Minesweeper because its frame improved; Sudoku keeps today's centred block because its frame says so. Under `.fillsColumn` only the 640 pt WIDTH cap lifts; the height cap stays `nil`, so the board frame hugs the fitted square instead of going greedy and the header / board / rail stack centres as one block in portrait exactly as before (lifting both caps pinned the header and rail to the top and floated the board alone — pinned red by mutation M3). `.leading` keeps the board flush under the header title in landscape, where the square is height-bound. Tests: the three mappings (outer width, board max width, board max height, alignment) are pinned by `BoardViewRegularContainerTests`; new landscape baseline `snapshotPencilNotesWithError_iPadLandscape_light` (1376×1032, `.fillsColumn`, board 941 pt height-bound at x = 32) — the only baseline where leading-vs-centre is visible, red under the alignment mutation while the portrait baselines stay green. Portrait iPad baselines re-recorded (board 684 pt, block centred). `_regularCapped_` PNG still blob 8e82576; Mac + iPhone board baselines unchanged. part of #1105 Co-Authored-By: Claude Fable 5.1 <[email protected]>
…nerate the frames The re-recorded Board-iPad-light-pencilNotesWithError baseline (board 684 pt, block centred) moves the red error cell and the floating header: anchor re-measured from the reddish-pixel bbox (0.207, 0.315) → (0.214, 0.301), chip raised (0.360, 0.210) → (0.360, 0.165) so it sits in the empty band above the header instead of level with the header row. `mise run store:screenshots build-ascspec`: 168 slots, 0 failures; exactly the 7 sudoku/ipad-13/*/03-board frames changed; `scan:store_frame_drift` PASS without the label. part of #1105 Co-Authored-By: Claude Fable 5.1 <[email protected]>
4973612 to
3c9c4bb
Compare
|
PM merge record, head What changes. On iPad, Sudoku's regular-width board stopped inheriting the Mac detail-pane caps. Measured on the simulator, pixel-verified: landscape board 640.5 → 690.4 (cells 71.2 → 76.7), the 125 pt dead margin on each side is gone, and the board sits flush under the header with the rail at the trailing edge. Portrait is deliberately unchanged in size and position. Ruling B, and why it differs from #1101. #1101 top-aligned a width-bound Minesweeper board. Applying that here put the "Catches mistakes instantly" chip on top of the grid's rows 3–4 with its leader dot on an empty cell — the shipped The shared seam moved, and Minesweeper is provably untouched: macOS keeps 960 / 640, argument-for-argument: 7 Mac plus 1 iPhone baseline unchanged as blobs, and the un-injected Mutations, run by the reviewers rather than the author: Frames: the 7 Not covered: the device numbers were measured by the author, not re-measured by the reviewers; the Mac XCUITest control was blocked by the macOS Automation prompt and is stated as blocked, not skipped. The portrait proposal (P0 ships, P1 recommended with its banner caveat) is in the PR body for the owner. |
Closes #1105
part of #1014
What
Sudoku's regular-width board layout (
BoardView.macLayout, selected byhorizontalSizeClass == .regular) was written for the Mac detail pane — outer column capped at 960 pt and centred, board capped to a 640 pt square (docs/designs/05-board.md §b, locked 2026-05-30). iPad is also.regular, so it inherited both caps. Measured on an iPad Pro 11-inch (M5) simulator before any change: landscape held the board at 640 pt in a column that allows ~740 and centred the whole layout with 125 pt of dead margin per side; portrait is width-bound (486 pt board) whatever the cap says.RegularBoardContainer+\.regularBoardContainer(fix(board): Minesweeper regular-width board viewport is capped to a 600 pt square and leaves the iPad board column empty in both orientations #1101) moved verbatim fromMinesweeperUIinto the zero-dependencyGameShellUI;MinesweeperUIkeeps reading it through its existingpublic import GameShellUI. The platform-default pins moved toGameShellUITests; MS keeps itsfittedAlignmenttest..cappedDetailPane(macOS default) every modifier is argument-for-argument what it was (960 / 640 / centred). Under.fillsColumn(iOS default) the outer 960 cap and the board's 640 width cap lift to.infinity, the board's height cap staysnil(the frame hugs the fitted square), and the board frame aligns.leading: landscape becomes height-bound (board ≈ 740 pt on an 11-inch iPad, flush under the header title at x = 32, digit rail at the trailing edge, no dead side margin); portrait keeps its 486 pt board and the header/board/rail block stays vertically centred. The four mappings are pure static funcs pinned byBoardViewRegularContainerTests.ipad-1303-boardslot is still snapshot-sourced (chore(store): measure and publish the tolerant iPad 03-board captures (sim-bound remainder of #1054) #1110), so its 7 locale frames regenerate from the re-recorded baseline; theipad-13callout anchor and chip are re-measured.Ruling: why Sudoku's
.fillsColumnis.leading, not.toplike Minesweeper#1101 top-aligned Minesweeper's width-bound Beginner board because its iPad store frame improved. Here the first cut did the same (
.topLeading, 8c20dcaf) and the regenerated Sudokuipad-13frame got worse: the fixed-fraction "Catches mistakes instantly" chip landed on grid rows 3–4 and the leader dot left the red cell, and the only free band for the chip would have needed a leader line across the whole grid. The PM ruled (contact point 2, 2026-10-28): the frame decides — Sudoku keeps the centre vertically. This is a ruling, not an inconsistency; change it only with a new frame in hand.Measured (iPad Pro 11-inch (M5), iOS 26.5,
-uitest-route board:showcase; grid = union of the 81 cell frames from the XCUITest a11y tree, pixel-verified against the screenshot)Mac control: the real macOS XCUITest run was blocked three times by the macOS Automation permission prompt ("Timed out while enabling automation mode", nobody at the machine) — not skipped. Substitutes: the committed 900×600 Mac baseline (board 509 pt, neither cap binds at that size) and the macOS-only, un-injected
snapshotPencilNotesWithError_regularCapped_lightat 1032×1376, which renders the Mac rule at the iPad size and keeps the pre-#1105 iPad PNG byte-for-byte (blob8e825767).iPhone and macOS did not move (mechanical proof)
Test run with 424 tests in 72 suites passed(fix(board): Minesweeper regular-width board viewport is capped to a 600 pt square and leaves the iPad board column empty in both orientations #1101 cited 416/71; the delta is main's intervening PRs, this branch's net is −2 tests moved to GameShellUITests). MS iPad PNG blob37eb623dand MS regularCapped PNG blob678fe533:git rev-parse HEAD:path == git hash-object pathbefore and after the move.git diff --stat 383b0886..HEAD -- Packages/MinesweeperKit/Teststouches onlyRegularBoardContainerTests.swift(no PNG).--filter RegularBoardContainer: 2 tests pass; flippingplatformDefault's#elsebranch to.fillsColumnturns it red (M2) and also turnssnapshotPencilNotesWithError_regularCapped_lightred — that test is macOS-only and un-injected on purpose, so the un-injected default resolving to the Mac rule is pinned by a pixel baseline, not only by the unit test.BoardViewTests|BoardViewPencilNotesTests|BoardViewRegularContainerTests28 tests / 3 suites passed;Board|Completion|Banner|Digit|Pause174 / 46 passed;HomeView|TodayTab|DailyHub|PracticeHub|Progress|Toast|Resume149 / 29 passed;SettingsViewTests15 andSettingsViewAppStoreRowsTests4 passed alone (SettingsViewWindowSnapshotTestsskipped, test(macos27): SettingsViewWindowSnapshotTests crashes swiftpm-testing-helper (SIGSEGV in objc_release) when run alone #1103 crash; the full SudokuKit suite is a known local segfault, so filters are the verification).git diff --stat 383b0886..HEADlists no*Mac*or*iPhone*PNG under SudokuUITests; the 7 Mac board baselines + the iPhone in-progress baseline hash-match HEAD on disk after every run.regularBoardAlignment.fillsColumn → .centerturns the unit test and the new landscape baseline red while both portrait iPad baselines stay green (at 1032×1376 the column width equals the board width, so a horizontal flip changes no portrait pixel — hence the landscape pin);regularBoardMaxHeight.fillsColumn → .infinity(the greedy-frame bug of the first ruling-B cut) turns both portrait baselines + the unit test red. Round 1's stack-level top-pin was caught the same way: its mutation changed no pixel.iPad baselines (rendered vs rendered, base 383b088 → head)
Board-iPad-light-inProgress(1032×1376)fedcfb2c5d200ce8Board-iPad-light-pencilNotesWithError(1032×1376, feeds the ipad-13 03-board slot)8e82576788ca8eb8Board-iPadLandscape-light-pencilNotesWithError(1376×1032, new)1ce9fde0Board-Regular-light-pencilNotesWithError-cappedDetailPane(1032×1376, macOS-only, un-injected)8e825767git mv; passes without re-record = the Mac rule renders pixel-identically at the iPad sizeStore frames
mise run store:screenshots build-ascspec: 168 slots, 0 failures, exactly the 7sudoku/ipad-13/*/03-board.pngframes changed (every other frame byte-identical). The ipad-13 callout for this slot is snapshot-sourced (#1110) and placed by fixed fractions, so it was re-measured: anchor (0.207, 0.315) → (0.214, 0.301) (reddish-pixel bbox of the new baseline's red cell), chip (0.360, 0.210) → (0.360, 0.165) (the 684 board floats the header ~22 pt higher; at 0.210 the chip sat level with the header row).mise run scan:store_frame_drift→PASSwithout theframe-drift-verifiedlabel. Before/after (en):evidence-1105/ipad13-03-board-before-after-en.png— base left (640 board, card cut at the frame's bottom edge), head right (684 board, whole card visible, dot on the red 4, chip in the band above the header). The frame stays #1054-affected (Liquid Glass digit keys invisible to the snapshot renderer).iPad portrait — measured numbers and options (not implemented; owner's ruling)
Measured on iPad Pro 11-inch (M5), 834×1210 pt (
-uitest-route board:showcase, a11y grid pixel-verified):.fillsColumn, ruling B)A square board cannot grow in a 486-pt-wide column however tall it is; every option that enlarges the portrait board has to take width back from the 260 pt side rail.
P0 — accept the split blank (what this PR ships, PM ruling B). Board 486 / cell 54, block centred. Cost 0; the shipped ipad-13 frame keeps its composition (see Ruling above).
P1 — route iPad portrait to the stacked arrangement (board above the shared G4 control cluster), keeping the regular 32 pt margins. Board = 834 − 64 = 770 (cell 85.6, +58%). Height budget from the iPhone control: status bar 24 + header 44 + 16 + board 770 + 16 + cluster 285 (Undo/Redo/Notes/Erase row 58 + 3×3 digit grid 226 at iPhone sizes) + 16 bottom + home 20 ≈ 1191 of 1210 — it fits with ~19 pt to spare, so with an ad banner (≥50 pt) the compact fit logic shrinks the board to ≈720 (cell 80). Needs an orientation/width seam in
BoardView.body(today the only selector ishorizontalSizeClass == .regular), and a design pass on the G4 cluster at 770 wide (its cell table in design.md §3.4 is three iPhone widths). Landscape keeps the two-column layout from this PR.P2 — keep the two-column layout but narrow the rail in portrait (e.g. a 2-column digit grid at 88-pt keys = 184 + gap 24): board = 770 − 24 − 184 = 562 (cell 62.4, +16%), blank below ≈ 520 pt. Small gain, still a mostly-empty column, and a third digit-pad arrangement to maintain.
Recommendation: P1. It is the only option that uses the portrait height (board +58%), it reuses the existing compact layout and the shared control cluster instead of adding a third arrangement, and Minesweeper would get the same routing for free through the mirror principle. The banner caveat (≈720 with an ad) and the G4-at-770-wide design question are the two things the owner has to accept before anyone builds it. P0 is what ships here; P1/P2 are not implemented.
Evidence
Local, durable (not committed):
/Users/zw/GitHub/Wei18/evidence-1105/—base-ipad/,base-iphone/,base-mac/,head-ipad/(probe logs,*.jsonparsed frames,*.png),head-renders/,head-snapshots/,base-frames/,head-frames/,tools/,Probe1105.swift.archive(throwaway XCUITest probe, never committed).Review
Code Reviewer mandatory (shared UI code, > 50 LOC): two independent reviews + fresh-context T6 acceptance posted as PR comments. PM merges; no auto-merge.
🤖 Generated with Claude Code