Repository navigation
Conversation
…cenes A `--scene` run of the mobile showcase script cleared the whole capture folder for each planned device before capturing, so recapturing one scene deleted the device's other scene screenshots while still reporting success. Clearing now happens in `clearShowcaseCaptureOutputs`: a full capture set still clears the folder, stale files included, while a scene subset removes only the selected scenes' PNGs.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Single-scene screenshot captures now preserve the device’s other screenshots, while full captures still clear their output folder. The change is confined to generated local artifacts and reduces unintended deletion. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Problem
pnpm screenshots:mobile --scene <name>is the documented way to recapture one scene (Fast iteration indocs/operations/mobile-app-store-screenshots.md). Before capturing,mainremoved each planned capture's whole folder. That folder is keyed by device, appearance and theme, not scene, so--device pixel --scene threaddeleted the other five Pixel screenshots, capturedthread.png, and still printed "Done. Upload-ready screenshots…" with exit 0. Only a later full--validate-onlynoticed the missing files.Change
The clearing step moves into
clearShowcaseCaptureOutputs:--scenesubset removes only the selected scenes' PNGs.Clearing and validation share one
isFullCapturecheck, so they always agree on what counts as a full run. Because a subset run now keeps the other scenes, its validation checks every PNG currently present; a full--validate-onlyconfirms the complete scene set. Nothing else changes:--validate-onlyand when clearing runs relative to the build stay the same. CI never passes--scene, so CI captures behave as before.Scope and approval
This is a small, focused fix to maintainer tooling: one helper in
scripts/mobile-showcase.tsplus one test in its existing test file. A partial run should not delete scenes it was not asked to capture, and the docs already describe--sceneas capturing "one scene". So I opened this as a PR without a prior issue. #28012 and #25968 also editscripts/mobile-showcase.ts, in other hunks; that file merges cleanly with both.Verification
vp test run scripts/mobile-showcase.test.ts: 8 passed. The new table-driven test seeds a temp folder with every Pixel scene plus a stale file, plans captures with the real config, and checks which files survive. With--scene thread, the other five scenes and the stale file remain. With no scene filter, the folder is empty.mainhas no such helper to call, so for the before run the helper first did exactly whatmaindoes today (remove the folder, then recreate it). That run failed on the file-survival assertion.vp run check:changed 71c2d3a302: format, lint, knip, typecheck and the changed test file all passed.mainand against this branch with a stubadb(no device, no build, no Metro). The fixture servers were stubbed, and the folder was seeded with six valid 1080×1920 PNGs.Before (main):
--scene threadleaves onlythread.png, reports success, and the full validate fails.After: the same run replaces only
thread.png(its hash changes), keeps the other five, and the full validate passes.After: a full run still clears the folder first, so
stale.pnggoes.The new test failing when the helper wipes the folder (before), and passing on this branch (after):
Not checked: a real simulator or emulator capture. The change runs before any device step, and the stubbed run exercises the same
mainpath. I also did not check iOS, but iOS uses the same folder-clearing step.Generated with Claude Opus 5.5 and GPT-6.1 Sol in T3 Code Nightly