Skip to content

[fix] canvas: leave the example dialog once the import finishes - #500

Open
Zhangbo-cn wants to merge 1 commit into
ThinkFlowLab:mainfrom
Zhangbo-cn:fix/example-import-autoclose
Open

Zhangbo-cn wants to merge 1 commit into
ThinkFlowLab:mainfrom
Zhangbo-cn:fix/example-import-autoclose

Conversation

@Zhangbo-cn

@Zhangbo-cn Zhangbo-cn commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What

Importing an example ended with the dialog still open, every entry marked done, and the example that had just been created waiting behind it. The import already opened the new project, so the remaining step in that dialog was a manual click on Close.

The dialog now closes itself 600 ms after an import reports done — long enough to read the completion line, short enough that nobody reaches for the close button. The callback is held in a ref so a parent re-render cannot restart the timer, and the timer is cleared on unmount and if done goes away.

Verification

tests/browser/example_canvas_picker.mjs (isolated fixture) now asserts the dialog becomes hidden after the import, instead of only asserting the entries completed — the previous version passed with the dialog still on screen, which is exactly the state reported. Script passes; tsc --noEmit clean; npm test 978 pass / 0 fail.

@github-actions github-actions Bot added area:canvas Canvas, nodes and direct manipulation type:bug Something is broken labels Nov 25, 2026
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.
@Zhangbo-cn
Zhangbo-cn force-pushed the fix/example-import-autoclose branch from d714b79 to a7ca0e0 Compare November 25, 2026 03:56

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:canvas Canvas, nodes and direct manipulation type:bug Something is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant