Skip to content

Reopen a column dragged shut when a pane is shown - #19231

Merged
gtritchie merged 26 commits into
mainfrom
bugfix/show-pane-reopens-shut-column
Oct 23, 2026
Merged

gtritchie merged 26 commits into
mainfrom
bugfix/show-pane-reopens-shut-column

Conversation

@gtritchie

@gtritchie gtritchie commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Show pane commands (Show Files, Show Plots, etc.) selected the tab inside a column dragged shut with a splitter, so nothing appeared. Panes that raise themselves through WorkbenchPane.bringToFront() (Console, Source, a help topic) reopened their column only when it was exactly 0px wide, and then reset every column to an equal width.

A pane being shown now reopens its column when it is narrower than 20px, the width below which #19182 makes a column inert:

  • The column gets up to a default column's width, and at least the sidebar's 175px minimum when it is the sidebar. The width comes from the one column that can give the most; the others keep theirs. A donor gives at most half its width and never drops below its own minimum (20px, or 175px for the sidebar).
  • Triggers: everything that reaches PaneManager.activateTab() or a pane's own raise.
    • Show commands, and panes raising themselves (Plots on a new plot, Move Focus to Console, a help topic).
    • ActivatePaneEvent callers, which never reopened a column before: entering the debugger (Environment) and the server's ActivatePane event (R's history(), a Quarto re-preview, Packrat with an unresolved snapshot).
    • The Help Home, Search R Help, Back and Forward commands, which now raise the Help pane as a help topic does instead of firing an ActivatePaneEvent. They first activate Help by its canonical name, as the raise uses the localized title (Pane raises during a zoom use the localized pane title, which PaneManager doesn't recognize #19234).
    • Focus Next/Previous Pane onto a quadrant in a shut column.
  • The reopen reads target widths (MainSplitPanel.getTargetWidth()), not drawn widths. One pane raise reaches it several times before the resize animation runs, and a pane can be shown during a zoom's 300ms animation; drawn widths took the donor's width once per call and missed the zoom.

Zooms:

  • A Show command or Focus Next/Previous Pane for a pane hidden by another pane's zoom moves the zoom to it, as a pane raising itself already did. That covers a column the zoom shut and the zoomed pane's partner quadrant. Before, a Show command selected the tab behind the zoom, and showing the partner left a stale zoom (Stale pane-zoom state re-zooms any pane that raises itself, breaking the four-pane layout #18444).
  • ActivatePaneEvent callers leave any zoom alone, as on main: they show a pane as a side effect, and moving a Console zoom on entering the debugger would hide the prompt. For the zoomed pane's hidden partner, the tab is selected without showing the pane, which on main ended the zoom without clearing its state. (Debugger entry during a Console zoom still ends with Source zoomed, on main as well: the debugger opens the function in Source, and that raise moves the zoom.)
  • The Zoom commands select their tab without reopening, so ending a zoom brings back the shut column the user left.
  • A Show command or pane raise in a column hidden by a column zoom ends the zoom through restoreLayout(), which also clears the zoom state, then reopens the column if the restored layout leaves it shut. Before, a pane raise resized the columns under the zoom and left the zoom state recorded, and a Show command did nothing.

Tests, in zoom_inert.test.ts:

  • Show Files and Show Plots (already selected) reopen a shut column.
  • A narrow column that is still open keeps its width.
  • Ending a zoom of a tab in a shut column leaves it shut.
  • Show Files and a plot reopen a column next to a wide sidebar, with the sidebar paying only what the column gains.
  • Move Focus to Console reopens a Console column dragged shut or nearly shut.
  • A plot or Show Files during a column zoom ends the zoom, and so does Show Files during the zoom's animation.
  • Show Files during a Console zoom moves the zoom to Files, and End Zoom then restores the layout from before the Console zoom. The same for Show Files while Environment, its partner, is zoomed.
  • history() reopens a column dragged shut, leaves a Console zoom on Console, and leaves a Files zoom on Files, with History showing once the zoom ends.
  • Search R Help during a Console zoom moves the zoom to Help, in English and in French.
  • Show Chat reopens a sidebar shut by a column zoom in a 500px window.

The two window-shrink tests from #19181, and the reopen tests' cleanup, now wait for the splitter to settle before dragging it back. Under load the drag could start before the last layout pass and miss the splitter, leaving later tests a broken layout.

Follow-ups:

Fixes #19184.

activateTab() reopened a minimized quadrant and a hidden sidebar, but not
a column dragged shut with a splitter, so Show Files, Show Plots, etc.
selected the tab inside a 0px column. When no zoom is tracked and the
tab's column is narrower than the inert threshold (20px), give it a
default column's width, taken from the widest column so the other
columns keep theirs.

Addresses #19184.
Zoom commands select their tab through activateTab() before the zoom
records the widths it restores, so reopening a shut column there made
ending the zoom bring back the reopened layout instead of the user's.
Skip the reopen for zoomTab().

The sidebar was not a width donor, so with it dragged wide and the other
columns squeezed shut, Show Files reopened nothing. Include it among the
columns the width can come from.

Addresses #19184.
A sidebar under 350px could be halved below its 175px minimum, and saved
state with a sidebar that narrow is thrown away for default widths on the
next load. Take the width from the column with the most to spare above
its minimum, and give no more than that.

Addresses #19184.
The donor was the column with the most width above its minimum, but it
then gave at most half its width, so a narrow column could win over a
sidebar able to give more and leave the reopened column shut. Rank the
columns by what they can give after both limits, and skip the reopen
when none can give anything.

Addresses #19184.
A donor could give enough to drop below 20px, where MainSplitPanel makes
a column inert, so reopening one column could shut another. Treat 20px
as each column's minimum (175px for the sidebar), and skip a reopen that
would still leave the column below it.

Addresses #19184.
Console and Source raise themselves through WindowEnsureVisibleEvent,
whose handler widened a column only when the pane was 0px wide, and then
reset every column to an equal width. A Console column dragged to 11px
stayed shut on Move Focus to Console. Use reopenCollapsedColumn() there
too, so these panes reopen below the 20px collapse width and the other
columns keep their widths.

A column zoom can't move to the raised pane the way a pane zoom does.
The handler used to widen the columns under it and leave the zoom state
recorded; end the zoom through restoreLayout() instead, which clears it.

Addresses #19184.
One pane raise reaches reopenCollapsedColumn() several times in a tick:
WorkbenchPane.bringToFront() fires ActivatePaneEvent (activateTab) and
then EnsureVisibleEvent (the ensure-visible handler). Each call read the
drawn widths, which don't change until the resize animation runs, so
each took the width from the donor again. A plot reopening the right
column next to a 969px sidebar left the sidebar at 117px, below its
175px minimum, while the right column gained 426px.

Read the target widths instead, which setWidgetSize() updates at once,
so a repeat call finds the column already open. The sidebar now gives
only the 426px the column gains.

Also wrap the test lines over 100 characters.

Addresses #19184.

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The reopen fixes #19184 for Show commands and pane raises. The comments below cover one behavior change worth confirming (ActivatePaneEvent callers now reopen shut columns), an inconsistency between the two reopen entry points during a column zoom, and a few lower-priority issues and nits. Most of the width issues already existed on main; the PR just routes more paths into them.

*/
private void reopenCollapsedColumn(LogicalWindow window)
{
if (maximizedWindow_ != null || widgetSizePriorToZoom_ >= 0)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Show commands still do nothing during a column zoom. reopenCollapsedColumn returns on any tracked zoom, and only the WindowEnsureVisibleEvent handler (line 554) ends a column zoom. WorkbenchTabPanel.selectTab fires no EnsureVisibleEvent; only a tab's own ensureVisible is forwarded (WorkbenchTabPanel.java:279). So Zoom Left Column followed by View > Panes > Show Files selects Files in a 0px column, while a plot in the same state ends the zoom.

This isn't a regression (base activateTab never reopened anything), but the two entry points now follow different rules. Moving the handler's zoom-ending branch into reopenCollapsedColumn would cover both, and zoomTab would still opt out through activateTab(tab, false).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in e7530d8. The zoom-ending branch now lives in reopenCollapsedColumn(), so Show commands and pane raises follow the same rule, and zoomTab still opts out through activateTab(tab, false).

New test: "Show Files during a column zoom ends the zoom", which fails on 42207f6.

if (panel == null)
return;

if (reopenColumn)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ActivatePaneEvent callers now reopen a column the user dragged shut. At base, ActivatePaneEvent -> WorkbenchScreen.onActivatePane -> activateTab never resized columns. Now any of these pops a shut column open and takes width from the editor:

  • entering the debugger (EnvironmentPresenter.java:778)
  • showing a help topic (Help.java:199)
  • a server ActivatePane event (ClientEventDispatcher.java:629)
  • any WorkbenchPane.bringToFront (WorkbenchPane.java:101)

The PR description lists Show commands, ensure-visible raises and Focus Next/Previous Pane, but not these. Is reopening intended here too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Intended, including the debugger: Environment is part of the debugging view. These callers already un-minimized the pane and showed a hidden sidebar before this PR.

On main, a help topic also raises HelpPane through WorkbenchPane.bringToFront(), so it already reopened a fully shut (0px) column. These are new:

  • debugger entry
  • the Help Home/Search/Back/Forward commands
  • the server ActivatePane event (history(), Quarto re-preview, Packrat)

The PR description now lists them.

{
Widget column = getColumn(window);
if (column != null && panel_.isCollapsed(column))
restoreLayout();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

A plot ending a column zoom drops the pre-zoom widths. With maximizedWindow_ null, restoreLayout() goes through restoreColumnLayout. That ignores the snapshotted widgetSizePriorToZoom_ and sets right_ through getValidColumnWidth. For a single widget, its min and max thresholds come out equal (0.75 × panel width with two columns), so the user's width is replaced whatever it was.

End Zoom already does this (splitter_aria.test.ts:126: "restores the default column widths, not the pre-zoom ones"), but pane raises now take the same path, while re-running the zoom command restores the prior width. The #19201 follow-up mentions only the sidebar; the right and left columns are affected too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed. Leaving it for #19201, since the fix belongs in restoreColumnLayout() and would change End Zoom too, which splitter_aria.test.ts currently asserts. I've added the right column and the extra source columns there: #19201 (comment)

if (widgetSizePriorToZoom_ >= 0)
{
Widget column = getColumn(window);
if (column != null && panel_.isCollapsed(column))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This reads drawn widths; the reopen reads target widths. isCollapsed reads offsetWidth. If a plot arrives during the 300ms Zoom Left Column animation, right_ still has its drawn width, so the handler returns and the plot ends up behind the zoom once the animation finishes. Base had the same race, so this is a missed fix rather than a regression. panel_.getTargetWidth(column) < panel_.getMinimumOpenWidth(column) would close it. Low priority: the window is narrow, and closed entirely under reduced motion.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in e7530d8. The handler's drawn-width check is gone. The zoom check in reopenCollapsedColumn() reads getTargetWidth(), so a pane shown mid-animation ends the zoom. New test: "Show Files while a column zoom animates ends the zoom" (both commands run in one evaluate).

}
}
double width = panel_.getTargetWidth(column);
double growth = Math.min(panel_.getDefaultSplitterWidth() - width, getGivableWidth(donor));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The sidebar's growth target can fall below its 175px minimum. getDefaultSplitterWidth() is clientWidth / columnCount. A left-column zoom with the sidebar visible sets the sidebar to 0, and ending it through restoreLayout() leaves it there (the #19201 follow-up). In a window narrower than 525px with three columns, Show Chat then computes width + growth < 175 and returns, leaving Chat selected in a 0px sidebar. This needs a narrow window and isn't a regression, but getDefaultSidebarWidth() or the 175 minimum looks like the right target for the sidebar.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in a443e63: the target is now max(getDefaultSplitterWidth(), getMinimumOpenWidth(column)). I didn't use getDefaultSidebarWidth(), because it is 0.8 × the default and so is even further below 175 in a narrow window.

New test: "Show Chat reopens a sidebar shut by a column zoom in a narrow window" (500px). It fails without the change, with the sidebar at 0px.

At 450px the half-width donor cap still keeps the sidebar shut: the right column would have to drop from about 337px to 162px.


await executeCommand(page, 'activateFiles');
// A resize would animate, so give one time to start before sampling.
await page.waitForTimeout(500);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nit: this checks that something doesn't happen using a fixed sleep and a single sample. .claude/skills/rstudio-create-playwright-tests/SKILL.md entry 12 says to sample the predicate over a window instead, since a resize that lands after 500ms (e.g. on a slow CI box) would pass. The practical risk is low today because the reopen starts synchronously with a 300ms animation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 84309a9: it now reads the width every 50ms for about 1s and fails on the first change. Checked by letting the reopen fire (column dragged shut): it fails at sample 0.

() -> window.getNormal().onResize());
}

private ArrayList<Widget> getColumns()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nit: this rebuilds the left + center + right + sidebar list that MainSplitPanel already builds in getWidestColumn() and again in the new getTargetWidth(), and only the MainSplitPanel copies filter through isColumn(). A MainSplitPanel.getColumns() used here would keep the three copies in step.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done in 1b43417. MainSplitPanel.getColumns() builds the isColumn()-filtered list once. updateCollapsedColumns(), getWidestColumn(), getTargetWidth() and PaneManager all use it.

panel_.setWidgetSize(donor, panel_.getWidgetSize(donor) - growth);

// Animate to the sizes just set, then lay the window out at its new width.
resizeHorizontally(panel_.getWidgetSize(right_), panel_.getLeftWidgetSizes(),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nit: the sizes set just above are read back and passed into resizeHorizontally, which sets them again before animating. getTargetWidth(column) is also computed twice (lines 2373 and 2387). Calling panel_.animate with the completion callback directly, or passing the computed targets, would make it clearer that the animation just plays out sizes that are already set.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done in ad6f459. The animate-and-report step of resizeHorizontally() is now animateToWidgetSizes(), which the reopen calls directly. The open check is isOpen().

resizeHorizontallyWithSidebarOnRight/OnLeft have the same animate block; I left those alone.

Show commands reach the reopen through activateTab, which returned early
during any tracked zoom, while only the WindowEnsureVisibleEvent handler
ended a column zoom. Zoom Left Column then Show Files selected Files in a
0px column; a plot in the same state ended the zoom. The zoom-ending
branch now lives in reopenCollapsedColumn, so both routes follow it.

The check also reads target widths rather than drawn widths, so a pane
shown during the zoom's 300ms animation ends the zoom instead of ending
up behind it.

Before: "Show Files during a column zoom ends the zoom" and "Show Files
while a column zoom animates ends the zoom" fail on 42207f6. After:
both pass, with zoom_inert, focus_adjacent_pane, splitter_aria and panes
(87 passed, 3 skipped).

Addresses #19184
The reopen aimed for a default column's width, the window width over the
column count. With three columns in a window under 525px that is below
the sidebar's 175px minimum, so the reopen gave up. A left-column zoom
shuts the sidebar and ending it leaves the sidebar at 0px (#19201), so
Show Chat then selected Chat in a 0px sidebar.

Before: "Show Chat reopens a sidebar shut by a column zoom in a narrow
window" (500px) fails with the sidebar at 0px. After: it passes, with
zoom_inert, focus_adjacent_pane and splitter_aria (45 passed).

Addresses #19184
"a narrow column that is still open keeps its width" slept 500ms and
read the width once, so a resize landing later would pass. It now reads
it every 50ms for about 1s and fails on the first change.

Checked by dragging the column to 12px wide so the reopen fires: the test
fails at sample 0 (expected 0, received 576). Restored, it passes.

Addresses #19184
MainSplitPanel listed its columns in updateCollapsedColumns(),
getWidestColumn() and getTargetWidth(), and PaneManager kept a fourth
copy without the isColumn() filter the others apply. getColumns() now
builds the filtered list once, and PaneManager uses it.

All tests under tests/panes/layout pass (121 passed, 3 skipped).

Addresses #19184
reopenCollapsedColumn set the column and donor sizes, then read the
right and left sizes back into resizeHorizontally, which set them again
before animating. The animate-and-report step is now its own method,
animateToWidgetSizes, which both call. The open check is one method
instead of three copies of the same comparison.

All tests under tests/panes/layout pass (121 passed).

Addresses #19184

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Round 2: the new commits address all eight first-round comments, either fixed or covered by the description and the #19201 follow-up. Two new comments: Show commands still do nothing while another pane is zoomed (behavior unchanged from main, and the comment it's on is misleading), plus a nit.

*/
private void reopenCollapsedColumn(LogicalWindow window)
{
// A pane raise moves a zoom of another pane to this one instead.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Show commands still do nothing while another pane is zoomed, and this comment covers only one route. The zoom does move when a pane raises itself, through the WindowEnsureVisibleEvent handler (line 533). But Show commands also reach this return, through activateTab, and nothing moves the zoom there.

Zoom Console sets the right column to 0, and TabSet2 stays NORMAL (EXCLUSIVE only hides Console's own partner pane). Then View > Panes > Show Files: onActivateFiles -> activateTab. parent.visible() is true, so no state change happens. This returns, and selectTab fires no EnsureVisibleEvent, so Files ends up selected in a 0px column. By contrast, Files' own Go To Working Directory calls WorkbenchPane.bringToFront -> EnsureVisibleEvent, which does move the zoom.

Main behaves the same, and the description says a pane zoom is "left alone", so rewording this comment may be enough. Otherwise, moving the zoom here (as the handler does) would close the gap. I traced this through the code but didn't run it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in f09f4a8: when another pane's zoom has shut the shown pane's column, reopenCollapsedColumn() now moves the zoom there with fullyMaximizeWindow(window, tab), as the handler does for a raise. activateTab passes the tab, and the comment now describes this route.

New test: "Show Files during a Console zoom moves the zoom to Files", which fails on 8bde2c5. It also checks that End Zoom then restores the layout from before the Console zoom.

Focus Next/Previous Pane already moved the zoom on main, because focusWindow calls ensureVisible(true) on the selected tab, and every quadrant tab is a DelayLoadWorkbenchTab.

roborev found that, with an extra source column, a zoom transfer records the source-column widths a second time. That also happens on main through the Zoom commands and pane raises, so it's on #19232: #19232 (comment)

* Animate the columns to the sizes already set on the panel, then report the
* resize as a splitter drag would.
*/
private void animateToWidgetSizes(final Command afterComplete)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nit: resizeHorizontallyWithSidebarOnRight (1667) and resizeHorizontallyWithSidebarOnLeft (1732) still end with their own copies of this method's body (lines 1716 and 1788, byte-identical). Both could end with animateToWidgetSizes(afterComplete), so the completion step lives in one place.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done in 2d79033: both sidebar-aware resizes now end with animateToWidgetSizes(afterComplete).

A pane raising itself takes over a zoom of another pane through the
WindowEnsureVisibleEvent handler, but Show commands reach the reopen
through activateTab, which returned on any zoom of another pane. Zoom
Console then Show Files selected Files in a 0px column. The reopen now
moves the zoom to the shown pane when that zoom shut its column, as the
handler does.

Before: "Show Files during a Console zoom moves the zoom to Files" fails
on 8bde2c5 (TabSet2 not exposed). After: it passes, with all tests
under tests/panes/layout (122 passed).

Addresses #19184
The two window-shrink tests restore the window and drag the middle
splitter back at once. A trace of a failure in a full tests/panes/layout
run read the splitter at x=1259 12ms after the restore; a later layout
pass moved it back to ~1240, so the mouse-down missed the 7px splitter,
the drag did nothing, and the next test started from the broken layout.
The cleanup now waits until the splitter's position holds across two
reads 150ms apart. The narrow-window Show Chat test restores the window
the same way before dragging the sidebar splitter, so it waits too.

The race needs a loaded machine: 10 isolated runs of the shrink test
passed before the change. After it, all tests under tests/panes/layout
pass (122 passed).

Addresses #19184
resizeHorizontallyWithSidebarOnRight and resizeHorizontallyWithSidebarOnLeft
ended with byte-identical copies of the animate-and-report block that
animateToWidgetSizes now holds. Both call it instead.

All tests under tests/panes/layout pass (122 passed).

Addresses #19184

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Round 3: both round-2 comments are fixed (Show commands now move a pane zoom; the sidebar resizes use animateToWidgetSizes). Two new comments: one asks whether entering the debugger should move a zoom, and one covers a partner-quadrant Show that leaves the zoom state stale (unchanged from main).

// WindowEnsureVisibleEvent handler does when a pane raises itself.
if (maximizedWindow_ != null && !maximizedWindow_.equals(window))
{
fullyMaximizeWindow(window, tab);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Entering the debugger now moves a pane zoom. Is that intended? Any activateTab caller now gets here, not just Show commands. When debugging starts, EnvironmentPresenter.setContextDepth (line 778) fires ActivatePaneEvent("Environment"), and that's the only raise on that path: the presenter's bringToFront calls are all for workspace and import-dataset commands. That event runs WorkbenchScreen.onActivatePane -> activateTab -> here.

With Console zoomed, the right column is shut, so this calls fullyMaximizeWindow(TabSet1, Environment) and hides the console showing the Browse[1]> prompt. On main the same event did nothing during a zoom. The server's ActivatePane event (e.g. history()) moves a Console zoom to History the same way. The description's list of zoom effects doesn't mention these. I traced this through the code but didn't run it, and didn't check whether a later Source or Console raise moves the zoom back.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not intended. Fixed in ae90c91. WorkbenchScreen.onActivatePane now calls activateTabLeavingZoom(): an ActivatePaneEvent reopens a column dragged shut but leaves any zoom alone, as on main. Show commands, Focus Next/Previous Pane and pane raises still move or end a zoom.

I probed debugger entry during a Console zoom, with a function defined in the console and one sourced from a file. On both origin/main and 2d79033 it ends with Source zoomed and the console at 0px, because the debugger opens the function in Source and that raise moves the zoom. So this change avoids the extra Environment zoom but doesn't change where the debugger leaves the zoom.

roborev pointed out that Help Home, Search R Help, Back and Forward also used ActivatePaneEvent, so Search R Help during a Console zoom focused a field in a 0px column. As of 110d402 those commands raise HelpPane itself, as a help topic does. Help.bringToFront() stays passive for the session-start Help home and ActivateHelpEvent.

That raise names the pane by its localized title, which PaneManager doesn't recognize, so da9c910 also fires the canonical "Help" ActivatePaneEvent first. Pane raises in general have the same problem on main; that's #19234. After a zoom moves to Help, focus goes to the Help content, which is existing zoom behavior, kept rather than special-cased for Search R Help.

New tests:

  • "history() during a Console zoom leaves the zoom on Console" (fails on 2d79033 at sample 0)
  • "history() reopens a column dragged shut"
  • "Search R Help during a Console zoom moves the zoom to Help" (fails on ae90c91)
  • "Search R Help during a Console zoom moves the zoom to Help in French" (fails on 110d402)

private void reopenCollapsedColumn(LogicalWindow window, Tab tab)
{
Widget column = getColumn(window);
if (column == null || isOpen(column))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Showing the zoomed pane's partner leaves the zoom state stale. With Files zoomed (TabSet2 EXCLUSIVE, TabSet1 HIDE), Show Packages hits !parent.visible() in activateTab (line 2292) and fires NORMAL, and DualWindowLayoutPanel puts both quadrants back to NORMAL. Nothing in PaneManager reacts to that, and this line returns because the column is full width. So maximizedWindow_ stays TabSet2, Zoom Files stays checked, and the other columns stay at 0 while the right column now shows both quadrants.

That's the stale-zoom state #18444 fixed for a tab double-click (panes.test.ts, "Restoring a zoomed tabset by double-clicking its tab ends the zoom"): the next pane raise elsewhere starts a fresh zoom. Main behaves the same, but every other Show case now moves the zoom, and the new comment says this mirrors the WindowEnsureVisibleEvent handler, which would move it here too. Traced through the code, not run.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in ae90c91 and 8d1e235.

  • Show commands: the zoom move in reopenCollapsedColumn() now runs whenever another pane is zoomed, before the shut-column check, as in the WindowEnsureVisibleEvent handler. During a pane zoom every other pane is either in a column the zoom shut or hidden as the partner, so this covers both. New test: "Show Files while Environment is zoomed moves the zoom to Files". It checks that Zoom Files is checked, Zoom Environment isn't, TabSet1 is hidden, and that End Zoom then restores the layout. It fails on 2d79033 with TabSet1 still shown.
  • ActivatePaneEvent callers: these now leave a zoom alone (see the other thread), so an event for the zoomed pane's partner, e.g. history() while Files is zoomed, would still have shown the partner and left the zoom stale. As of 8d1e235, activateTab doesn't show the hidden partner for an ActivatePaneEvent during a pane zoom. The tab is selected and is showing once the zoom ends. New test: "history() while Files is zoomed leaves the zoom on Files", which fails on ae90c91.

Showing the zoomed pane's partner quadrant (Zoom Environment, then Show
Files) put both quadrants back to NORMAL but left maximizedWindow_ and
the zoom command's checked state behind, the stale zoom of #18444. The
column was open, so the reopen returned before moving the zoom. A Show
command now moves a zoom of any other pane, as the
WindowEnsureVisibleEvent handler does for a raise.

ActivatePaneEvent callers show a pane as a side effect (entering the
debugger, history(), Packrat), and since f09f4a8 they moved a Console
zoom away from the Console. activateTab now takes how far it may change
the layout: Zoom commands change nothing, ActivatePaneEvent reopens a
column dragged shut but leaves any zoom, and Show commands, Focus
Next/Previous Pane and pane raises also move or end a zoom.

A probe of debugger entry during a Console zoom ended with Source zoomed
on both origin/main and 2d79033: the debugger opens the function in
Source, and that raise moves the zoom. This change doesn't alter that.

Before, on 2d79033: "Show Files while Environment is zoomed moves the
zoom to Files" fails (TabSet1 still shown), and "history() during a
Console zoom leaves the zoom on Console" fails at sample 0. After: both
pass, as does "history() reopens a column dragged shut", with all tests
under tests/panes/layout (125 passed) and tests/panes/debugger (32
passed).

Addresses #19184
An ActivatePaneEvent for the zoomed pane's partner quadrant (history()
while Files is zoomed) put the partner back to NORMAL before the reopen
left the zoom alone. Both quadrants showed while maximizedWindow_ and the
zoom command's checked state stayed behind, the stale zoom of #18444. For
an ActivatePaneEvent during a pane zoom, activateTab now selects the tab
without showing its pane, and the tab is showing once the zoom ends.

Before, on ae90c91: "history() while Files is zoomed leaves the zoom
on Files" fails at sample 0 (TabSet1 reachable, Zoom Files checked).
After: it passes, with all tests under tests/panes/layout (127 passed),
tests/panes/help and tests/panes/debugger (36 passed).

Addresses #19184
Help Home, Search R Help, Back and Forward activated the Help tab with an
ActivatePaneEvent, which since ae90c91 leaves a zoom alone. During a
Console zoom, Search R Help focused a search field in a 0px column. These
commands now raise HelpPane itself, as a help topic does, so they move or
end a zoom and reopen a shut column. Help.bringToFront() keeps the
ActivatePaneEvent for the passive callers: Help home shown at session
start, and ActivateHelpEvent.

Before, on ae90c91: "Search R Help during a Console zoom moves the
zoom to Help" fails (TabSet2 not exposed). After: it passes, with all
tests under tests/panes/layout (127 passed), tests/panes/help and
tests/panes/debugger (36 passed).

Addresses #19184
"history() while Files is zoomed leaves the zoom on Files" starts
history() behind a 2s sleep and then zooms Files. If the zoom took longer
to dispatch than the sleep, history() ran first and the test passed
without an ActivatePaneEvent during a zoom. It now fails if History is
already selected once the zoom starts, and waits for R to go idle before
its cleanup.

Passes 3 of 3 runs.

Addresses #19184
A pane raises itself with an ActivatePaneEvent carrying its localized
title, "Aide" for Help in French, which PaneManager doesn't recognize, so
lastSelectedTab_ stays on the previous tab, and a zoom the raise moves
takes that tab. In French, Search R Help during a Console zoom left Help
hidden. The Help commands now fire Help.bringToFront(), which names the
pane "Help", before raising HelpPane.

Before, on 110d402: "Search R Help during a Console zoom moves the
zoom to Help in French" fails (TabSet2 not exposed). After: it passes.
The test sets ui_language to fr, as the workbench syncs the LOCALE
cookie to it on load, and clears it afterwards.

Addresses #19184
The afterEach of the "Show pane commands reopen a column dragged shut"
tests drags the middle splitter home as soon as a test ends. After "a
plot reopens a column next to a wide sidebar", whose cleanup restores
and hides the sidebar, the drag started before the last layout pass in
one full run and missed the splitter (647px from home). It now waits for
the splitter to settle first, as the window-shrink tests' cleanup does.

All tests under tests/panes/layout, tests/panes/help and
tests/panes/debugger pass (162 passed, 5 skipped).

Addresses #19184
The ordering check in "history() while Files is zoomed leaves the zoom on
Files" read History's selection in a separate round trip after the zoom
command, so a history() landing in between, during the zoom, read as
having run first. The zoom command and the read now run in one page
evaluate.

Passes 3 of 3 runs.

Addresses #19184
"Search R Help during a Console zoom moves the zoom to Help in French"
cleared ui_language afterwards, which would leave a session that started
in French in English. It now records the language first and restores
it, clearing the pref when it was English, the default.

Passes, with the English Search R Help test.

Addresses #19184

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Round 4: both round-3 comments are fixed. The localized-title case for panes other than Help is tracked in #19234. One nit below.


// Ensure that the pane is visible (otherwise tab selection will fail)
if (!parent.visible())
// Ensure that the pane is visible (otherwise tab selection will fail).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nit: the first line of this comment no longer matches the code. When keepZoom is true, this skips the NORMAL transition and still calls panel.selectTab() on a HIDE pane further down. The new test 'history() while Files is zoomed' expects History to be aria-selected="true" while TabSet1 is still the zoomed pane's hidden partner, so selection in a hidden pane works on that path.

Either "otherwise tab selection will fail" is stale, or some tab type still relies on the transition, in which case the comment should name it and say why the keepZoom path is safe.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Stale. It dates from 2015 (bcc96c1) and doesn't name a failure. WorkbenchTabPanel.selectTab() doesn't check whether the pane is visible, and that test selects History in a hidden pane. Reworded in f8e7769: the transition is there so the selected tab can be seen, and during a pane zoom the tab is selected behind the zoom instead.

Selecting a tab in a hidden pane works (the 'history() while Files is
zoomed' test selects History behind the zoom), so the comment no longer
claims tab selection would fail.

Addresses #19184
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

#################### 100% pass rate

Passed Failed Skipped Flaky
4170 0 223 3
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 2 0 14 0
✅ desktop-linux 1045 0 42 1
✅ desktop-macos 1042 0 46 1
✅ desktop-windows 1044 0 49 1
✅ server-linux 1001 0 44 0
✅ setup 36 0 28 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 459c220b0990848752d4b943029827aec4856aba - Run #1641

@gtritchie
gtritchie merged commit fa17bc7 into main Oct 23, 2026
41 checks passed
@gtritchie
gtritchie deleted the bugfix/show-pane-reopens-shut-column branch October 23, 2026 19:40
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.

Show pane commands don't reopen a column dragged shut

1 participant