feat: add project-aware agent workspace
Generic Container CI/CD / test-build-publish (push) Successful in 2m9s
Frontend CI/CD / build-test-publish-and-deploy (push) Successful in 2m39s

This commit is contained in:
2026-10-22 18:52:18 +08:00
parent c6a0e74e72
commit 2d8506fea0
191 changed files with 12373 additions and 3556 deletions
+20
View File
@@ -0,0 +1,20 @@
import type { Locator, TestInfo } from "@playwright/test";
/** Measure the actual reading surface so density changes can be compared with screenshots. */
export async function captureReadingGeometry(workspace: Locator, testInfo: TestInfo) {
const geometry = await workspace.evaluate((element) => {
const scroll = element.querySelector("[data-reading-scroll]")!;
const metrics = element.querySelector(".answer-ui-stack-comparison")!;
const chart = element.querySelector('.answer-ui-chart [role="img"]')!;
const bounds = scroll.getBoundingClientRect();
return {
viewportWidth: window.innerWidth,
readingWidth: Math.round(bounds.width),
metricsHeight: Math.round(metrics.getBoundingClientRect().height),
chartOffset: Math.round(chart.getBoundingClientRect().top - bounds.top + scroll.scrollTop),
horizontalOverflow: document.documentElement.scrollWidth > window.innerWidth,
};
});
await testInfo.attach("reading-geometry", { body: JSON.stringify(geometry, null, 2), contentType: "application/json" });
return geometry;
}