Repository navigation
Make pane toolbar buttons 24px targets (WCAG 2.5.8) - #19830
Conversation
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
| /* 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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 = [ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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')); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...").
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
RStudio E2E - all platformsAll tests passed!
All platforms - commit |
|
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. |
#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
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
Toolbar rows
SecondaryToolbardid 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 thetallerToolbarWrapperclass are folded intoToolbar.Pane minimize/maximize/close buttons
Files breadcrumb
Offsets tuned for the old row, removed or replaced:
Narrow panes
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'starget-sizerule 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 againstmain'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 thepanesandtabslayout specs; all pass.ant unittestwas not run.QA Notes
Measured on RStudio Server (Chrome, macOS, default theme) with axe-core 4.13's
target-sizerule: 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
windowsbody 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
NEWS.md