Skip to content

Fix Focus Next/Previous Pane around the sidebar - #19203

Merged
gtritchie merged 12 commits into
mainfrom
bugfix/f6-sidebar-focus-cycle
Oct 21, 2026
Merged

gtritchie merged 12 commits into
mainfrom
bugfix/f6-sidebar-focus-cycle

Conversation

@gtritchie

Copy link
Copy Markdown
Member

Focus Next Pane (F6) got stuck on TabSet2: the default layout lists the sidebar in the pane cycle, and with no focus case for it, F6 refocused TabSet2. F6 also did nothing inside a sidebar shown after page load, because the pane list kept the sidebar window that showing it replaced.

F6 and Shift+F6 now cycle through the four quadrants, then the sidebar:

  • A hidden sidebar is skipped, and F6 never shows it.
  • A sidebar shut by a zoom or a splitter drag is skipped too; focus can't enter it.
  • A showing sidebar is reached from TabSet2 and left to Source. F6 focuses its selected tab, or Configure Panes when it has no tabs (the Workbench default with Posit Assistant off).

Tests, in focus_adjacent_pane.test.ts and panes.test.ts: hidden sidebar skipped in both directions, sidebar shown after load, sidebar shut by a zoom, and F6 into and out of an empty sidebar.

The empty-sidebar zoom test in panes.test.ts now restores the Console column width when it finishes. Ending a sidebar zoom can leave that column collapsed (#19201), which carried into the next test.

Follow-up: #19202 (panes_ keeps a replaced sidebar window).

Fixes #19191.

F6 cycled through panes_, which lists the sidebar only when the quadrants
pref does, and keeps the sidebar window that showSidebar() replaces.
focusWindow() had no Sidebar case, so F6 from TabSet2 refocused TabSet2,
and F6 inside a sidebar shown after load did nothing.

Cycle through the quadrants plus the live sidebar window when it is
showing, so a hidden sidebar is skipped rather than shown, and focus the
sidebar's selected tab (or its empty state) when F6 reaches it.

Addresses #19191.
A zoom or splitter drag can shut the sidebar's column while it stays
showing, which makes its panes inert. F6 still stopped at the sidebar,
could not focus it, and left focus on TabSet2. Leave a collapsed sidebar
out of the cycle, as a hidden one is.

Addresses #19191.
An empty sidebar is the Workbench default, where Posit Assistant is off.
Start the shown-after-load test from the sidebar's Configure Panes button
when it has no tabs, and add a test that F6 reaches an empty sidebar and
Shift+F6 leaves it.

Addresses #19191.
Ending a sidebar zoom can leave the Source/Console column collapsed
(#19201), and the collapsed width persists into later tests: the next
test started with Console 0px wide. Move the middle splitter back to the
Console width the test started with, and fail if it doesn't get there.
Skip the sidebar when panesByName_ has no window for it, as getFocusTargetIn does, rather than putting null in the cycle.

Addresses #19191.
restoreConsoleWidth read the Console width right after each key press,
before that step's layout could land, so it could overshoot. Wait for the
width to settle before each read. Check the restored width after the
try/finally instead of inside it, so a failed restore can't replace the
error from a failed test body.
afterEach always hid the sidebar, which saves the preference, so a run
that started with the sidebar visible ended with it hidden for later spec
files. Record the visibility in beforeAll and restore that instead.
The splitter lays out on a later turn, so two equal readings taken right
after a key press could both be the old width, and restoreConsoleWidth
would press again and overshoot. Wait for the width to change before
waiting for it to settle, and stop when a press can't move the splitter.
A zoom left by an earlier spec can shut a sidebar that is showing, so
checking whether it renders recorded it as hidden, and cleanup then saved
the sidebar as hidden. Use the toggleSidebar command's checked state,
which follows the preference.
A step that took over a second to lay out on a slow machine was treated
as the splitter being at its limit, which ended the restore early. Wait
as long as waitForStableWidth does (5 seconds) before giving up.
beforeAll runs before the per-test reset's readiness gate, so it could
read the toggleSidebar command while a previous spec's reload was still
initializing: before the bridge exists, or before the command is checked.
Wait for window.rstudio.ready first, as resetForNextTest does.
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

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

Passed Failed Skipped Flaky
3854 0 200 10
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 2 0 10 0
✅ desktop-linux 966 0 42 2
✅ desktop-macos 971 0 37 3
✅ desktop-windows 965 0 47 4
✅ server-linux 922 0 44 1
✅ 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 9af9c054feb5869a24c99d3422cc61cfb49262ba - Run #1576

@gtritchie
gtritchie merged commit 283c5c5 into main Oct 21, 2026
1 check passed
@gtritchie
gtritchie deleted the bugfix/f6-sidebar-focus-cycle branch October 21, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Focus Next Pane gets stuck on TabSet2 and never reaches the sidebar

1 participant