Repository navigation
Restore pre-zoom column widths when ending a column zoom - #19359
Merged
Merged
Conversation
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.
RStudio E2E - all platformsAll tests passed!
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 |
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.
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 torestoreColumnLayout(), 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.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:tests/panes/layout/passes in server-dev mode.