Repository navigation
fix(cli): snapshot rejects a negative --at and builds its sheet from its own frames - #6179
Open
miguel-heygen wants to merge 4 commits into
Open
miguel-heygen wants to merge 4 commits into
miguel-heygen wants to merge 4 commits into
Conversation
Base automatically changed from
fix/snapshot-output-deletes-only-its-own-frames
to
main
October 24, 2026 08:58
Contributor
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 0 important · 0 nits · head c6552c15
The --at parse now runs before lint, the output folder and the browser. The contact sheet is built only from the paths this run returned. CI is green on this head.
Scope
Read snapshotSampling.ts, snapshot.ts, contactSheet.ts and the test diff. --at "" now reaches parseSnapshotAt (=== undefined instead of truthiness) and is refused; a bare --at (citty true → "true") is refused too. Sheet order goes from a filename sort to capture order; that is the same order because the names carry a frame-NN index. The branch predates #6176's squash-merge, but its 6176 commits match main and GitHub reports it mergeable.
miguel-heygen
enabled auto-merge
October 24, 2026 10:51
This branch has not been deployed
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.
What
Two fixes to
hyperframes snapshot:--atnow refuses a negative, infinite, non-numeric or empty time before anything runs, with--at must be comma-separated times in seconds, each 0 or moreand exit 1. Before,--at -1captured a still namedframe-00-at--1s.png,--at Infinitycaptured one atInfinity, a bad entry likeNaNwas silently dropped,1junkwas read as 1, and--at ""fell back to the default frames.frame-*.pngin the output folder. Before, a user's ownframe-hero.pngin an--outputfolder landed in the sheet.Why
Stacked on #6176, which makes
--outputclear only the images whose names match the snapshot pattern. Aframe-00-at--1s.pngdoes not match that pattern, so the next run would leave it behind; and a user'sframe-hero.pngnow survives the clear, so the folder glob put it in the sheet.Related work
Stacked on #6176 (base is its branch). Will retarget to
mainonce #6176 merges.How
parseSnapshotAtsits besideparseSnapshotRange, parses each entry the same way (Number, empty is invalid) and throws the same way (the CLI boundary prints the message and exits 1). It runs next to the--rangeparse, so the refusal comes before lint, the output folder or the browser.--keep's duplicate-name check moved with it, unchanged.createSnapshotContactSheettakes the list of frame paths instead of a folder. Its only caller passes the paths the capture returned (the same list it already reports as artifacts). Order is capture order; labels still come from theat-<time>spart of each name.--keepand--reviewbehave as before.--at 1,) and a value with trailing text (--at 1.5s) are now refused, matching--range. The documented examples all use plain numbers.Test plan
Through the real command (
runCommand(snapshotCommand, ...)), insnapshot-contactSheet.test.ts:refuses --at <value> before writing anythingfor-1,0.5,-1,Infinity,NaN,1,,1junkand an empty value: the run rejects with the message, takes no screenshot and creates no output folder.builds the sheet from this run's frames, not another frame-*.png in the folder: an output folder holdingframe-hero.pngplus a two-frame run; a stub image library records every file the sheet reads, which must be exactly the two frames.Measured: on #6176's code the new tests fail (9 failed, 15 passed: the seven
--atcases resolve or fail with onlyCommand failed, the sheet readsframe-hero.png, and the updated call-shape assertion sees a folder). With the fix: 24 passed, 3 runs in a row, together withsnapshotSampling.test.ts.oxfmt --check,oxlintandtsc --noEmitforpackages/cliare clean.Not exercised: a real image library building a real sheet (the test stubs it), the CLI binary end to end, and the rest of the CLI suite.