Files
pipelines/web/design/layout/capture.mjs
T
alan 8880495970 web: layout prototype/spec and an accessibility audit (design inputs)
The layout prototype shows the operator's target shell: a left destination rail
(Pipelines/Runs/Chat/Settings) with the detail sections grouped in the rail, list
and detail panes, a status dot in the rail footer and no top connection chrome.
The spec's DOM sketch still mentions the old connection banner; the implementation
brief supersedes that (connection lives in Settings only).

The audit records 9 must-fix, 12 should-fix and 15 notes from real DOM and
accessibility-tree inspection, with file:line for each finding.
2026-10-19 16:33:59 +01:00

49 lines
1.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Capture the L2–L4 layout prototype through the repository's zero-dependency
// Chrome DevTools driver. Read-only import: web/test/browser.mjs is not modified.
//
// node web/design/layout/capture.mjs
//
// Writes PNGs into web/design/layout/captures/ (gitignored by the root
// `captures/` rule). No server is started; the prototype is a local file.
import { mkdir } from "node:fs/promises";
import { dirname, join } from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
import { launchChrome } from "../../test/browser.mjs";
const here = dirname(fileURLToPath(import.meta.url));
const outDir = join(here, "captures");
const prototype = pathToFileURL(join(here, "prototype.html"));
const shots = [
{ hash: "wide", width: 1440, height: 900, name: "wide-pipelines-1440x900.png" },
{ hash: "runs", width: 420, height: 900, name: "narrow-runs-420x900.png" },
{ hash: "detail", width: 420, height: 900, name: "narrow-run-detail-420x900.png" },
];
await mkdir(outDir, { recursive: true });
const browser = await launchChrome({ width: 1440, height: 900 });
try {
for (const shot of shots) {
const page = await browser.openPage(`${prototype.href}#${shot.hash}`, {
width: shot.width,
height: shot.height,
});
await page.waitForSelector(`#${shot.hash}`);
await page.evaluate("document.fonts.ready.then(() => true)");
await new Promise((resolve) => setTimeout(resolve, 150));
const box = await page.evaluate(`(() => {
const node = document.querySelector("#${shot.hash} .app-shell");
const rect = node.getBoundingClientRect();
return { width: Math.round(rect.width), height: Math.round(rect.height) };
})()`);
const path = join(outDir, shot.name);
await page.screenshot(path);
console.log(`${shot.name}: viewport ${shot.width}x${shot.height}, shell ${box.width}x${box.height}`);
await page.close();
}
} finally {
await browser.close();
}