Skip to content

keep a minimized console pane minimized after a successful render - #18765

Merged
kevinushey merged 5 commits into
mainfrom
feature/console-minimized-after-render
Sep 12, 2026
Merged

kevinushey merged 5 commits into
mainfrom
feature/console-minimized-after-render

Conversation

@kevinushey

@kevinushey kevinushey commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Tag frame requests that automatically restore a minimized pane and track them in LogicalWindow.
  • Restore minimization when a successful background task returns control through ConsoleActivateEvent(false). This covers R Markdown, Quarto preview, Compile PDF, and deployment completion.
  • Clear automatic-raise tracking after explicit Console activation or code execution, including when the pane is already visible. Explicit Console-pane activation also clears it.
  • Explicitly activate the Console pane after an R Markdown failure so the Render output is visible.

Testing

  • Java compilation and a GWT draft build passed.
  • E2E TypeScript typecheck passed.
  • The three Console render tests and the existing pane-layout and R Markdown suites passed in desktop-dev mode.
  • Console render coverage includes successful and failed renders from a minimized pane, and successful rendering after restoring the Console with Ctrl+2. Tests wait for the session's render-completed event and its UI processing rather than checking the runner's filesystem, so they do not require local access to rendered files.

Checklist

  • NEWS.md entry with issue link
  • e2e tests

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
@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

RStudio E2E - all platforms

2 test(s) failed

###################- 99% pass rate

Passed Failed Skipped Flaky
2890 2 197 14
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 2 0 10 0
✅ desktop-linux 730 0 38 3
✅ desktop-macos 729 0 42 1
✅ desktop-windows 729 0 41 7
❌ server-linux 672 2 46 3
✅ setup 28 0 20 0
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit a95a9d44937ee718b412385495f76b0984b20467 - Run #971

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 on ConsoleActivateEvent(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_ =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback posted

- 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.
@kevinushey

Copy link
Copy Markdown
Collaborator Author

Re the Console.java:214 nit: fixed in 9698f8b. activateConsole(false) now returns early when the pane is minimized, so a hand-back to a pane the user put away leaves it there instead of raising and re-minimizing it.

@kevinushey
kevinushey merged commit ee3a6bb into main Sep 12, 2026
1 of 7 checks passed
@kevinushey
kevinushey deleted the feature/console-minimized-after-render branch September 12, 2026 18:18

This branch was previously deployed

1 inactive deployment
e2e-playwright — a95a9d44 Deployed Sep 12, 2026 by kevinushey via windows / e2e-desktop-windows (2) #971
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep Console pane minimized after render

2 participants