Repository navigation
feat(store): direction C+B marketing screenshot redesign - #976
Merged
Merged
Conversation
Replaces the caption-panel-over-flat-tint + centered-bezel marketing frame with Direction C (full-bleed brand-gradient ground in each app's own theme accent, headline/subhead set directly into the gradient, device screenshot bleeding off the bottom edge, small app-icon badge) on Home/Daily/Settings, layered with Direction B (one feature-callout chip + leader line, authored in screen-fraction coordinates, reused across locales) on Board/Completion. Wires every slot to a per-locale baseline (en uses the existing baseline; zh-Hant/zh-Hans/ja/ko/es/th come from new *Localized snapshot tests) so the compositor can hang a locale-correct caption on each frame, and documents a known limitation this surfaced: SwiftUI's Text(LocalizedStringKey) resolves against Bundle.main, not .environment(\.locale), so the underlying app screenshot itself never localizes inside a headless swift test host — every locale's raw baseline is pixel-identical to en. Only the composited caption overlay is genuinely translated. Pre-existing gap (3 prior locale baselines already showed this), not a regression, but now documented precisely rather than understated. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Adds *Localized parameterized @test(arguments: SnapshotLocales.storeLocales) snapshot tests to HomeView/DailyHubView/BoardView/CompletionView/ SettingsView (Sudoku) and the MS equivalents, reusing the existing hostingView(locale:) injection — no new capture mechanism. Extracts SnapshotLocales (shared zh-Hant/zh-Hans/ja/ko/es/th list) so every suite draws from one place. BoardViewTests.swift and SettingsViewTests.swift crossed SwiftLint's 400-line file_length ceiling once the new tests landed; split the two new BoardView locale tests into BoardViewLocalizedTests.swift (an extension on the same @suite struct — swift-testing picks up @test funcs from extensions in any file of the same target) and trimmed SettingsViewTests.swift's pre-existing multi-line comments to single lines (line_length ignores comments per .swiftlint.yml, so this is free). Verified: swift test --package-path Packages/SudokuKit and --package-path Packages/MinesweeperKit both pass in full (SudokuKit's SudokuUITests target segfaults when run as a single 380-test process — a known local-only AppKit NSWindow-accumulation issue, see sudokukit-full-suite-segfault-local memory note — so it was run in 12 batches of ~30 tests each; all batches green, 466 SudokuKit tests / 380 MinesweeperKit tests total). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
108 new baselines (60 Sudoku + 48 MS) recorded by the *Localized tests added in the prior commit, via the suites' existing SnapshotMode.recordMode = .missing (auto-records only when a baseline file is absent). No existing baseline changed — every pre-existing PNG in these __Snapshots__ trees is untouched; this commit is additive only. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Regenerates all 126 slots (2 apps x 2 devices x 7 locales, minus MS having no Settings slot) from the final generator + baseline state via `mise run store:screenshots build-ascspec`, so the committed PNGs match the committed code and baselines from the prior three commits. Verified independently of the generator's own self-check: a Pillow sweep over all 126 output PNGs confirms exact ASC pixel dimensions (1290x2796 iphone-6.9, 2064x2752 ipad-13), RGB mode, no alpha channel. Spot-checked ja/ko/zh-Hans/zh-Hant/th frames for correct script rendering (no tofu) and es for accented characters — all correct. Thumbnail legibility (~300px wide) verified on representative Home/Board/Completion frames in both apps: headlines, subheads, and Direction B callout chips all stay readable at storefront-thumbnail scale; no slot needed its chip dropped. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Byte-for-byte comparison showed all 108 *Localized baselines added in 7dc9ed4/2097aea were pixel-identical to their `en` counterpart, for every slot, in both apps — SwiftUI's Text(LocalizedStringKey) resolves against Bundle.main, not .environment(\.locale, ...), so a headless `swift test` host (no compiled .lproj in Bundle.main) can never localize the underlying screenshot content. Landing 108 files that look like localized coverage while providing none would repeat the exact failure mode docs/app-store/screenshots/README.md already warns about for a prior, unrelated instance of byte-identical "placeholder" screenshots. Backs BoardViewTests.swift, SettingsViewTests.swift, CompletionViewTests.swift, DailyHubViewTests.swift, HomeViewTests.swift, the 4 MinesweeperUITests snapshot files, and MinesweeperUITests/SnapshotConfig.swift out to their origin/main shape (verified: zero diff against origin/main after this commit). Deletes BoardViewLocalizedTests.swift and SnapshotLocales.swift — they existed only to host the now-removed tests; BoardViewTests.swift reverts to its original 400-line shape with no split needed. Removes all 108 baseline PNGs. The 3 pre-existing locale baselines in BoardViewTests (ja/ko/zhTW, predating this branch) are untouched, as are the 12 orphaned baseline PNGs already cleaned up in an earlier commit. Root cause, evidence, and two real fix paths (Bundle injection at Text call sites vs. capturing from the Simulator where Bundle.main genuinely carries .lproj resources) are filed as #977. Re-verified after this revert: swift test --package-path Packages/SudokuKit (456 tests, batched per the documented local segfault workaround) and --package-path Packages/MinesweeperKit (372 tests, single process) both green; swiftlint --strict reports 0 diff-relevant violations (no Swift files differ from origin/main after this commit). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Companion to the prior revert commit: Slot.baseline() no longer takes a locale argument or looks up a *_localized-prefixed file — it always resolves the one baseline recorded per slot, matching pre-redesign behavior (every locale composites its translated caption over the same underlying screenshot). Drops the now-unused localized_prefix field and the 12 now-stale localized_prefix arguments across the SLOTS table. Updates the module docstring and the strategy doc's "Localized UI" section to stop describing a per-locale-baseline mechanism that no longer exists in this PR, and points at #977 for the root cause + real fix paths instead. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Two visual defects found by manual review of the actual output (not just
thumbnails), both now fixed and re-verified:
1. Direction C's panel bled the FULL baseline screenshot to the canvas
edge, so a scrolled list's own empty tail bled too — Home/Daily/Settings
showed 40-60% flat cream space inside the panel, worse than the
pre-redesign layout it replaced. Fix: crop the baseline to its
content-bearing region (new detect_content_bottom(), alpha+color-aware
so it handles both a full opaque device screenshot and a floating
hero-reveal card) before compositing, at the existing width-fill scale.
The panel is now exactly as tall as its real content; slots whose
content already reaches deep (Board's digit pad, ~92%) still bleed past
the canvas edge same as before, nothing forces it for shorter slots.
An earlier version of this fix also over-zoomed short slots to force
bleed on every slot, then center-cropped the overflow back to screen_w.
That regressed worse than the bug: MS iPad's covered board (grid+panel
only 44% tall) needed enough zoom to outgrow the width too, and the
crop-back clipped the "Reveal" button off the canvas edge — hiding real
product UI, the same failure class as defect 2 below. Reverted to the
simpler width-only scale; a shorter panel with the brand gradient
showing below it (not cream, not a clipped button) meets the actual bar
("no flat area with nothing in it") without that risk.
2. Direction B's callout chip always dropped straight below its anchor
dot. On Sudoku Board (both devices) that landed the chip on live grid
cells (row2's "9"/"8"), and on MS iPad it landed on the covered grid
tiles — a marketing shot hiding the thing it advertises. Fix:
draw_callout_chip gains an optional chip_xy target, independent of the
anchor position, with the leader line drawn straight from anchor to
chip instead of assuming "chip sits below the dot"; CALLOUTS gains a
matching chip_at per (slot, device) that needed it. All three targets
were measured directly off the baseline's own pixel geometry (grid
bounding box, header-row text extent, button bottom edge — not
guessed), and each was re-verified against the actual rendered output,
not just computed: the first two attempts at each target were wrong
(margin-clamp interaction pushed the Sudoku chip back onto the cells it
was meant to avoid; the Y target for iPad didn't account for the chip's
own height and its bottom edge dipped into the grid) — third attempt
confirmed clean via full-resolution crops of the actual PNGs.
Re-verified after every change: full 126-PNG dims/RGB/no-alpha sweep
(clean), full-resolution visual check of every touched slot (Home/Daily/
Settings/Board on both devices, both apps, plus Completion and MS Home to
confirm no side effects), and a ~300px thumbnail legibility pass on the
moved chips — all read clean, no chip needed dropping.
Also noted, not fixed (out of scope — production app-code bug, not a
generator issue): the MS iPad Board baseline shows "leave.game.leave" as
a raw, unlocalized string-catalog key in the header instead of translated
text. Flagging for a separate issue.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
- ja/th Daily Hub subhead now matches the shipped Easy/Medium/Hard strings (Localizable.xcstrings): ja やさしい・ふつう・むずかしい, th ปานกลาง for Medium instead of the shortened กลาง. - Audited every slot's baseline fixture against its snapshot-suite siblings for a fuller, still-honest state: Sudoku Daily Hub (iPhone) and Minesweeper Daily Hub (iPhone) swap to their streak/all-done fixtures; Minesweeper Completion (iPhone) swaps to the daily-reminder fixture. Board/Completion fixtures with a message-relevant reason to stay (Sudoku Board's error-highlight demo) were left alone; iPad and Home slots had no honest fuller candidate and are documented as such. - The Completion fixture swap moved MS iPhone's Direction-B callout anchor onto the new reminder row's text; re-measured and fixed. - Re-verifying every locale (not just en) found MS iPad Board's callout chip overlapping the grid for ja/es/th — those labels are wider than the available column space that only en's shorter label fit by accident. draw_callout_chip() gained an optional max_width that wraps onto a second line (word-split, with a character-split fallback for CJK/Thai's space-free scripts). Full 126-PNG regen verified: dims/RGB/no-alpha sweep green, full-res + thumbnail visual pass on every changed slot, no tofu, no grid overlap. Part of #976. Closes #967. Co-Authored-By: Claude Sonnet 5 <[email protected]>
- MS iPhone Board: swap `beginner-covered` (untouched, all-grey grid) to `beginner-flagged` from a sibling suite (MinesweeperBoardRevealedSnapshotTests) round 1's per-slot-suite-only search missed. `flagged` is `midReveal`'s revealed number cells plus three placed flags, matching both verbs in "Flag, reveal, solve." in one frame. Re-verified the iPhone callout (no grid to overlap, header-chrome anchor unaffected) across all 7 locales. - Corrected every "#979" citation in the script and strategy doc describing this pipeline's own chip-overlap/crop history — #979 is an unrelated macOS snapshot-baselines PR. Dropped the invented reference rather than leave a pointer that sends the next reader somewhere wrong. - Added the chip_max_w lesson directly in the CALLOUTS comment: any `chip_at` callout needs a chip_max_w sanity check as a matter of course, not just the slot someone happens to touch that round. - Documented (not applied) two round-2 findings that trade fullness against something already reviewed/shipped rather than against pure emptiness: Sudoku Board's `pencilNotes` fixture (real in-grid notes, but no error cell for the existing "catches mistakes instantly" callout to anchor to) and Sudoku Settings' `appStoreRows` fixture (3 more real rows, but only recorded in the unpurchased $2.99 state). Also logged the suites reviewed and rejected (loss states, edge/failure states, unrelated screens) so the next audit doesn't re-walk the same ground. Full 126-PNG regen: dims/RGB/no-alpha green, full-res + thumbnail visual pass on the changed slot across all 7 locales. Part of #976. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…aims
Every existing Board baseline proved only half of Shot 3's copy: `inProgress`
had the red error cell but zero in-grid pencil notes, and `pencilNotes` had
notes but no error cell. Neither fixture could be swapped in without moving
the unproven-claim problem rather than fixing it.
Records `BoardViewPencilNotesTests.snapshotPencilNotesWithError_iPhone_light`
/ `..._iPad_light` — reusing `BoardViewTests.inProgressClues`'s exact
userCells/errorCells/selection/elapsedSeconds (so the existing Direction-B
chip anchor for ("sudoku", "03-board") keeps working unrecalculated) plus
pencil notes added into three cells confirmed empty. Wires it into SLOTS in
place of `BoardViewTests/inProgress` and regenerates all 126 ASC-spec
frames.
Also rules on the two other screenshot-strategy.md open items: Settings
stays on `purchased` (the alternate fixture's only variant shows the stale
$2.99 price — filed #981, not fixed here) and Completion is left as-is
(not enough evidence to tell a real surface from a test double).
Chip-geometry re-verified against the new baseline across all 7 locales x
both device classes (no grid overlap); 126/126 regenerated frames pass the
dims/RGB/no-alpha sweep.
Part of #976.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1. MS iPad Daily still shipped the exact defect this PR exists to fix: the only baseline (`Daily-iPad-light-regular`) has `weekStrip == .unknown` (no streak) AND Expert badged Failed — with `detect_content_bottom()` correctly cropping it, that composited as a ~7%-tall panel sliver over ~75% flat gradient, the worst-emptiness frame in the whole 126-PNG set. Records `MinesweeperDailyHubSnapshotTests.snapshotDaily_iPad_light_streak` (2-day streak, all three difficulties completed, zero isFailed) and wires it into SLOTS in place of the sliver. 2. Thai line-wrap could orphan a combining mark: the character-split fallback iterated code points, and `unicodedata.combining()` returns 0 for most Thai vowel/tone marks (a Unicode quirk — Thai is a visual-order script) even though they're category Mn. Reproduced the reported break (`ปักธงจุดที่สงสัยว่ามีระเบิด` at 360-365px → a line starting with a bare MAI HAN-AKAT) and fixed with a `grapheme_clusters()` helper keyed on `unicodedata.category() in (Mn, Mc, Me)`, applied to both the callout-chip wrap and the headline/subhead wrap (same bug shape, same fix). Re-verified against the exact repro: breaks now land on full clusters. 3. The same wrap function silently discarded any wrapped label past two lines (`lines[:2]`) — a future longer translation would lose text with every automated check green. Now raises with the offending slot/locale/label instead of truncating silently. 4. Dropped a stray `#979` citation at line 568 — #979 is the macOS Home/Daily baselines PR, unrelated to this chip-geometry docstring. The other #979 reference (BoardViewPencilNotesTests.swift:79) was verified correct and left untouched, per the reviewer's finding. Full 126-PNG regen: dims/RGB/no-alpha sweep green; only the 7 MS iPad Daily locale frames changed pixel content (confirms items 2-4 are latent-bug fixes with no effect on already-shipped output). Full-res + thumbnail pass on every changed frame. Part of #976. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
8 tasks done
wei18
added a commit
that referenced
this pull request
Aug 11, 2026
SudokuUITests fixtures hardcoded the Remove Ads IAP price as `$2.99` across several `IAPProduct` mocks; the live price is `$0.99` (already the fallback value in `SettingsIAPRowTests.unpurchased_displayPrice_ fallsBackTo0_99WhenLookupEmpty`). The app itself was never wrong — this was fixture-only drift. Updated all `displayPrice: "$2.99"` mock literals to `"$0.99"` across SudokuUITests and AppMonetizationKit tests (the doc-comment example in IAPClient.swift is left as-is; it isn't a fixture). Re-recorded the 6 committed snapshot baselines whose sole visible change is the price text — confirmed via pixel-diff bounding box (18x24pt, same relative position in each) and by opening the regenerated PNGs. `SettingsViewAppStoreRowsTests`'s baseline was previously rejected as a candidate for the #976 marketing-frame fixture solely because of this stale price; it becomes a candidate again now that it reads $0.99. closes #981 Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
wei18
added a commit
that referenced
this pull request
Aug 11, 2026
…nslation checks (#1006) The snapshot harness injects `.environment(\.locale, ...)`, which its doc comment presented as the locale mechanism without qualification. It is not one for strings: `Text(LocalizedStringKey)` resolves against `Bundle.main`, and in a headless `swift test` host that is the xctest runner, which carries none of the App target's compiled `.lproj` resources. UI strings therefore stay English no matter which locale is injected — only date/number formatting and layout direction respond. That gap produced 108 byte-identical "localized" baselines in #976 (backed out) and contributed to two misdiagnoses. The three long-standing locale-tagged BoardView baselines (ja, ko, zh-TW) were always layout-robustness probes; nothing said so, so they read as translation coverage. This is documentation only — no behaviour change. #977 stays open as the record of the underlying limitation; per the product decision on 2026-08-11 the store frames keep rendering English app UI under localized marketing captions, so the fix is deferred rather than attempted. Both `hostingView` variants in each app's harness now carry the note, and the BoardView call sites say "layout probe" explicitly. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
Summary
Redesigns the App Store screenshot marketing frames for both apps (Direction C + B). Takes over and finishes a stalled agent's uncommitted work (247 dirty files, no commits) — orientation, cleanup, verification, and commit/PR are new; the design direction and generator scaffolding were substantially in place already.
docs/app-store/screenshot-strategy.md) — pending native-speaker review, same bar as any new marketing string.Two visual defects found by manual review, now fixed
The team lead opened the actual output (not just thumbnails) and found two real problems, which I've fixed and re-verified:
1. Direction C's panel didn't eliminate dead space, it relocated it. Bleeding the full baseline screenshot to the canvas edge meant a scrolled list's own empty tail bled too — Home/Daily/Settings showed 40–60% flat cream space inside the panel, worse than the "half the canvas is empty" problem C was built to fix. Fixed by cropping the baseline to its content-bearing region (new
detect_content_bottom(), alpha+color-aware so it handles both a full opaque screenshot and a floating hero-reveal card) before compositing. The panel is now exactly as tall as its real content; slots whose content already reaches deep (Board's digit pad, ~92%) still bleed past the canvas edge as before — nothing forces it for shorter slots, which now show branded gradient below instead of cream.I first tried forcing every slot to bleed by zooming past the width-fill scale, then center-cropping any overflow back to the panel width. That was worse than the original bug: MS iPad's covered board (grid + control panel only 44% tall) needed enough zoom to outgrow the panel width too, and the crop-back clipped the "Reveal" button off the canvas edge — hiding real product UI. Reverted to the simpler fix (crop to content, scale by width only, no forced zoom).
2. Direction B's callout chip covered the product it was advertising. The chip always dropped straight below its anchor dot; on Sudoku Board (both devices) that landed it on live grid cells, and on MS iPad it landed on the covered grid tiles. Fixed with an optional
chip_attarget independent of the anchor position (draw_callout_chipnow draws the leader line straight from anchor to chip instead of assuming "below the dot"). All three repositioned targets were measured directly off the baseline's own pixel geometry — grid bounding box, header-row text extent, button bottom edge, not guessed — and each went through 2–3 wrong attempts before landing clean (margin-clamping pushed one target back onto the cells it was meant to avoid; another didn't account for the chip's own height and its bottom edge dipped into the grid). Verified against full-resolution crops of the actual rendered PNGs, not computed coordinates alone.Also noted, not fixed here (out of scope — production app-code bug, not a generator issue): the MS iPad Board baseline shows
leave.game.leaveas a raw, unlocalized string-catalog key in the header instead of translated text. Worth its own issue.Localized UI — tried, reverted, tracked as #977
The original attempt also added 108 new
*Localizedparameterized snapshot tests so each locale would source its own baseline, giving the marketing frame real localized app UI under the (already-working) translated captions. It didn't work, and the attempt has been backed out of this PR.Byte-for-byte MD5 comparison of all 108 new baselines against their
encounterpart: every locale (zh-Hant/zh-Hans/ja/ko/es/th) was pixel-identical toen, for every slot, in both apps. Root cause: the snapshot harness'shostingView(locale:)sets.environment(\.locale, ...), but SwiftUI'sText(LocalizedStringKey)resolves its string table againstBundle.main— the real OS/device language — not the environment locale. Inside a headlessswift testhost,Bundle.mainis the xctest runner, which has no compiled.lprojresources at all, so no in-screen string ever localizes there. Not a regression — 3 pre-existingBoardViewTestslocale baselines already had this gap — but landing 108 more files that look like localized coverage while providing none would repeat a failure mode this repo already carries a scar from (see the bold warning indocs/app-store/screenshots/README.mdabout a prior, unrelated instance of byte-identical "placeholder" screenshots).Decision (with the team lead, after independent verification): strip the 108 baselines and the locale-parameterized tests back out; keep C+B. Filed #977 with full root-cause evidence and two real fix paths — (a) inject a per-locale
BundleatTextcall sites acrossGameShellUI/SudokuUI/MinesweeperUI, or (b) capture from the Simulator instead ofswift test, whereBundle.maingenuinely carries all 7.lprojfolders (the repo already drives the sim for screenshots viamise run ui:tour) — recommending (b) since it needs no production-code change. What survives here: the composited overlay (headline/subhead/Direction-B callout chips) is genuinely localized — I opened ja/ko/zh-Hans/zh-Hant/th frames and confirmed correct script (no tofu) and es shows correct accents — only the screenshot underneath the caption stays on the singleen-sourced baseline, same as before this redesign.Thumbnail legibility (verdict per representative slot, ~300px wide)
authenticatedLoadedfixture doesn't populate leaderboard rows. Content/fixture gap, not a legibility defect from this PR; follow-up candidate.Verification
swift build/swift testfor both packages green after every change, including the revert:Packages/SudokuKit(full suite): the single-process run segfaults (swiftpm-testing-helper ... signal 11) — a known, pre-existing, local-only AppKitNSWindow-accumulation issue (documented in session memory, unrelated to this diff). Ran in ~15 batches instead; all green both before (466 tests, with the locale tests) and after the revert (456 tests, without them).Packages/MinesweeperKit(full suite, single process): green both before (380 tests) and after the revert (372 tests).mise run store:screenshots build-ascspec: regenerated all 126 slots after every code change.swiftlint lint --strict: zero Swift files differ fromorigin/main(all Swift-side changes were reverted; remaining diff is Python + generated PNGs only). Repo-wide--stricthas pre-existing violations indocs/designs/code/and two cyclomatic-complexity findings — confirmed present onorigin/main, unrelated to this branch.git statusafter all commits: clean tree; diff scope is exactly the ascspec output tree + generator script + strategy doc, nothing stray.What I fixed picking this up
The dead agent's last action was mid-edit removing a localized test function from
BoardViewTests.swift(436 lines, over SwiftLint's 400-line ceiling) with a comment pointing at aBoardViewLocalizedTests.swiftthat didn't exist yet. Found and deleted 12 orphaned baseline PNGs left in the wrong__Snapshots__folder from before that split (baseline folder is keyed by source file, so moving a test moves its baseline folder too) — that cleanup survived the later revert since it was independent of the locale-baseline mechanism.Not done here (by design)
No merge, no ASC upload.
--verify-only/--i-am-suregates untouched.