Feature graphic fits the phone: shots.feature.fit 'contain' (default) sizes the device so its rotated box stays inside 1024x500 with a 24 px margin in both templates, 'bleed' keeps the crop, scale 0.5-1.5, config validated; shots render records measured device boxes (report.json devices) and shots check fails a feature graphic whose device leaves the canvas (warns for a screenshot's front device off a side or the top); tests/feature-fit.test.ts (rotated-box geometry, both templates rendered at 1024x500, bleeding fixture) (pitfall 55)

This commit is contained in:
CRTkafa 2026-10-13 09:49:53 +08:00
parent 6e2dbf03cc
commit 19d34286d5
15 changed files with 239 additions and 12 deletions

View file

@ -641,3 +641,11 @@ that fails without the fix (see CONTRIBUTING.md).
names the culprit. Never install or `brew link` a global tool as a side effect on a shared machine.
- **Guard:** `xcodePath`, `foreignRsync`, `distributionErrors` (`cli/lib/xcode.ts`), doctor, `publishSteps`
(`tools/desktop-release.ts`, rsync by absolute path).
## 55. The feature graphic cut the phone off at the bottom
- **Do:** nothing by default: `shots.feature.fit` 'contain' sizes the (rotated) phone so its outline stays inside the
1024 x 500 canvas with a 24 px margin. `fit: 'bleed'` keeps the larger, cropped phone on purpose; `scale` (0.5-1.5)
resizes it. `shots check` fails a feature graphic whose device leaves the canvas (measured from the page's layout
at render time, `devices` in report.json), and warns when a screenshot's front device runs off a side or the top.
- **Guard:** `featureLayout`, `rotatedBox` (`cli/shots/lib.ts`), `deviceIssues` (`cli/shots/report.ts`),
`tests/feature-fit.test.ts` (geometry, both templates rendered at 1024 x 500, a bleeding fixture).

View file

@ -118,7 +118,10 @@ the icon, feature graphic and phone screenshots and prints `tablet screenshots:
8. **Check.** `storebound shots check` (read-only, exit 1 on errors): pixel sizes (Apple: a listed size, portrait or
landscape; Play screenshots 320-3840 px at most 2:1; feature graphic exactly 1024 x 500), alpha, Play JPEG /
24-bit PNG and 8 MB, counts per set (Apple 1-10, Play 2-8), text overflow flags (warnings), glyphs drawn by an
automatic font fallback or a system font (errors; `shots render` measures every character in the page). `--variants` also checks
automatic font fallback or a system font (errors; `shots render` measures every character in the page), a device
frame cut off by the feature graphic's edge (error unless `shots.feature.fit: 'bleed'`; the default 'contain' fits
the rotated phone with a 24 px margin, `scale` 0.5-1.5 resizes it) or a screenshot's front device running off a
side or the top (warning; the bottom bleed is the design). `--variants` also checks
A/B variant folders. `storebound validate` runs the same checks on the renders folder and lists errors as
blockers next to the store state (`--no-local` skips them).
9. **Review.** `storebound shots gallery` writes `<renders>/index.html`: one self-contained page (no network, open it