Repository navigation
Fix missing Find button and long-path overflow in the Console pane - #19790
Merged
Merged
Conversation
With the Console as the only tab in its pane, its toolbar buttons were absolutely placed over a title bar row that spanned the full width, so a long working directory path ran underneath them. The buttons now sit in that row after the path, which shrinks with an ellipsis. Addresses #19785.
In a console-only pane too narrow for the title bar row, the row overflowed at its right end, putting Find and Clear over Minimize and Maximize (at a 174px pane, Clear spanned 153-177 over Maximize at 157-181). It now overflows at its left end, which is clipped, and Clear ends at 127, before Minimize at 133. Addresses #19785.
With other tabs in the Console pane, a long working directory path widened the Console toolbar's table past the pane, which clipped the working directory, Find, and Clear buttons (in a 406px pane they were at 1127-1189). Toolbar.setLeftWidgetShrinkable() now lets the path's cell take only the width to spare, and the path shortens with an ellipsis, so those buttons end at 411. Addresses #19785.
A terminal's title is usually its working directory, and a long one widened the Terminal toolbar's table past the pane, which clipped the Clear and Close buttons (in a 512px pane they were at 1176-1213). The title now takes only the width to spare and shortens with an ellipsis, so Close ends at 517. Addresses #19785.
The Console working directory, in the title bar and the toolbar, and the Terminal title can now be shortened with an ellipsis. Each now has a tooltip with the full text, which mouse users otherwise had no way to read. Addresses #19785.
The clip on the left toolbar cell, used when a shrinkable widget can't shrink further, also cut off focus outlines extending past controls at the cell's edges. It now clips with a 2px margin, the outline's overhang. overflow-clip-margin takes effect only when both axes clip, so the cell now clips vertically too, within the same margin. Addresses #19785.
WebKit doesn't support overflow-clip-margin, so in Safari the cell's overflow: clip cut off focus outlines on all four sides (a probe in WebKit 26.5 found no hit 1px outside a clipped box with a 2px margin; Chromium 149 and Firefox 151 found one). The cell now uses clip-path: inset(-2px 0 -2px -2px), which clips only at its right edge, where its widgets overflow, and leaves 2px elsewhere in all three engines. Addresses #19785.
RStudio E2E - all platformsAll tests passed!
All platforms - commit |
The test counted non-empty lines of the whole Console panel, so the toolbar's text counted against its allowance of 10 lines over the limit. With the working directory and its button now sharing one shrinkable toolbar cell, the panel adds one more line and a limit of 50 read as 61. Counting the scrollback element alone checks just the output the limit applies to. Addresses #19785.
gtritchie
commented
Nov 23, 2026
When the Console is the only tab in its pane, the Go to Working Directory button sits in the header next to the path, outside the group of buttons on the right. A click on it still reached the header's click handler, which focused the pane, and a double click maximized the Console. The handler now ignores clicks inside any button in the header; clicks on the title, path, or empty space still focus and maximize the pane. Addresses #19785.
With a long working directory, the tests check that the path is shortened with an ellipsis and that it and the pane's buttons sit in order, without overlap, inside the pane. They do this both when the Console shares its pane with the Terminal tab and when it is the only tab, where Find in Console must also be in the header. A third test checks that double-clicking the header's Go to Working Directory button leaves the pane at its size, while double-clicking the path still maximizes it. Addresses #19784. Addresses #19785.
In RStudio Pro, show_launcher_jobs_tab defaults to true when Workbench Jobs is available, which keeps the Console tabbed. The console-only test now turns it off, restores it afterwards, and waits for the Console's own tab to disappear, which happens only in console-only mode, before it measures the header. Addresses #19784. Addresses #19785.
The e2e suite doesn't run against Workbench, where the Workbench Jobs tab would keep the Console tabbed, so the test doesn't need to turn show_launcher_jobs_tab off. It still waits for the Console's own tab to disappear before measuring the header, to confirm console-only mode. Addresses #19784. Addresses #19785.
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 #19784.
Fixes #19785.
Console as the only tab in its pane
WindowFrame.setContextButton(), its button box, and the size getters on the Console button classes are removed, since nothing else used them.Console pane with other tabs
Toolbar.setLeftWidgetShrinkable()lets one left widget take only the toolbar's spare width. The Console toolbar's working directory and the Terminal toolbar's title use it, so a long path or title shortens with an ellipsis instead of pushing the toolbar's buttons past the pane's edge. If even the shortened widget doesn't fit, the left side is clipped at its right edge withclip-path, which leaves 2px for focus outlines on its other sides.The shortened path and title show their full text in a tooltip.
Testing
e2e/rstudio/tests/panes/console/console_header_buttons.test.tssets a long working directory and checks, with the Console as the only tab and with the Terminal tab open, that the path is shortened and that it and the pane's buttons sit in order inside the pane, with Find in Console in the header when the Console is the only tab. It also checks that double-clicking Go to Working Directory in the header doesn't maximize the pane. Run against the code before these fixes, with only the tooltips added so the tests can find the path, the tabbed check fails with the path running past the pane's edge, the console-only check fails with Find in Console missing, and the double-click check fails with the pane maximized.console_max_lines.test.tsnow counts only the scrollback's lines, since its count of the whole panel included the toolbar's text.Checked manually on RStudio Server with a working directory nested 12 levels deep: