Repository navigation
bugfix: file.edit during in-flight closeAllSourceDocs silently dropped - #17740
Merged
Merged
Conversation
Addresses #17738. WindowFrame.onEnsureVisible only fired the NORMAL state recovery when !isVisible(). During the HIDE animation kicked off by LastSourceDocClosedEvent -> PaneManager.closeSourceWindow, the WindowFrame widget is still in the DOM, so isVisible() returns true even though the logical state is HIDE. A file.edit arriving during that window silently landed in a pane that finished hiding. Mirror the LogicalWindow's state onto the WindowFrame in transitionToState, and also recover when that mirrored state is HIDE or MINIMIZE. Removes the matching workaround from the closeSourceAndDeleteFile helper so the new Playwright regression test (close_open_race.test.ts) reflects the real behavior.
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
3 tasks done
kevinushey
added a commit
that referenced
this pull request
Jun 22, 2026
* resolve panmirror dependency from primary worktree in gwt build Completes #18030: lib.dir and node.dir gained a ${git.main.worktree} fallback so a fresh git worktree can borrow the primary checkout's gitignored deps, but panmirror.dir did not. Add the same fallback so 'ant draft' (and the cmake-driven GWT build) work in a secondary worktree instead of failing with '${panmirror.dir} does not exist'. * re-enable the View() close/open race playwright test The View()/documentCloseAllNoSave variant of the source-pane open-during-close race (#17738) was left as test.fixme when #17740 landed, because the data viewer iframe failed to finish loading even with the WindowFrame HIDE-state recovery. The data-viewer mount path has since been reworked and the race no longer reproduces -- the test passes reliably (20/20 stress runs on macOS desktop).
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.
Intent
Addresses #17738.
Summary
WindowFrame.onEnsureVisibleonly fired theWindowStateChangeEvent(NORMAL)recovery when!isVisible(). During the HIDE animation kicked off byLastSourceDocClosedEvent->PaneManager.closeSourceWindow, theWindowFrameis still mounted in the DOM andisVisible()returns true even though the logical state is alreadyHIDE. The recovery never fired, the HIDE animation completed, and the file-open landed in an invisible pane.LogicalWindow's state onto itsWindowFrameintransitionToState, and recover when that mirrored state isHIDEorMINIMIZE(in addition to!isVisible()).closeAllSourceDocs, immediatefile.edit).closeSourceAndDeleteFile-- the helper now waits only on the editor detach, so the regression test exercises the real behavior rather than the workaround.Test plan
ant draft+ repackage desktop, then rune2e/rstudio/tests/panes/editor/close_open_race.test.tson macOS Desktop -- new test passes.e2e/rstudio/tests/panes/editor/rmarkdown.test.tsto confirm the original symptom site is still healthy now that the helper no longer pollsselectedTab.ensureVisiblestill doesn't un-maximize unrelated layouts.file.edit-- the pane should restore.