Repository navigation
Make panes hidden by zoom inert - #19182
Conversation
Focus a tabbed pane's selected tab directly instead of through focusWindow(), which assumes a selected tab. Restore the column splitter after the splitter test, and cover zooming a tab from a sibling tab. Addresses #19181.
A sidebar with no tabs is the default when Posit Assistant is off. Zooming it from the Console left focus on the page body; focus the empty state's first control instead. Addresses #19181.
An emptied tabset can be reopened from its minimized bar with no tab to focus. A column zoom now moves focus to a pane in the zoomed column that has a tab, falling back to the topmost one. The focus tests now set up Console focus with focusConsole(), which retries when focus is stolen. Addresses #19181.
Uncheck whichever tabs the Pane Layout dialog shows rather than naming Posit Assistant, whose checkbox is hidden when the server disables it, and run setup inside the cleanup block. Addresses #19181.
With every tab moved out of the right column, TabSet1 stays open with no tab or empty state, so a column zoom from the Console left focus on the page body. Focus the pane's first frame button instead. Addresses #19181.
updateCollapsedColumns runs on every layout pass, splitter drags included, so skip columns whose state is already correct. Addresses #19181.
focusPane sent the Console pane through focusWindow, which always runs activateConsole and so switched a pane showing Terminal or Background Jobs back to its Console tab. Focus the selected tab instead, or the console itself when it has no tab bar. Also look up the column zoom's focus target only when the zoom hid focus, and wrap two long lines. Addresses #19181.
TerminalPane.setFocus() is a no-op: the terminal focuses itself only when its tab is selected. A column zoom that moved focus into a Console pane showing Terminal left it on the page body. Fall back to the pane's first control, the selected tab. The test now waits for the shell to start, which the previous version raced, and kills it afterwards. Addresses #19181.
Code review findingsActionable items from an automated review of 84c75ba. Each finding is marked new (introduced by this PR) or pre-existing. Important
Suggestions
|
Every hide a zoom applies is either an inert column or an inline display:none, which the existing helper already detects, so the new hasLayoutBox helper is dropped. Addresses #19181.
A mouse drag of a splitter, or a window shrink, can collapse the column that holds focus; the splitter takes no focus on mousedown. Once the column is inert the browser drops focus to the page body. MainSplitPanel now reports such a collapse, and PaneManager focuses the widest column. That also covers column zooms, so zoomColumn() no longer needs its own rescue. Addresses #19181.
With a pane zoomed, zooming another of its tabs only switches tabs, and the switch hid the focused content without moving focus anywhere. Addresses #19181.
|
Addressed in 75759bb..92944df:
|
A window resize first lays out the old column sizes at the new width, which can briefly squeeze the fill column shut. Marking it inert then dropped its focus, or moved focus to another column, though the deferred proportional layout reopened it. Addresses #19181.
|
Follow-up to the earlier reply: 139d4d4 fixes a race in the focus move for finding 1. On a window resize, the layout first keeps each column's old width at the new window width, so the center column could drop below 20px for a moment, until a deferred layout applied the proportional widths. The column went inert in that window, and its focus was lost or moved to the right column even though the column then reopened. A new test, "shrinking the window keeps focus in a narrow column that stays open", drags the center column narrow, focuses the Console, halves the window, and checks that focus stays in the Console. It fails without the fix. The layout and terminal e2e suites pass (73 passed, 3 skipped). |
Re-review of 139d4d4All six findings from the earlier review are addressed:
I also reviewed the new code for regressions and found none. That includes adding This re-review covered the code only; I did not run the e2e suites. |
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 |
Fixes #19181.
A column collapsed by a zoom command, or dragged shut with a column splitter, stayed in the accessibility tree and the Tab order. Its panes are now inert.
Inert columns
MainSplitPanelmarks a column's layout containerinert(witharia-hidden) while the column is narrower than 20px, and clears it once the column widens. It checks after every layout pass and at the end of every animated resize. That covers:Splitters sit outside the containers, so they stay reachable.
Quadrants needed no change: a maximized pane's sibling, or a quadrant snapped shut with the row splitter, is already
display:none.Focus
When a zoom, splitter drag or window resize hides the element that has focus, the browser would drop focus to the page body.
PaneManagerinstead moves it to a pane that is still showing:MainSplitPanelreports it, and focus goes to the topmost visible pane with a tab in the widest column, falling back to the topmost visible pane.Focus is left alone when the focused element stays visible, or when something else moved focus during the zoom.
Tests
e2e/rstudio/tests/panes/layout/zoom_inert.test.tscovers the accessibility tree and inert state for:It also covers focus after zooms that hide the focused pane, quadrant, or tab, after a mouse drag or window shrink that shuts the focused column, and after zooming another tab of a zoomed pane.
panes.test.tsadds the empty-sidebar and empty-tabset focus cases, which need the Pane Layout dialog.