From c6cec9e84841622c7120dbf52e3d3a02b9949b16 Mon Sep 17 00:00:00 2001 From: stroblme Date: Sun, 6 Sep 2026 17:51:11 +0200 Subject: [PATCH] Read the run-context shot against the flow its dashboard belongs to MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The two runs were taken off the top of the unfiltered table, so the shot only showed anything while the newest runs happened to be the ones the `_results` dashboard reads. Another flow finishing a run since photographed an empty grid — every tile "No curve was recorded", every stat blank. The table is filtered to that dashboard's flow first. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01CL9zvnnvcp1mvA8o7impxk --- frontend/scripts/capture-screenshots.mjs | 36 +++++++++++++++--------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/frontend/scripts/capture-screenshots.mjs b/frontend/scripts/capture-screenshots.mjs index 84735a4..88d90e9 100644 --- a/frontend/scripts/capture-screenshots.mjs +++ b/frontend/scripts/capture-screenshots.mjs @@ -122,16 +122,6 @@ async function captureRuns(page, dir) { await page.waitForTimeout(1500) await page.screenshot({ path: `${dir}/app-runs-compare.png`, fullPage: true }) - // A dashboard read against those two runs: the same page a live run is - // watched on, showing finished ones. This is the seam the feature exists for. - const picked = await page - .getByTestId("run-link") - .evaluateAll((links) => - links.slice(0, 2).map((a) => a.getAttribute("href")), - ) - const ids = picked - .map((href) => (href || "").split("/").pop()) - .filter(Boolean) // The API is its own host here; the SPA's origin does not proxy /api. const apiUrl = APP_URL.replace("//app.", "//api.") const results = await page.evaluate(async (base) => { @@ -146,12 +136,30 @@ async function captureRuns(page, dir) { .map((one) => one.name) .find((n) => n.endsWith("_results")) }, apiUrl) - if (results && ids.length) { - await page.goto(`${APP_URL}/view/${results}?runs=${ids.join(",")}`, { + + // A dashboard read against two runs: the same page a live run is watched + // on, showing finished ones. This is the seam the feature exists for — and + // it draws nothing unless the runs are the ones that dashboard reads, so + // the table is filtered to its flow rather than read from the top. Another + // flow's run finishing later would otherwise photograph an empty grid. + if (results) { + const flow = results.replace(/_results$/, "") + await page.goto(`${APP_URL}/runs?flow=${flow}`, { waitUntil: "networkidle", }) - await page.waitForTimeout(2000) - await page.screenshot({ path: `${dir}/app-run-context.png` }) + const ids = await page.getByTestId("run-link").evaluateAll((links) => + links + .slice(0, 2) + .map((a) => (a.getAttribute("href") || "").split("/").pop()) + .filter(Boolean), + ) + if (ids.length) { + await page.goto(`${APP_URL}/view/${results}?runs=${ids.join(",")}`, { + waitUntil: "networkidle", + }) + await page.waitForTimeout(2000) + await page.screenshot({ path: `${dir}/app-run-context.png` }) + } } // The dashboard that pins the last few runs, drawn live rather than in a