You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(ui-scripts): add a live HTML view to the visual-diff report
The lightbox gains an HTML mode alongside Baseline/Actual/Diff/Slider that iframes the live
rendered page, so a reviewer can inspect the real DOM, computed styles, and text next to the
pixels. The page URL is derived from the screenshot name via the existing meta map and facet
suffixes (appUrlFor), and shown only when the page still exists and the app was published.
To back it, CI rebuilds the regression-test app as a static export with a basePath matching its
published location and drops it next to the report; visual-diff is passed --app-path app. The
basePath is env-driven (REGRESSION_APP_BASE_PATH) so local dev and the Cypress capture build are
unaffected.
Published reports previously accumulated on gh-pages forever, and shipping the app bundle per PR
makes that worse, so the workflow now also removes a PR's report directory when the PR closes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/contributing/testing/visual-regression.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,8 @@ open .report/index.html
70
70
|`--pr-url <url>`| — | Target of the PR link. |
71
71
|`--meta <file>`| — | JSON mapping screenshot slug → visited URL path. Enables per-row source-file links in the report. Produced automatically by `spec.cy.ts` via `cy.task('recordMeta', ...)`. |
72
72
|`--source-base-url <url>`| — | GitHub blob URL of `regression-test/src/app` on the branch being reviewed. Combined with `--meta` to build links like `treebrowser/page.tsx`. |
73
+
|`--facets <list>`| — | Comma-separated facet suffixes (e.g. `canvas,light,dark`) rendered as one-click filter chips that match screenshots named `<name>-<facet>`. |
74
+
|`--app-path <path>`| — | Path, relative to the report root, where a static export of the app is published (CI uses `app`). Enables the lightbox **HTML** view, which iframes the live rendered page. |
73
75
74
76
### Interpreting the report
75
77
@@ -82,6 +84,7 @@ Top-bar controls:
82
84
-**Lightbox** — click any thumbnail to open a fullscreen viewer. Inside:
83
85
-`Baseline`, `Actual`, `Diff` buttons switch between the three images.
84
86
-`Slider` mode overlays baseline and actual with a drag handle so you can scrub the boundary back and forth.
87
+
-`HTML` mode iframes the live rendered page (a static export of the app published next to the report) so you can inspect the real DOM, computed styles, and text alongside the pixels. Shown only when the page still exists and the app was published (`--app-path`).
85
88
-`1:1` / `Fit` toggles between native pixel size (scrollable) and fit-to-window.
86
89
-`‹` / `›` step through visible rows (respects the current filter).
lbViewer.innerHTML = '<img src="' + state.mode + '/' + name + '" alt="' + name + '" />'
548
600
}
@@ -682,7 +734,8 @@ function run(args: Args): number {
682
734
args.prUrl,
683
735
meta,
684
736
args.sourceBaseUrl,
685
-
facets
737
+
facets,
738
+
args.appPath
686
739
)
687
740
)
688
741
@@ -747,6 +800,11 @@ export default {
747
800
type: 'string',
748
801
describe:
749
802
'Comma-separated facet suffixes (e.g. "canvas,light,dark") rendered as one-click filter chips that match screenshots named "<name>-<facet>"'
803
+
},
804
+
'app-path': {
805
+
type: 'string',
806
+
describe:
807
+
'Path (relative to the report root) where the live app is published, e.g. "app". Enables an "HTML" view in the lightbox that iframes the rendered page for each screenshot.'
Copy file name to clipboardExpand all lines: regression-test/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
A small Next.js app that imports `@instructure/ui` locally and exposes one page per component. Cypress visits each page to:
4
4
5
-
-**Detect visual changes** — screenshots are diffed against baselines by the `ui-scripts visual-diff` command; an interactive HTML report is published to GitHub Pages on every PR.
5
+
-**Detect visual changes** — screenshots are diffed against baselines by the `ui-scripts visual-diff` command; an interactive HTML report is published to GitHub Pages on every PR. Each screenshot opens in a lightbox that switches between Baseline / Actual / Diff / Slider views and an **HTML** view that iframes the live rendered page (a static export of this app is published next to the report), so you can inspect the real DOM alongside the pixels.
6
6
-**Detect a11y issues** — axe-core runs against every page.
7
7
-**Detect unexpected console errors** — the spec's `afterEach` hook asserts `console.error` was not called.
0 commit comments