Skip to content

Releases

ui-diff 2.0

Choose a tag to compare

@imuratalpay imuratalpay released this 21 Nov 23:08

ui-diff 2.0 tells you what changed, not only where pixels moved, and says plainly when a result cannot be trusted.

What you see first

  • The PR comment starts with the verdict in plain words: "No visual changes", "3 measured changes on 2 routes", or "Changes found, but captures were not comparable".
  • Next come the measured changes, grouped by page: one row per element, property and old → new value, with the variants it was seen on, for example link 'Get started': padding 8px 14px → 10px 18px — desktop, mobile · light, dark. The verdict counts causes only: a button's padding change is one change, and so is a longer label, with the size, the move, the elements it pushed and a neighbour it wrapped shown under it as its effects.
  • Every changed area gets a still before | after pair with the change outlined. A blinking version and the diff are folded below it, for those who want them.
  • After the images come areas where pixels changed but nothing measurable did, and last the capture settings and timing, collapsed.

Results you can trust

  • Base and head elements are matched with a confidence and a reason, and each measured change is checked against the changed pixels before it is shown. Changes that fail the check are listed as unverified, never dropped.
  • Clock, randomness, animations and fonts are frozen on both sides by default.
  • Each side records what it was captured with. When base and head differ (fonts, browser, viewport, pixel ratio, clock), the run says the captures were not comparable instead of reporting a clean result.
  • A run that captured nothing says "Nothing was checked".
  • The token audit names a nearby token only when it really is close in color, and otherwise says "no close token".

Faster and local

  • ui-diff check compares your working tree with the merge base, posts nothing, and exits 0 (no visual changes), 1 (changes) or 2 (errors), so it can run before every push. --open opens the images folder and the report.
  • Base captures are cached and reused while the base commit and capture settings stay the same.
  • In CI, a first job decides in seconds whether anything needs capturing, so a PR without UI changes skips installing the app and the browser.
  • Motion clips load each page once and record both sides at the same time.
  • An app without dependencies installs nothing in the base and head worktrees.

CI workflow example

  • Runs on Node 24 actions (self-hosted runners need runner 2.327.1 or newer).
  • Needs a lockfile in the app when it has a package.json, and says so with an error otherwise.
  • Keeps the whole report folder as an artifact for 14 days.

Focus and ignore

  • focus and ignore take CSS selectors, for the whole config or one route. Only changes inside the focus are compared, and ignored areas are left out. A selector that matches nothing is a warning, never a failure.

Breaking changes

  • The comment layout is new. Without a written summary, the comment no longer adds the automatic one; a draft is still written to .ui-diff/summary.auto.md.
  • report.json is version 3. Reports from 0.1 (version 1) and the pre-release (version 2) are still read.
  • Freezing is on by default. The older capture switches keep working.
  • Changes to UI packages in the dependency files now count as UI changes and capture every route.
  • On a PR without UI changes, nothing is posted. An existing comment keeps its last result under a one-line note.

Full list: CHANGELOG.md.