Repository navigation
keep a minimized console pane minimized after a successful render - #18765
Conversation
A LogicalWindow now remembers when a tab raised it out of MINIMIZE on its own (WindowFrame.ensureVisible / ensure-height), as opposed to the user or an owner asking for the state. When a background task hands control back to the console (ConsoleActivateEvent with focusWindow == false -- R Markdown render, Quarto preview, compile PDF, deploys), the console pane is minimized again if that was the only reason it opened. A failed R Markdown render now explicitly un-minimizes the pane so the Render output can be read. Addresses #11622
RStudio E2E - all platforms2 test(s) failed
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
gtritchie
left a comment
There was a problem hiding this comment.
No blocking issues. 2 follow-up, 1 nit
🔴 must be resolved before merge. 🟠 is real but not merge-blocking — either address
it here or open an issue to do so later. 🟡 is optional.
- 🟠
LogicalWindow.java:133— an automatic raise by an unrelated tab lets a later successful render minimize the pane - 🟠
LogicalWindow.java:52— resizing with the splitter doesn't keep an auto-raised pane open - 🟡
Console.java:214— a minimized Console flashes open then closed onConsoleActivateEvent(false)
Additional findings
src/gwt/src/org/rstudio/studio/client/workbench/views/console/Console.java:214
🟡 When the pane is already minimized, activateConsole(false) raises it through bringToFront() and then minimizes it again right away, so it visibly flashes open and closed.
Skip bringToFront() (or check minimizeConsoleIfAutoRaised first) when the pane is minimized and the flag isn't set.
Why
Example: the user minimizes the Console with its button during a Knit. On success, bringToFront() fires EnsureVisibleEvent, then WindowFrame.onEnsureVisible raises the pane with forEnsureVisible (which sets the flag), then minimizeConsoleIfAutoRaised() minimizes it. That's two layout transitions back to back. The same thing happens when a dependency install succeeds, or when Quarto preview activates the console, while the pane is minimized.
|
|
||
| // remember a tab surfacing itself out of MINIMIZE; any other request (a | ||
| // frame button, an owner) supersedes a pending auto-raise | ||
| autoRaisedFromMinimize_ = |
There was a problem hiding this comment.
🟠 An automatic raise by any tab (Jobs, Find in Files) arms re-minimization, so a later successful Knit minimizes a pane the user has been using.
Clear the flag when a different task takes over the pane, or only arm it from the render/compile/deploy presenters that later fire ConsoleActivateEvent(false).
Why
Only a state change, a mousedown/keydown inside the frame, or an explicit activation clears the flag. Example: the Console pane is minimized and a background job raises the Jobs tab (flag set). The user watches the output without clicking. Then they Knit: the pane is already open, so the Render tab's ensureVisible changes no state and the flag stays set. The Render tab wasn't selected, so switchToConsoleAfterRender_ is true, and on success minimizeConsoleIfAutoRaised() minimizes the pane. One click gets it back and no output is lost.
There was a problem hiding this comment.
Fixed in 9698f8b. A tab asking to be visible while the pane is already open now counts as a claim on the pane and clears the flag, so Render output landing in a pane that Jobs or Find raised earlier no longer arms re-minimization. Added an e2e test for exactly this sequence (Find in Files raises the pane, then a successful Knit); it fails on the previous commit.
| // selecting a tab or typing directly into its editor. Capture before | ||
| // those controls can stop propagation; focus events also arise during | ||
| // automatic activation and must not cancel the pending restoration. | ||
| DomUtils.addEventListener( |
There was a problem hiding this comment.
🟠 Resizing an auto-raised Console pane with the splitter doesn't keep it open; a successful render minimizes it and drops the chosen size.
Clear the flag from the DualWindowLayoutPanel splitter-resize handler as well.
Why
The splitter is part of BinarySplitLayoutPanel, not normal_'s element, so the capture-phase mousedown listener never sees the drag. resizePanes() returns NORMAL, so no state-change event resets the flag either. This only happens if the user resizes during a render, which is why it isn't blocking.
There was a problem hiding this comment.
Fixed in 9698f8b. The splitter-resized handler in DualWindowLayoutPanel clears the flag on both windows, and transitionToState drops it whenever a window leaves NORMAL, which covers the sibling maximize-then-restore case the same way.
- A tab surfacing while the pane is already open (Render output landing in a pane a job raised earlier) claims the pane, so a later hand-back no longer minimizes it. The console tab's own bringToFront() counts too, so activateConsole(false) reads the flag before raising it. - A splitter drag clears the flag on both windows, and a sibling's transition moving a window out of NORMAL drops a pending auto-raise. - A task handing control back to a pane the user has since minimized leaves it minimized instead of raising it only to minimize it again. - e2e: cover a successful render in a pane that Find in Files raised.
|
Re the |
Intent
Keep a minimized Console pane minimized after a successful render. Failed R Markdown renders open the pane so their output can be inspected. Explicit Console activation, including Ctrl+2 and sending code to the Console, keeps the pane open across later renders.
Fixes #11622.
Approach
LogicalWindow.ConsoleActivateEvent(false). This covers R Markdown, Quarto preview, Compile PDF, and deployment completion.Testing
Checklist