Skip to content

Restore pre-zoom column widths when ending a column zoom - #19359

Merged
gtritchie merged 4 commits into
mainfrom
bugfix/19201-zoom-restore-columns
Oct 30, 2026
Merged

gtritchie merged 4 commits into
mainfrom
bugfix/19201-zoom-restore-columns

Conversation

@gtritchie

@gtritchie gtritchie commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Fixes #19201.

Ending a column zoom (Zoom Sidebar, Zoom Left Column, Zoom Right Column) with Show All Panes, or through any other route into PaneManager.restoreLayout(), now returns every column to its width from before the zoom.

Previously restoreLayout() restored the saved widths only for a pane zoom. A column zoom fell back to restoreColumnLayout(), which left a sidebar the zoom had shut at 0px and sized the right column without accounting for the sidebar. In the issue's 1184px panel, that gave the right column 888px and Source/Console 0px.

Changes in PaneManager:

  • restoreLayout() restores the saved widths whenever a zoom recorded them, pane or column.
  • The zoom also records the panel width, and the saved widths are scaled by its change on restore (End Zoom, or re-running the zoom command). A window resized during the zoom gets widths that fit, as unzoomed columns do on resize.
  • fullyMaximizeWindow() records the source column widths only when no zoom already has. It used to append them again when a pane zoom followed a column zoom or moved between panes. That doubled the list, so End Zoom fell back to default widths for extra source columns.

Ending a column zoom discards splitter drags made during the zoom, as re-running the zoom command already did.

Tests (e2e/rstudio/tests/panes/layout/zoom_inert.test.ts). Each failed before the change that fixes it; the sidebar-on-the-right variants were not run before the fix:

  • End Zoom after each column zoom, with the sidebar on each side, restores the sidebar, Source/Console and TabSet widths.
  • End Zoom after the window shrinks during a zoom keeps each column's share of the width.
  • End Zoom after a column zoom followed by a pane zoom restores an extra source column.

tests/panes/layout/ passes in server-dev mode.

restoreLayout() only restored the pre-zoom snapshot for a pane zoom. A
column zoom fell back to restoreColumnLayout(), which left a sidebar the
zoom had shut at 0px and sized the right column without accounting for
the sidebar. After Zoom Sidebar on a 1184px panel that gave right_ 888px
and Source/Console 0px. Column zooms now restore the snapshot too.

Addresses #19201.
The zoom snapshot holds pixel widths taken at the panel width of the
time. If the window shrank while zoomed, ending the zoom reapplied them
unchanged and could shut the Source/Console column. Record the panel
width with the snapshot and scale the widths by its change on restore,
as the panel does to unzoomed columns on resize.

Addresses #19201.
fullyMaximizeWindow appended the source column widths to the zoom
snapshot whenever the list already matched the column count, so a pane
zoom on top of a column zoom (or a zoom moved between panes) doubled
the list. End Zoom then fell back to clamped default widths; with one
extra source column it came back 417px off its pre-zoom width. Record
the widths only when no zoom has, as zoomColumn does.

Also drop a restoreLayout condition that the width snapshot already
implies, and update comments that described the old restore paths.

Addresses #19201.
The column is removed only when its last tab closes, and its Untitled
doc arrives after the column does. Cleanup that ran first would leave
the empty column in place.

Addresses #19201.
@gtritchie gtritchie added this to the 2026.11 (Montauk Daisy) milestone Oct 29, 2026
@github-actions

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

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

Passed Failed Skipped Flaky
4651 0 239 1
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 4 0 16 0
✅ desktop-linux 1166 0 43 0
✅ desktop-macos 1162 0 47 1
✅ desktop-windows 1165 0 50 0
✅ server-linux 1106 0 51 0
✅ setup 48 0 32 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 7b596cf974a323880cd15be2c43b8e4e356d4687 - Run #1828

@gtritchie
gtritchie merged commit 4c93869 into main Oct 30, 2026
45 checks passed
@gtritchie
gtritchie deleted the bugfix/19201-zoom-restore-columns branch October 30, 2026 15:32
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 All Panes after Zoom Sidebar leaves the left column collapsed

1 participant