Repository navigation
Fix Focus Next/Previous Pane around the sidebar - #19203
Merged
Merged
Conversation
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.
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.
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:
Tests, in
focus_adjacent_pane.test.tsandpanes.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.tsnow 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.