From a7ca0e0efb062c4e3d5a3c71e023eb8dc488d570 Mon Sep 17 00:00:00 2001 From: dev Date: Wed, 25 Nov 2026 11:03:06 +0800 Subject: [PATCH 1/3] [fix] canvas: leave the example dialog once the import finishes Importing an example ended with the dialog still on screen, every entry marked done, and the newly created project waiting behind it. The import had already opened the example, so the only thing left to do in that dialog was to close it by hand. The dialog now closes itself half a second after an import reports done, which is long enough to read the completion line. The close callback is held in a ref so a parent re-render does not restart the timer, and the timer is cleared on unmount and when the done state goes away. --- src/canvas/workspace/example/ExampleCanvasDialog.tsx | 10 ++++++++++ tests/browser/example_canvas_picker.mjs | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) 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); From d42d0f0a3e40556e65e357258377257fd9acb0d8 Mon Sep 17 00:00:00 2001 From: Zhangbo-cn <60600082+Zhangbo-cn@users.noreply.github.com> Date: Wed, 2 Dec 2026 23:23:48 +0800 Subject: [PATCH 2/3] ci: retrigger after a runner-load timeout capability discovery / the real-OpenCode worker timed out under load; both pass locally on this tree. From 92e79bf5e2ea1d9db50e33df2d7497d015304e7f Mon Sep 17 00:00:00 2001 From: dev Date: Fri, 4 Dec 2026 20:02:05 +0800 Subject: [PATCH 3/3] [bugfix] canvas: close the example dialog after a finished import A successful import left the picker covering the canvas it had just created. The dialog now leaves 600 ms after an import reports done, and it waits for every row to settle so a second running download is not orphaned and a failure stays visible. Co-Authored-By: Claude Code --- src/canvas/workspace/example/ExampleCanvasDialog.tsx | 8 +++++--- tests/browser/example_canvas_picker.mjs | 4 +--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/canvas/workspace/example/ExampleCanvasDialog.tsx b/src/canvas/workspace/example/ExampleCanvasDialog.tsx index 45666ace5..b1b7a8293 100644 --- a/src/canvas/workspace/example/ExampleCanvasDialog.tsx +++ b/src/canvas/workspace/example/ExampleCanvasDialog.tsx @@ -36,9 +36,11 @@ 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 settled = entries.every((entry) => { + const phase = statuses[entry.id]?.phase; + return phase === undefined || phase === "done"; + }); + const done = settled && entries.some((entry) => statuses[entry.id]?.phase === "done"); const closeRef = useRef(onClose); closeRef.current = onClose; useEffect(() => { diff --git a/tests/browser/example_canvas_picker.mjs b/tests/browser/example_canvas_picker.mjs index e7f3e840b..3043e9284 100644 --- a/tests/browser/example_canvas_picker.mjs +++ b/tests/browser/example_canvas_picker.mjs @@ -101,7 +101,7 @@ try { await page.waitForFunction(() => document.querySelectorAll(".react-flow__node").length === 2); assert.equal(await page.locator(".react-flow__node").count(), 2); await image.getByRole("progressbar").waitFor({ state: "hidden" }); - await dialog.getByRole("button", { name: "关闭", exact: true }).last().click(); + await dialog.waitFor({ state: "hidden" }); // 2. The project menu still reaches the full picker. // The switch saves the new project first; the switcher is disabled until then. @@ -114,8 +114,6 @@ try { await dialog.waitFor(); // The catalog ships with the app, so the rows carry its titles. await dialog.getByText("图像创作示例画布", { exact: true }).waitFor(); - // Importing through the picker closes it on its own, so the imported canvas - // is reachable without a second click. await dialog .locator(".cw-example-item") .filter({ hasText: "图像创作示例画布" })