diff --git a/src/canvas/workspace/example/ExampleCanvasDialog.tsx b/src/canvas/workspace/example/ExampleCanvasDialog.tsx index 3293fcf24..45666ace5 100644 --- a/src/canvas/workspace/example/ExampleCanvasDialog.tsx +++ b/src/canvas/workspace/example/ExampleCanvasDialog.tsx @@ -36,6 +36,16 @@ export function ExampleCanvasDialog({ }, []); const busy = entries.some((entry) => isRunning(entry.id)); + // A finished import already opened the example, so the dialog leaves on its + // own: keeping it up asked for a second click to reach what was just made. + const done = entries.some((entry) => statuses[entry.id]?.phase === "done"); + const closeRef = useRef(onClose); + closeRef.current = onClose; + useEffect(() => { + if (!done) return; + const timer = window.setTimeout(() => closeRef.current(), 600); + return () => window.clearTimeout(timer); + }, [done]); return ( document.querySelectorAll(".react-flow__node").length === 2); // 3. A page instead of an archive is reported inline, and nothing is imported. await page.unroute(samplePattern);