diff --git a/frontend/scripts/capture-screenshots.mjs b/frontend/scripts/capture-screenshots.mjs index de02d23..a012607 100644 --- a/frontend/scripts/capture-screenshots.mjs +++ b/frontend/scripts/capture-screenshots.mjs @@ -117,6 +117,13 @@ async function captureFlows(page, dir) { await page.getByTestId("create-flow").click() } await page.waitForURL(/\/flows\/.+/, { timeout: 15000 }) + // The canvas paints before the flow detail arrives, so counting nodes right + // away reads 0 for a populated flow — and the seeding below would then add a + // node to somebody's real flow. Wait until it says which of the two it is. + await page + .locator(".react-flow__node, [data-testid=flow-empty]") + .first() + .waitFor({ timeout: 15000 }) if (!(await page.locator(".react-flow__node").count())) { await page.getByTestId("add-node").click() diff --git a/frontend/src/components/Flow/FlowEditor.tsx b/frontend/src/components/Flow/FlowEditor.tsx index 9edea38..23136d3 100644 --- a/frontend/src/components/Flow/FlowEditor.tsx +++ b/frontend/src/components/Flow/FlowEditor.tsx @@ -984,7 +984,10 @@ function FlowEditorInner({ {definitions.length === 0 ? ( -
+