Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"check:webui-dependency": "node scripts/check-webui-dependency.mjs",
"test:webui": "node scripts/run-vitest-suite.mjs webui",
"test:webui-package": "node scripts/verify-webui-package.mjs",
"test:webui-browser": "playwright install chromium && playwright test packages/webui/test/browser",
"test:webui-browser": "playwright install --with-deps chromium && playwright test packages/webui/test/browser",
"typecheck:webui": "pnpm --filter @mavis/webui typecheck:server && pnpm --filter @mavis/webui typecheck:client && pnpm --filter @mavis/webui typecheck:test",
"check:source": "node scripts/source-inventory.mjs",
"check:plugin": "node tools/plugins/validate-plugin.mjs",
Expand Down
18 changes: 16 additions & 2 deletions packages/webui/docs/verification/browser-suite.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
`styles.css` and files under `assets/` — in a real browser. The deterministic harness server serves
those built assets from the client output directory and refuses paths outside that directory. Run
`pnpm build:webui` first; the script installs the
lockfile-pinned Chromium revision when it is missing. The deterministic cases are evidence level 4 in
lockfile-pinned Chromium revision when it is missing, and on Linux also installs Chromium's system
dependencies, which include the CJK fonts the Chinese UI renders with. The deterministic cases are
evidence level 4 in
[`gates.md`](gates.md): the built client and its transport wiring are real, the server behind them is
not in the deterministic fixture cases. `native-runtime.spec.mjs` additionally boots the real
assembly, loopback service and native PTY bridge in a separate process with an isolated,
Expand Down Expand Up @@ -99,10 +101,22 @@ pnpm build:webui
pnpm test:webui-browser
```

The screenshots are only comparable within one font environment. The gate installs Chromium's
Linux system dependencies, which include the CJK fonts the Chinese surfaces need; on a runner
without them the browser has no glyph to draw for Chinese text and renders tofu boxes instead.
The committed baselines therefore record real Chinese glyphs, and a reviewer reading a diff can
read the Chinese in it. The same applies in reverse: regenerating the baselines anywhere that
does not install those fonts produces boxes, and the comparison against the committed baselines
fails. Treat a font change on the runner as a baseline change, not as a rendering difference to
be accepted.

To deliberately regenerate only these baselines, use
`pnpm exec playwright test packages/webui/test/browser/visual-baselines.spec.mjs --update-snapshots`
on Linux CI Chromium, inspect every resulting image, then run the same command without
`--update-snapshots` to compare. A passing fixture screenshot proves the built client's rendered
`--update-snapshots` to compare. Regenerate on a Linux environment that has the gate's fonts
installed — `pnpm exec playwright install --with-deps chromium` before the run — so the new
baselines carry the same glyphs the committed ones do. A passing fixture screenshot proves the
built client's rendered
state under the in-page deterministic transport; it does not prove the production service or runtime
path. Those boundaries require the integration suites described above.

Expand Down
2 changes: 1 addition & 1 deletion packages/webui/test/browser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ in-page transport). Run the directory, not a hand-kept list: Playwright collects

```sh
pnpm build:webui # the suite drives the built client
pnpm test:webui-browser # installs the pinned Chromium revision when missing
pnpm test:webui-browser # installs the pinned Chromium revision and, on Linux, its system dependencies
```

How the fixture works, what the suite proves and what it does not, and which environment variables
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading