Repository navigation
support multiple application warnings - #19459
Conversation
gtritchie
left a comment
There was a problem hiding this comment.
Accessibility review against WCAG 2.2 AA, focused on keyboard and screen reader support. These findings come from code inspection only. Once a round of fixes is in, we'll do hands-on testing with a screen reader and keyboard, and a more general review of the PR as well.
Fix before merge
1. Warnings now precede the workbench in tab and reading order (1.3.2 Meaningful Sequence, 2.4.3 Focus Order).
The ApplicationWindow constructor now adds warnings_ to applicationPanel_ immediately, and showWorkbenchView() adds the workbench afterwards. LayoutPanel keeps children in insertion order, so the DOM order becomes header → warnings → main workbench, even though the warnings render at the bottom of the window. Tab moves from the toolbar into the warning dismiss buttons before reaching any pane, and screen readers list the "Warning bar" landmark before "Workbench". Before this PR, the bar was added lazily when a warning was shown, which usually placed it after the workbench. One fix: in showWorkbenchView(), use applicationPanel_.insert(workbenchScreen_, applicationPanel_.getWidgetIndex(warnings_)).
2. Dismissing a row by keyboard drops focus to <body> (2.4.3).
WarningBarList.remove() detaches the focused row. This already happened with a single bar, but with up to three rows plus scrolling, a keyboard user clearing several warnings has to tab back in from the top after each one. In dismiss(), if focus was inside the removed row, move it to the next row's dismiss button (or the previous row's). If no rows remain, move it to a sensible place in the workbench.
Should improve
3. Every dismiss button has the same accessible name.
Each row's button is "Dismiss Warning Bar". The row's group label gives context when tabbing in, so this technically passes 2.4.4 (purpose from programmatic context). However, a screen reader's buttons list shows several identical entries, and "Bar" is now inaccurate because each button closes a single warning. Suggest "Dismiss warning", with aria-describedby pointing at the message.
4. Messages are read twice in browse mode.
Each row is now a group whose aria-label is the full message, and the visually hidden live region inside it holds the same text. Reading through the page gives "group, ‹message›, ‹message›, Dismiss Warning Bar, button". This is verbosity rather than a failure. A short group label (or aria-labelledby pointing at the live region) would avoid it.
5. Truncated messages have no way to reveal the full text (1.4.4, 1.4.10).
Clipping predates this PR. The new ellipsis at least signals that text is missing, but sighted users, especially at high zoom or in narrow windows, can't read the rest. Screen reader users do get the full text. A title on label_ would be a cheap fix.
6. Simultaneous warnings may talk over each other (4.1.3 Status Messages).
Each row has its own role="alert" region. When several startup warnings arrive together, their assertive announcements can interrupt each other, and some screen readers drop the earlier ones. This is still better than before, when each warning replaced the last. Staggering announcements, or routing them through a single shared live region, would make them reliable.
Worth checking during hands-on testing
The .center cell that holds the dismiss button has overflow-x: hidden, and the new scroll container adds overflow-x: hidden as well. Confirm the dismiss button's focus ring isn't clipped, in both light and dark themes.
Improvements and passes
- Moving the license button out of the clipped message cell means every row's controls stay visible and reachable.
- A warning identical to one already shown doesn't re-announce, because the update skips
setText. - Each row now has a group name, which gives screen reader users context, and the e2e test asserts these names.
- 2.4.11 Focus Not Obscured: the workbench shrinks to make room for the warnings rather than being covered by them, and tabbing to a dismiss button scrolls it into view.
- 2.1.1 Keyboard: every row in the scroll container has a focusable button, so all rows are reachable by keyboard.
- 2.5.8 Target Size: the dismiss button is still 9×9 px but meets the spacing exception. Rows are 28 px apart and the action link is about 16 px away, so the 24 px circles don't overlap.
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 |
Moving the workbench before the warnings in the DOM left the hidden warnings layer, which fills the panel until a warning sizes it, on top of the workbench, intercepting clicks.
|
Thanks, these are addressed in d229071 and 598382a, plus 9845e70:
Focus ring: Ready for the hands-on pass. |
The application warning bar renders messages as HTML, and the encoding comes verbatim from the .Rproj file.
…-bar-messages # Conflicts: # src/gwt/test/org/rstudio/studio/client/RStudioUnitTestSuite.java
|
These problems predate this PR, so I'm not asking for them here. I'd suggest opening a new issue (or issues) to track them:
|
- Relayout only when a row is added or removed, not on every refresh. - Key the memory warning's dismissal and announcement on its limit state, not its live figures, so a dismissal survives a reload and polls are quiet. - Replace an over-quota warning with the near-quota one when usage drops. - Announce severe warnings in an assertive region. - Scroll a new row into view unless a row has focus. - Show the message's links in Details, and take them out of the row's tab order, where focusing them scrolled the clipped message. - Number warnings by position. - Undismiss, rather than hide and reshow, for the shortcut and test warnings. - Remove the unused hideWarningBar(), hideWarning(), clear(), no-arg WarningBarClosedEvent and dismissWarningText messages.
|
Tracked in #19477. This PR now fixes the every-poll memory announcement (see the dismissal thread), so the issue covers the other four. |
gtritchie
left a comment
There was a problem hiding this comment.
Thanks, the previous round of comments is addressed. One new problem: the last commit breaks an existing e2e test; details inline.
| Roles.getStatusRole().set(status_.getElement()); | ||
| Roles.getAlertRole().set(alert_.getElement()); | ||
| announcement_.add(status_); | ||
| announcement_.add(alert_); |
There was a problem hiding this comment.
This structure breaks tests/panes/plots/plot_alt_text.test.ts ("a ggplot2 plot uses its author alt text") on all three e2e platforms (linux-server shard 4, macOS desktop shard 6, Windows desktop shard 6), each failing with:
Expected one app status live region, found 2
The test finds the app's AriaLiveStatusWidget with div:has(> [role=status] + [role=alert]) > [role=status]. The announcement panel here is now a status region followed by an alert region in the same parent, so it matches too. Either give the warning announcements a structure that doesn't mirror AriaLiveStatusWidget, or make the test's selector specific to that widget (for example, an element ID on it).
There was a problem hiding this comment.
Fixed in f9790c4: the app's AriaLiveStatusWidget now has the id rstudio_app_aria_live_status, and the test finds the status region through it instead of by structure. That also stops the selector depending on no command palette or dialog being open, since they embed the same widget. bdcd62c fixes a cleanup-order problem in the warnings scroll test that only showed up locally on macOS.
Screen reader testing: NVDA 2026.03, Windows 11Tested hands-on with a dev build of RStudio Desktop from this branch. Overall it worked very well. How we drove itThe existing triggers (the
A small R helper ( Scenarios
Observations
|
gtritchie
left a comment
There was a problem hiding this comment.
Thanks for tackling the accessibility findings, this is working very nicely now. The tests need to be fixed so they pass (see comment) but otherwise LGTM!
The warning announcement panel is now also a status region followed by an alert region, so the structural selector matched twice.
With the bar still clipped to one row, the last row's dismiss button could not be clicked, so the cleanup timed out locally on macOS.
Application warnings currently replace one another, so startup warnings can disappear before the user handles them. This adds separate rows with independent actions and dismiss buttons, showing up to three rows before scrolling. Exact duplicate messages share a row, and dismissed messages are remembered in temporary session client state across reconnects; changed messages or severity can appear again.
Rows scroll vertically, with long messages clipped within their cells so controls remain visible. Every row has a keyboard-accessible Details dialog showing the full message. Named updates and removal keep memory, quota, license, and shortcut-report warnings confined to their own row. Closing another warning no longer disables shortcut reporting. Includes a NEWS entry linked to the issue.
Warnings follow the workbench in reading and tab order. Removing a focused row moves focus to the next or previous dismiss button, or to the console when no rows remain; background removal leaves focus alone. Closing Details also recovers focus if its warning resolved while the dialog was open. Short numbered group and button names distinguish warnings, and dismiss buttons describe their associated messages. Nearby warning updates are coalesced into one polite announcement outside the rows, excluding messages removed before announcement. Control padding preserves focus outlines with non-overlay scrollbars.
Closes #19108.
Validation:
ant build-unittests draftand the finalant draftpassed.WarningBarListTests,ApplicationWindowTests, andWorkbenchWarningTests) passed, covering independent actions/dismissals, updates, reconnect state, changed severity, bounded height, invalid saved state, restored memory dismissals, quota transitions, focus recovery, contextual labels, full-message details, batched announcements, and disabled announcements.npm run typecheckpassed ine2e/rstudio.git diff --checkpassed.Roborev Refine: the updated full-branch review passed with no actionable findings after one follow-up fix for dialog focus restoration. The follow-up commit review also passed. No LOW findings were reported or ignored.
Automated UI verification ran on macOS. The desktop test harness uses GWT dialogs (
native_file_dialogs=false). Screen-reader speech, native desktop dialogs, and Windows/Linux runtime behavior still need hands-on verification.