docs: the showcase screenshots are shot at twice the pixel density

openApp() passes page options through, so the showcase run sets
deviceScaleFactor 2 — same CSS viewport and layout as the tests, 2800x2000 px
images that stay sharp where the README scales them down.
This commit is contained in:
Steffen Becker committed 2026-09-06 21:19:14 +02:00
1 parent d8be23cf68
commit 284fdae43e
11 files changed
+4 -3

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 KiB

After

Width:  |  Height:  |  Size: 659 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 295 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 314 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 KiB

After

Width:  |  Height:  |  Size: 976 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

After

Width:  |  Height:  |  Size: 406 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 KiB

After

Width:  |  Height:  |  Size: 562 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

After

Width:  |  Height:  |  Size: 407 KiB

+2 -1
View File
@@ -13,7 +13,8 @@ const DOCS = ['thesis', 'thesis-review', 'book', 'newsletter'].filter((n) => !on
await mkdir(OUT, { recursive: true });
const server = await devServer(PORT);
const { browser, page, pageErrors } = await openApp(PORT);
// Same CSS viewport as the tests, shot at 2x so the README images stay sharp when scaled.
const { browser, page, pageErrors } = await openApp(PORT, { deviceScaleFactor: 2 });
const url = `http://localhost:${PORT}/`;
const ready = async () => {
+2 -2
View File
@@ -49,14 +49,14 @@ export async function devServer(port) {
// BROWSER=chromium|firefox|webkit picks the engine (Chromium by default). Fixed locale,
// so the UI labels a test clicks are deterministic across machines.
export async function openApp(port) {
export async function openApp(port, opts = {}) {
const name = process.env.BROWSER ?? 'chromium';
const engine = playwright[name];
if (!engine) throw new Error(`unknown BROWSER "${name}": chromium, firefox or webkit`);
const args = name === 'chromium' ? ['--no-sandbox'] : [];
const browser = await engine.launch({ executablePath: engine.executablePath(), args });
console.log(`engine: ${name} ${browser.version()}`);
const page = await browser.newPage({ viewport: { width: 1400, height: 1000 }, locale: 'en-US' });
const page = await browser.newPage({ viewport: { width: 1400, height: 1000 }, locale: 'en-US', ...opts });
const pageErrors = [];
// The text box's ResizeObserver refits the wrapper it observes, so the browser defers
// the rest of the round to the next frame and reports it — a converging loop, not an error.