Skip to content

Make pane toolbar buttons 24px targets (WCAG 2.5.8) - #19830

Merged
gtritchie merged 10 commits into
mainfrom
bugfix/pane-toolbar-target-size
Nov 28, 2026
Merged

gtritchie merged 10 commits into
mainfrom
bugfix/pane-toolbar-target-size

Conversation

@gtritchie

@gtritchie gtritchie commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Intent

Addresses #19786.

Fixes the axe WCAG 2.5.8 (Target Size, Minimum) findings in the pane toolbars and the Files breadcrumb. Split-button arrows are not changed here; they are to be handled separately.

Approach

Toolbar buttons

  • The main toolbar's rules from Make toolbar controls 24px targets (WCAG 2.5.8) #19798 now apply to every toolbar: buttons are at least 24×24 (they were 21px tall and as narrow as 14px), with 2px side padding in place of their 4px or 8px right margins. Icon buttons narrower than 20px take up to 6px more width; labelled buttons take 4px less.
  • The main toolbar's own layout is unchanged.
  • When Console is the only tab in its pane, its Find, Clear and Go to working directory buttons sit in the pane header instead of a toolbar. They are 24×24 there too (were 14×21, 20×21 and 20×21).

Toolbar rows

  • A toolbar's layout slot is 25px (was 22px), showing 24px of toolbar over its 1px border, as SecondaryToolbar did since Make toolbar controls 24px targets (WCAG 2.5.8) #19798. Each toolbar row takes 3px from its pane's content.
  • SecondaryToolbar's height override and the tallerToolbarWrapper class are folded into Toolbar.

Pane minimize/maximize/close buttons

  • These 24px buttons started 2px below the top of the window frame, so their last 2px covered the top of the toolbar row and took its clicks. Toolbar buttons under them had 22px of clickable height. They now start at the top of the frame and end where the title bar does. Icons keep their position. The console-only frame's buttons were already at the top and are unchanged.

Files breadcrumb

  • "Go to project directory" (was 20×22.5) and "Go to directory" (was 20×20) are 24×24 in the Files pane, in a 48px frame (was 42px). File dialogs share the widget: their buttons take the 24px width but keep the dialog breadcrumb's 20px height.

Offsets tuned for the old row, removed or replaced:

  • Source: the forward button's -6px margin (it now overlapped back), the Knit button's inline margins, a 2px top margin on the Source/Visual toggle
  • Environment: the language menu's own 24px sizing, the memory menu's -3px margin
  • Help: the find box's -1px offset; Find Previous / Find Next are 24×24 (were 19×18)
  • Second-row toolbars: a 2px offset on search boxes
  • Connections actions with no icon (-5px), the Quarto presentation slides menu (-3px), the Shiny and Plumber windows' Reload (1px), compile output's View Log (3px)
  • Packages: a Windows-only 2px lift on text-only buttons
  • The file viewer's toolbar height override (23px), and Options > Pane Layout's 20px toolbar wrapper (now 24px)
  • A toolbar checkbox gets a 3px left margin, keeping its center 12px from a button before it
  • A button with no icon gets an icon's height, so its label lines up with its neighbors' (it sat 3px lower)

Narrow panes

  • The width breakpoints that drop labels or hide buttons (Source, visual editor, Git, Files, Environment) are unchanged. Measured from about 280px to 700px wide, Environment, Files, Git and the visual editor have the same or more room at each breakpoint.
  • The Source toolbar overflows at some widths on main (an R Markdown file at about 600-685px, a Markdown file at most widths). Here it overflows by the same amount or less, except a C++ file below 300px, which is 2px worse.

Still open on #19786: split-button arrows, the search boxes' clear button, Git's Staged/Status headers, the Packages list checkboxes, and the breadcrumb buttons in file dialogs.

rstudio-pro: Pro's toolbars inherit the shared rule and have not been checked.

Automated Tests

Adds e2e/rstudio/tests/toolbar/pane_toolbar_target_size.test.ts, which runs axe-core's target-size rule on the Environment, Files and Console toolbars and the Files breadcrumb, and fails on any violation or Needs Review result. The one split-button arrow in those toolbars is excluded from the scan. It fails against main's GWT code (11 findings) and passes here. It runs on Server only, like the suite's other axe tests.

Also run on Server (macOS): the toolbar specs, files_list_target_size, files_narrow_resize, and the panes and tabs layout specs; all pass. ant unittest was not run.

QA Notes

Measured on RStudio Server (Chrome, macOS, default theme) with axe-core 4.13's target-size rule: Environment, History, Connections, Git, Tutorial, Files, Plots, Packages, Help, Viewer, Presentation, Console and Terminal tabs, Source toolbars for R, R Markdown, Quarto, Markdown, C++, Python, TeX and SQL files, the visual editor toolbar, the Git review window, and the console-only frame. The only remaining toolbar findings are the split-button arrows.

Windows was checked only by adding the windows body class in that browser, which exercises the Windows CSS rules but not Windows fonts or rendering.

Not checked: Desktop, real Windows, Linux, dark themes, the Build and Jobs tabs, and satellite windows other than Git review. These fixes were made by reading the code and not seen running: the file viewer toolbar, Connections actions with no icon, the Quarto presentation slides menu, the Shiny and Plumber windows' Reload, compile output's View Log, and the Packages text-only buttons.

To check by hand against a release build: pane toolbars are 3px taller with the same icons and labels; buttons at a toolbar's right edge respond to clicks across their full height; the Files breadcrumb's project and "..." buttons are slightly larger.

Documentation

N/A

Checklist

  • If this PR adds a new feature, or fixes a bug in a previously released version, it includes an entry in NEWS.md
  • If this PR adds or changes UI, the updated UI meets accessibility standards
  • A reviewer is assigned to this PR (if unsure who to assign, check Area Owners list)
  • This PR passes all local unit tests

The 24px minimize, maximize and close buttons started 2px below the top of
the window frame, so their last 2px lay over the top of the toolbar row and
took its clicks there. A toolbar button under them had 22px of clickable
height. axe measured a safe clickable space of 20px for the Files pane's
refresh button, where 24px is needed.

The buttons now start at the top of the frame (top 2px -> 0) and end where
the title bar does. Each 14px icon keeps its position: it is drawn 7px from
the top of its button, where centering put it 5px.

Addresses #19786
In the Files pane, "Go to project directory" was 20x22.5 and "Go to
directory" (...) was 20x20, in a 42px frame at the end of the 24px
breadcrumb row. axe reported both as WCAG 2.5.8 violations.

Both are now 24x24 there, in a 48px frame, with the project icon centered
in its button (it sat 1px from the top). File dialogs share the widget:
their buttons take the same 24px width but keep the dialog breadcrumb's
20px height.

Addresses #19786
The main toolbar's button rules from #19798 now apply to every toolbar:
buttons are at least 24x24 (they were 21px tall and as narrow as 14px), with
2px side padding in place of their 4px or 8px right margins. Split-button
arrows keep their 5x21 size; they are to be handled separately.

Toolbar rows grow to fit: the slot is 25px (was 22px), showing 24px of
toolbar over the 1px border, as SecondaryToolbar already did. Its height
override and the tallerToolbarWrapper class are folded into Toolbar.

Offsets that positioned controls in the old row are removed or replaced:
- Source: the forward button's -6px margin, which now overlapped back by
  6px, and the Knit button's inline margins
- Source/Visual toggle: a 2px top margin that pushed it out of the row
- Environment: the language menu's own 24px sizing and the memory menu's
  -3px margin, which put it 1.5px above the row
- search boxes in second-row toolbars: a 2px offset (and Help's -1px
  override) that left them off center
- a toolbar checkbox gets a 3px left margin, keeping its center 12px from
  a button before it
- a button with no icon gets an icon's height, so its label lines up with
  its neighbors' (it sat 3px lower)

Addresses #19786
Runs axe-core's target-size rule on the Environment, Files and Console
toolbars and the Files breadcrumb, failing on violations and Needs Review
results alike. Split-button arrows (5x21) are skipped; they are still open
on the issue.

Addresses #19786
Found in review of the 24px toolbar change:

- Windows, Server: the main toolbar took a 1px top margin it didn't have
  before (0 -> 1px), hiding its last pixel row. That rule is removed, with
  the older Windows rule it had made redundant.
- The file viewer's toolbar (Git/SVN history) reserved 23px for a 25px
  toolbar; it now uses Toolbar's height.
- The Traceback panel's minimize icon, a 14x20 button that shares the
  window frame styles, was drawn 7px down like the 24px title bar
  buttons. That offset now applies only to WindowFrame's own buttons.
- Options > Pane Layout: the column toolbar's wrapper was 20px for 24px
  buttons (now 24px).
- Inline offsets that placed a button in the old row are removed:
  Connections actions with no icon (-5px), the Quarto presentation
  slides menu (-3px), the Shiny window's Reload (1px), View Log (3px).
- The Packages pane's Windows-only 2px lift for text-only buttons is
  removed; every icon-less button's label is now leveled by the shared
  rule.
- The Git diff toggle's even padding, which the shared rule overrode, is
  restored. Its 19px height and the visual editor toolbar's 20px height
  and margins were also overridden, and are deleted.

Addresses #19786
A toolbar checkbox gets its 3px left margin on Windows at standard DPI,
as it already has on macOS, Linux and high-DPI Windows. Without it the
checkbox's center was 9.5px from a button before it, where 12px is needed;
with the Windows body class simulated it is now 12.5px.

Help's Find Previous and Find Next buttons, shown while searching a topic,
are 24x24 (were 19x18).

Addresses #19786

@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.

One issue to fix before merging (the console-only header icons) and three nits. From reading the code at 60c5646; not built or run.

/* WindowFrame sizes its title bar buttons to 24px targets that fill the
title bar's height. Each 14px icon sits 2px below center, level with the
tab labels. */
.windowFrameObject > div > .minimize,

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.

This rule also matches the console-only frame (Console as the only tab in its pane). There the button layers were already at top: 0 via .windowFrameObject.consoleOnlyWindowFrame .consoleMinimizeLayout / .consoleMaximizeLayout, so the 7px offset isn't compensating for FRAME_BUTTON_TOP going from 2 to 0: the Minimize and Maximize icons move from y=5..19 to y=7..21 and sit 2px below the header's other buttons.

Suggest restoring background-position: center for .windowFrameObject.consoleOnlyWindowFrame > div > .minimize / .maximize, or scoping the 7px rule to frames that aren't console-only. Not seen running.

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.

Fixed in cfe3660: the console-only frame keeps background-position: center. Checked running with Console as the only tab: the maximize button is 24x24 at the top of the frame with its icon centered.

Checking that layout showed something else: Find in Console (14x21), Clear console (20x21) and Go to working directory (20x21) sit in that frame's header, not in a toolbar, so the shared rule missed them. The same commit makes them 24x24; the frame scans clean with axe's target-size rule.

refreshButton_ =
commands.reloadShinyApp().createToolbarButton();
refreshButton_.setLeftImage(commands.viewerRefresh().getImageResource());
refreshButton_.getElement().getStyle().setMarginTop(1, Unit.PX);

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.

Nit: PlumberAPIPanel.java:65 has the same line (refreshButton_.getElement().getStyle().setMarginTop(1, Unit.PX)) and still has it. As an inline style it overrides the new .toolbar .toolbarButton { margin-top: 0 }, so the Plumber window's Reload button would sit 1px lower than its neighbors in the 24px row. Remove it there too.

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.

Fixed in f0bd230. No other toolbar button has an inline top or bottom margin left.


// Buttons the scan has to have measured, as they appear in axe's selector
// or HTML for the node.
const EXPECTED_TARGETS = [

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.

Nit: "Go to project directory" isn't among the expected targets, so the .projectButton sizing and the 2 * BUTTON_WIDTH frame aren't required to be scanned. The button is only added when a project is active; a case with a project open, expecting that button, would cover it.

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.

Not done. Opening a project in a spec restarts the session, which is a lot of run time for one button. Measured by hand instead, in a session with a project open: the button is 24x24 and the Files pane scans clean. Glad to add the case if you'd rather have it covered.

// A split button's dropdown arrow is still 5x21; its design and target size
// are tracked separately on #19786.
function isSplitButtonArrow(node: NodeResult): boolean {
return messages(node).some((message) => message.includes('(5px by 21px'));

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.

Nit: this exempts by the measured size in axe's message rather than by element, so any other 5x21 target in these toolbars is exempted too, and the arrows stop being exempted if they ever measure differently. Matching the arrow's class in node.html, or excluding its selector in the AxeBuilder, would tie the exemption to the element.

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.

Fixed in 92cef87, by excluding the element in the AxeBuilder: the three scanned panes have one split-button arrow, Environment's refresh options ([id^="rstudio_mb_refresh_opts"]). Matching the class in node.html wouldn't work, since axe truncates the class attribute there (class="org-rstudio-core-cli...").

@gtritchie gtritchie added this to the 2026.12 (Parrot Balsam) milestone Nov 27, 2026
When Console is the only tab in its pane, the frame shows a header in
place of a tab strip and toolbar:

- Its maximize and minimize buttons were already at the top of the frame,
  so the 7px icon offset added for the other frames would have drawn their
  icons 2px low. They keep their centered icons.
- Find in Console (14x21) and Clear console (20x21) sit in that header,
  not in a toolbar, so the shared 24px rule missed them. They are 24x24
  now, as is Go to working directory (was 20x21).

Addresses #19786
Its inline 1px top margin, the same one removed from the Shiny window's
Reload button, set it 1px below its neighbors in the 24px toolbar row.

Addresses #19786
The test skipped any target axe measured as 5x21. It now excludes the one
split-button arrow in the scanned toolbars, Environment's refresh options,
by id.

Addresses #19786
The header centers its content in a 19px row under 4px of top padding, so
its 24px buttons ran 1.5px past the header's bottom edge, where the console
covered them. A -3px top margin lays each button out as 21px tall, as it
was before, so it spans the header exactly (69..93 where the header is
69..93), and 3px of top padding keeps its icon where it was.

Hit-tested: each button takes clicks across its full 24px height.

Addresses #19786
@github-actions

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

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

Passed Failed Skipped Flaky
5877 0 254 1
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 4 0 16 0
✅ desktop-linux 1469 0 49 0
✅ desktop-macos 1476 0 43 0
✅ desktop-windows 1463 0 60 1
✅ server-linux 1417 0 54 0
✅ setup 48 0 32 0

View report online


All platforms - commit b7ed4df650431948684d1b04c554f29871478c26 - Run #2544

@gtritchie

Copy link
Copy Markdown
Member Author

Re-reviewed at b7ed4df. The console-only frame icons, the Plumber Reload margin and the split-button arrow exemption are fixed. The project-button test case is left out; the hand measurement is fine for a nit.

The added console-only header rule looks right from reading it: that header holds only plain toolbar buttons, and the minimized frame's header with the same class holds just a title label. Its buttons aren't in the new test's scan, so their sizing rests on the manual check. Nothing further from me.

@gtritchie
gtritchie merged commit bd2f714 into main Nov 28, 2026
45 checks passed
@gtritchie
gtritchie deleted the bugfix/pane-toolbar-target-size branch November 28, 2026 17:00
gtritchie added a commit that referenced this pull request Dec 1, 2026
#19830 grew the Pane Layout column toolbar's wrapper from 20px to 24px,
but the pane still reserved 150px for its non-grid rows. Under Noto Sans
(Fedora, RHEL 10) the pane then overflowed: its vertical scrollbar forced
a horizontal one beside the fixed-width grid, and Options > Pane Layout
showed both. Every Linux desktop e2e config has failed
global_prefs_layout.test.ts since.

NON_GRID_HEIGHT is now 154 (was 150), the 4px the row grew. Each tab
list gives up 2px; at the 641px window the test checks they are 138.5px,
above their 128px floor.

Addresses #19786
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.

1 participant