Skip to content

Fix missing Find button and long-path overflow in the Console pane - #19790

Merged
gtritchie merged 16 commits into
mainfrom
bugfix/console-only-find-button
Nov 23, 2026
Merged

gtritchie merged 16 commits into
mainfrom
bugfix/console-only-find-button

Conversation

@gtritchie

@gtritchie gtritchie commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Fixes #19784.
Fixes #19785.

Console as the only tab in its pane

  • The title bar now shows Find in Console, to the left of Clear Console, as the Console toolbar does when other tabs are open.
  • Interrupt Profiler, Interrupt, Find in Console, and Clear Console are now in the title bar row itself, after the working directory, instead of in a separately positioned box over it. A long path shortens with an ellipsis and no longer draws over these buttons or Minimize/Maximize. In a pane too narrow for the row, it overflows at its left end, which is clipped, so the buttons stay clear of Minimize/Maximize. Clicks on these buttons, and on Go to Working Directory beside the path, no longer also trigger the title bar's own handler, which moved focus to the Console and maximized the pane on a double click. Tab order now matches the left-to-right order on screen.
  • 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 with clip-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.ts sets 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.ts now 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:

  • Console only: title bar layout and button order, path ellipsis at pane widths from 1047px down to 174px, Interrupt appearing while R is busy, Find opening the find bar with focus in it, double-clicking a button not maximizing the pane, switching to and from tabbed mode, and the Modern, Sky, and Cobalt themes.
  • With other tabs: Console and Terminal toolbars fitting their panes with a long path or title in Chromium, Firefox 151, and WebKit 26.5, at pane widths of about 510px and 280px (and down to 170px in Chromium), including after View > Move Focus to Terminal from the console-only layout.

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.
The comment said these buttons replace the Console toolbar, which also
has the session suspend icons; those are #19789.

Addresses #19785.
@gtritchie gtritchie added this to the 2026.12 (Parrot Balsam) milestone Nov 22, 2026
@gtritchie
gtritchie requested a review from kevinushey November 22, 2026 17:36
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

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

Passed Failed Skipped Flaky
5820 0 254 2
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 4 0 16 0
✅ desktop-linux 1456 0 49 0
✅ desktop-macos 1462 0 43 1
✅ desktop-windows 1451 0 60 0
✅ server-linux 1399 0 54 1
✅ setup 48 0 32 0

View report online


All platforms - commit 5021adcec526bec372f917c1da27b99dd3908a70 - Run #2478

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 gtritchie left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two findings below: a gap in the new header click guard (behavior that predates this PR) and missing tests. The missing suspend icons in the Console-only header are already tracked in #19789.

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.
@gtritchie
gtritchie merged commit 2958c9c into main Nov 23, 2026
49 checks passed
@gtritchie
gtritchie deleted the bugfix/console-only-find-button branch November 23, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Long working directory path hides or overlaps the Console pane's buttons Find in Console button is missing when the Console has no other tabs

1 participant