Repository navigation
id(web): close image browser on editor teardown (#1381) - #1588
Conversation
The image browser overlay is appended to document.body and captures the EditorView in its Insert closures, so it survived closeEditor(), SPA navigation, and collab re-init: Insert on the destroyed view threw before close() ran and the dialog stayed stuck over the next document. - image-browser: track the open browser in module state and export closeImageBrowser() (mirrors destroySearchPanel/destroyGotoLineDialog); opening for a different view self-closes the stale browser; Insert and double-click dismiss in a finally even when dispatch throws. - main: closeEditor() closes the browser before destroying the view. - collab: reconnect re-init closes the browser before destroying the old view. - tests: new image-browser.test.ts covers teardown close, stale-view self-close, same-view no-double-open, the normal insert path, and Insert/double-click dismissal when dispatch throws.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 35 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Heads-up from lane D (author): this branch is based on 7bd79a6, which predates main's biome-format fix for |
Fixes #1381.
The image browser overlay is appended to
document.bodyand captures theEditorViewin its Insert closures, so it survived editor teardown (closeEditor(), SPA navigation, collab re-init): Insert on the destroyed view threw beforeclose()ran, and the dialog stayed stuck over the next document.Changes
closeImageBrowser()(mirrorsdestroySearchPanel/destroyGotoLineDialog); opening the browser for a different view self-closes the stale one; Insert and double-click now dismiss in afinally, so the dialog closes even when the insert dispatch throws.closeEditor()closes the browser before destroying the view.closeImageBrowser(), stale-view self-close with insert landing in the live view, same-view no-double-open, the normal insert path, and Insert/double-click dismissal when dispatch throws.Scope notes
vitest runin pkgs/id/web) run on this PR per the fleet's CI-first policy.Need help on this PR? Tag
@codesmith-botwith what you need.