Repository navigation
[fix] canvas: leave the example dialog once the import finishes - #500
Open
Zhangbo-cn wants to merge 1 commit into
Open
Zhangbo-cn wants to merge 1 commit into
Zhangbo-cn wants to merge 1 commit into
Conversation
Zhangbo-cn
requested review from
hsliuustc0106 and
princepride
as code owners
November 25, 2026 03:03
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
force-pushed
the
fix/example-import-autoclose
branch
from
November 25, 2026 03:56
d714b79 to
a7ca0e0
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ifdonegoes 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 --noEmitclean;npm test978 pass / 0 fail.