@fusion.dev/helix-cli 0.196.0 → 0.197.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +6 -6
  2. package/visual/README.md +51 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fusion.dev/helix-cli",
3
3
  "description": "The Helix command line, for a workspace that reaches it through npm, and the visual tests it runs.",
4
- "version": "0.196.0",
4
+ "version": "0.197.1",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -41,11 +41,11 @@
41
41
  "visual-regression"
42
42
  ],
43
43
  "optionalDependencies": {
44
- "@fusion.dev/helix-cli-darwin-arm64": "0.196.0",
45
- "@fusion.dev/helix-cli-darwin-x64": "0.196.0",
46
- "@fusion.dev/helix-cli-linux-arm64": "0.196.0",
47
- "@fusion.dev/helix-cli-linux-x64": "0.196.0",
48
- "@fusion.dev/helix-cli-win32-x64": "0.196.0"
44
+ "@fusion.dev/helix-cli-darwin-arm64": "0.197.1",
45
+ "@fusion.dev/helix-cli-darwin-x64": "0.197.1",
46
+ "@fusion.dev/helix-cli-linux-arm64": "0.197.1",
47
+ "@fusion.dev/helix-cli-linux-x64": "0.197.1",
48
+ "@fusion.dev/helix-cli-win32-x64": "0.197.1"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@anthropic-ai/sdk": ">=0.132",
package/visual/README.md CHANGED
@@ -28,6 +28,7 @@ helix visual update --boxes also write element boxes into baselines tha
28
28
  helix visual test --shard 0 --of 4 the first of four shards, for CI
29
29
  helix visual report open the report of the last run
30
30
  helix visual report --merge a b the groups of several shards' reports as one
31
+ helix visual report --history runs what earlier runs' records say
31
32
  helix visual compare a.png b.png compare two PNG files, with no browser
32
33
  ```
33
34
 
@@ -46,6 +47,11 @@ helix visual compare a.png b.png compare two PNG files, with no browser
46
47
  `run.json`, and prints their changes as one set of groups, so a change
47
48
  spread across shards is one group. With a `triage` in the config, a merge
48
49
  asks about each group once, reading the diff since `--changed`.
50
+ `--history` takes the records of earlier runs, each a `run.json` or a
51
+ directory holding any number, and names the shots that needed a second
52
+ take in more than one run or that differed and matched on one commit, and
53
+ the changes that failed on more than one branch. With `--merge`, each group
54
+ also names the other branches it failed on lately.
49
55
  - **`helix visual compare`** compares two PNG files. `--diff` writes the image of the
50
56
  difference, and `--threshold` sets how far apart two colors may be and still
51
57
  count as the same pixel, from 0 to 1.
@@ -289,6 +295,51 @@ The Action lives in the Fusion repository, in `helix/visual/action`.
289
295
  `helix` and `playwright` name the commands that run each,
290
296
  `npx --no-install helix` and `npx --no-install playwright` unless you set them.
291
297
 
298
+ - **Every check keeps its run record**, the report's `run.json`, as an
299
+ artifact named `visual-run-<job>-<index>` for `keep` days, 30 unless you set
300
+ it. Each record names the commit and the branch it ran on.
301
+ - **`history: 30`** reads the records of the last 30 runs of the workflow and
302
+ adds what they say to the summary. It reads them with the workflow's token,
303
+ so the job needs `permissions: actions: read`. Nothing is stored outside
304
+ your Actions artifacts.
305
+
306
+ ## Review on the pull request
307
+
308
+ A workflow can let a reviewer retake the entries they have looked at with a
309
+ comment, using only the retake workflow you already run. This one takes
310
+ `/retake styled/badge site/home` from anyone who can push, on a branch of the
311
+ repository, and dispatches the retake there:
312
+
313
+ ```yaml
314
+ name: Retake on request
315
+ on:
316
+ issue_comment:
317
+ types: [created]
318
+ permissions:
319
+ actions: write
320
+ contents: read
321
+ pull-requests: write
322
+ jobs:
323
+ retake:
324
+ if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/retake') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association) }}
325
+ runs-on: ubuntu-latest
326
+ steps:
327
+ - env:
328
+ BODY: ${{ github.event.comment.body }}
329
+ GH_REPO: ${{ github.repository }}
330
+ GH_TOKEN: ${{ github.token }}
331
+ NUMBER: ${{ github.event.issue.number }}
332
+ run: |
333
+ head=$(gh api "repos/$GITHUB_REPOSITORY/pulls/$NUMBER" --jq .head.ref)
334
+ entries=$(head -n 1 <<<"$BODY" | sed 's#^/retake##' | tr -s ' ' '\n' | grep -E '^[a-z0-9-]+(/[a-z0-9-]+)?$' | tr '\n' ' ')
335
+ gh workflow run visual-baselines.yml --ref "$head" -f entries="$entries"
336
+ ```
337
+
338
+ It dispatches a `visual-baselines.yml` that runs the Action with
339
+ `mode: retake` and passes an `entries` input in `args`. Read the comment from
340
+ the environment, as this does, and never paste it into a command. The retake opens its own pull request into the branch, which is
341
+ where the pictures are looked at before they land.
342
+
292
343
  ## How it works
293
344
 
294
345
  - **Local-first.** `helix visual` runs on your machine and in your CI. It needs no