Skip to content

e2e: cover reopening shut columns in other pane layouts #19232

Open

Description

@gtritchie

The tests for #19184 (PR #19231) in e2e/rstudio/tests/panes/layout/zoom_inert.test.ts all run in one layout: sidebar on the left, Console/Source in the left column, no extra source columns. Run a subset of those scenarios in other layouts, to find problems that layout-specific code may hide.

Layouts, most likely to find something first:

  1. Sidebar on the right. The zoom code has separate paths for each side (resizeHorizontallyWithSidebarOnRight vs ...OnLeft in PaneManager). getZoomedColumn() also has a right-side case, whose comment says right_ "is added with add() not addEast()" when the sidebar is on the right, while MainSplitPanel.initialize() docks it with addEast() either way.
  2. Extra source columns. No current test uses them. A source column is a column of its own (leftList_), so it can be the shut column or the donor. Activating one goes through SourceColumnManager, not activateTab().
  3. Console/Source in the right column. The reopen code finds a column by DOM containment, so placement shouldn't matter to it. What Zoom Left/Right Column hides does change, though.

Scenarios to run in each layout:

  • Show command (e.g. Show Files) and a pane raising itself (a plot, Move Focus to Console) reopen a column dragged shut.
  • The donor gives only what the reopened column gains, including with the sidebar as the donor.
  • Ending a zoom of a tab in a shut column leaves the column shut.
  • A pane raising itself during a column zoom ends the zoom.

The current tests assume Console is in the left column (e.g. dragging the middle splitter to x=1 shuts it), so they would need to find the right splitter and pane for each layout. Layout changes go through the panes pref and need restoring after each test.

Activity

  1. self-assigned this
    on Oct 22, 2026
  2. added theissue type on Oct 22, 2026
  3. gtritchie commented on Oct 22, 2026

    @gtritchie
    MemberAuthor

    A case to cover with the sidebar on the right, found while addressing review on #19231.

    With the sidebar visible and on the right, Zoom Left Column, then End Zoom (or, with #19231, Show Files). The right column comes back, but Zoom Left Column stays checked. Seen with End Zoom on branch code from before Show commands ended a column zoom; not re-checked on main.

    Likely cause: PaneManager.getZoomedColumn() reads right_.getOffsetWidth() when the sidebar is on the right, citing right_ being added with add() rather than addEast(). restoreColumnLayout() sets the restored widths and calls manageLayoutCommands() before the next layout pass, so the drawn width is still 0. MainSplitPanel always adds right_ with addEast() (and zoomColumn() says "right_ is always EAST"), so panel_.getWidgetSize(right_) should work for both sidebar locations.

    Repro, written for zoom_inert.test.ts in the "Show pane commands reopen a column dragged shut" block; it fails at the last expect.poll:

    test('Show Files during a column zoom ends it with the sidebar on the right', async ({
      rstudioPage: page,
    }) => {
      await setSidebarVisible(page, true);
      await executeCommand(page, 'toggleSidebarLocation');
      try {
        await executeCommand(page, 'layoutZoomLeftColumn');
        await expectHidden(page, TABSET2_PANE);
        await expect.poll(() => isCommandChecked(page, 'layoutZoomLeftColumn')).toBe(true);
    
        await executeCommand(page, 'activateFiles');  // or 'layoutEndZoom'
        await expectExposed(page, TABSET2_PANE);
        await expect.poll(() => isCommandChecked(page, 'layoutZoomLeftColumn')).toBe(false);
      } finally {
        await resetLayoutZoom(page);
        await executeCommand(page, 'toggleSidebarLocation');
        await setSidebarVisible(page, false);
      }
    });
  4. gtritchie commented on Oct 22, 2026

    @gtritchie
    MemberAuthor

    Another case for the extra-source-column layouts, from review of #19231 (found from code; not yet reproduced by hand):

    With an additional source column open, moving a pane zoom from one pane to another loses the pre-zoom widths when the zoom ends.

    PaneManager.fullyMaximizeWindow() records widgetSizePriorToZoom_ and sidebarSizePriorToZoom_ only when they are unset. leftWidgetSizePriorToZoom_ is cleared only when its size differs from leftList_, so a second fullyMaximizeWindow() during the same zoom appends another set of widths, the zoom-time ones. When the zoom ends, restoreLayout() sees leftList_.size() != leftWidthsPriorToZoom.size() and falls back to restorePaneLayout(), which puts back computed widths instead of the saved ones.

    Any zoom transfer reaches this:

    Sequence to test: open an extra source column, Zoom Console, Zoom Files (or Show Files), End Zoom. The source column and middle splitter should be back where they were before Zoom Console.

    Likely fix: in fullyMaximizeWindow(), record the left widths only when none are recorded yet, as the right and sidebar widths are. Keep computing leftTargets either way.

  5. gtritchie commented on Oct 23, 2026

    @gtritchie
    MemberAuthor

    More layout cases from the third review round of #19231. Its zoom tests assume the default quadrants: Files, Plots and Help in TabSet2, Environment and History in TabSet1, TabSet1 above TabSet2 in the right column. Worth covering with tabs moved:

    • Partner vs. separate column: with History and Files in the same column, history() (an ActivatePaneEvent) during a Files zoom must select History without showing its pane. With them in different columns, it selects History in a 0px column. Either way the zoom stays on Files.
    • Show for a pane hidden by a zoom: Show Files during a zoom of a pane in Files' own column (partner) and in another column. Both should move the zoom to Files.
    • Help elsewhere: Search R Help during a Console zoom with Help in the left column, or as Console's partner.
  6. gtritchie commented on Oct 27, 2026

    @gtritchie
    MemberAuthor

    Nice to have, moving to next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions