Skip to content

feat: record the capture order of screenshots - #360

Merged
jsfez merged 3 commits into
mainfrom
feat/capture-index
Sep 2, 2026
Merged

jsfez merged 3 commits into
mainfrom
feat/capture-index

Conversation

@jsfez

@jsfez jsfez commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

A test walks a journey and screenshots it step by step, but none of that sequence reaches Argos: the CLI discovers snapshot files by globbing a directory, which yields them alphabetically. Each screenshot now carries its 0-based position within its test in capture.index, which is what lets Argos replay a journey in the order it happened.

Covered in Playwright, Cypress and Vitest — the three SDKs that report a test title path. Counters are scoped to a test run so a retry starts over at 0, and one index is taken per call rather than per file so viewport variants of the same screen share it.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
argos-js-sdk-reference Ready Ready Preview Sep 2, 2026 12:25pm UTC

Request Review

jsfez and others added 3 commits September 2, 2026 14:21
A test walks a journey and screenshots it step by step, but none of that
sequence reaches Argos: the CLI discovers snapshot files by globbing a
directory, which yields them alphabetically. Each screenshot now carries
its 0-based position within its test in `capture.index`.

Counters are scoped to a test run, so a retry numbers its screenshots
from 0 again, and one index is taken per call rather than per file, so
viewport variants of the same screen share it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The `BrowserCommands` augmentation still described the previous arity,
so passing the capture index over the RPC failed to typecheck.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jsfez
jsfez force-pushed the feat/capture-index branch from 9a63cec to 3b77458 Compare September 2, 2026 12:22
@jsfez
jsfez merged commit 12a8c62 into main Sep 2, 2026
70 checks passed
@jsfez
jsfez deleted the feat/capture-index branch September 2, 2026 12:40
jsfez added a commit to argos-ci/argos that referenced this pull request Sep 9, 2026
* feat(screenshots): accept the capture order in screenshot metadata

The SDKs record where each screenshot falls within its test
(`metadata.capture.index`, argos-ci/argos-javascript#360, shipped), but the
schema does not declare the field — and unknown keys are stripped, so the
index has been dropped on arrival ever since, silently. Keep it, and expose
it through GraphQL, so the review can follow a test in the order it walked.

The schema gains a test of its own: the failure mode here is an omission,
which nothing else would have caught.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat(build): show the journey of the active diff in a drawer

A test walks a journey and screenshots it step by step, but the review shows
each screenshot on its own: nothing says which journey a change belongs to,
or where in it the change sits.

A drawer above the viewer lays that journey out as a strip of steps, in the
order the SDK recorded, and jumps between them. It is built from every diff
of the build rather than the filtered list, so the screens that did not
change are in it too and the ones that did carry a mark — a change reads
against the journey it happened in. ⇧← / ⇧→ walk the same steps from the
keyboard, with or without the drawer open.

A journey is the test that took the screenshot (its title path), a step is a
logical screen (the backend `variantKey`, which already folds the viewport
and browser variants of one screen together). Nothing to configure: it comes
from the metadata the SDK already sends. A test that captures a single screen
is regular visual testing, not a journey, so neither the drawer nor its toggle
appears for it.

The strip stays within the active diff's variant, so moving between steps
keeps one viewport and the boxes can take their shape from it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore(e2e): cover the journey drawer of the build review

A build whose screenshots come from a test walking a checkout, with the
capture order recorded. The names are chosen so neither the alphabet (cart,
confirmation, payment, shipping) nor the diff score matches the journey
(cart, shipping, payment, confirmation): a drawer that reads in order can
only be reading the metadata. Two of the four steps are unchanged, so the
journey is only whole if it is built from every diff rather than the
reviewable ones.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore(seeds): give the dev database a journey to review

The drawer needs a test that captured more than one screen, and no dev
scenario had one — every seeded test captures exactly one screenshot, so the
feature was invisible locally. The checkout journey the e2e spec uses lands
in the dev database too, on a project of its own: it owns build 1 and its
buckets, which would collide with the builds `bigProject` already carries.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(build): stop clipping the descenders of journey step labels

`truncate` hides overflow, so a line box the height of the font itself has
nowhere to put a descender: "shipping" lost the tail of its g.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat(build): explain a journey step on hover

Two things in the strip were unreadable on their own. The step label is cut
to fit, so a long name ended in an ellipsis with no way to read it; hovering
it now gives the whole variant key, which the label never shows in full since
it only ever renders the last path segment.

The dot had no legend anywhere. It now says what put it there, naming the
statuses the way the rest of the review names them — "Needs review: Changed".
It is 10px, too small to aim at, so the padding around it is the target and
the offsets keep the dot itself where it was.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 3b774582 Deployed Sep 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant