Skip to content

Announce completion and history popup selections to screen readers - #19541

Merged
gtritchie merged 8 commits into
mainfrom
bugfix/completion-popup-screen-reader
Nov 10, 2026
Merged

gtritchie merged 8 commits into
mainfrom
bugfix/completion-popup-screen-reader

Conversation

@gtritchie

@gtritchie gtritchie commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Screen readers said nothing, or re-read the typed text, while the user arrowed through the code completion popup (console and source editor) or the console history popup. Both popups render through CompletionList, which had no ARIA.

  • CompletionList exposes a labeled listbox of options ("Completions" / "Console history"). In Safari it uses menu/menuitem roles, as Ace's own completion popup does.
  • While a list is shown, the focused Ace input's aria-activedescendant names the selected option, set through Ace's setAriaOptions via a new InputEditorDisplay.setAriaActiveDescendant. It is cleared when the list detaches, is cleared, or is parked offscreen.
  • The first selection is named in a deferred command: setPopupPositionAndShow attaches popups with visibility: hidden, and VoiceOver skipped an item named while hidden and didn't announce it once shown.
  • Completion type icons, which had no alt text, are now presentational.

Not covered here: C/C++ files, which use a separate popup (#19532), and announcing message-only popups, completion types, and the help tooltip (#19533).

Testing

  • New e2e test e2e/rstudio/tests/panes/misc/completion_popup_aria.test.ts (console completion, R editor completion, console history): checks roles, label, selected state, that aria-activedescendant follows arrow keys and clears on Escape, and that it never names a hidden item. Fails before the change, passes after; existing autocomplete and autocomplete_extras suites pass (server-dev).
  • Manually verified with VoiceOver in Safari and Chrome on macOS: all three popups announce the selected item on open and on each arrow move.
  • Manually verified with NVDA in RStudio Desktop on Windows.

Fixes #6167.
Fixes #6168.

Neither the completion popup (console and source editor) nor the console
history popup exposed any ARIA, so screen readers said nothing, or
re-read the typed text, while the user arrowed through the list.

CompletionList, which renders both popups, now exposes a labeled listbox
of options ("Completions" or "Console history") and keeps the focused
Ace input's aria-activedescendant on the selected option, through Ace's
own setAriaOptions. In Safari it uses menu roles, as Ace's popup does.
The attribute is cleared when the list detaches, is cleared, or is
parked offscreen.

Addresses #6167
Addresses #6168
The icons had no alt text, so a screen reader could read them as an
unnamed image inside each completion. The item's text names it.

Addresses #6167
GWT's setPopupPositionAndShow attaches a popup with visibility: hidden
while positioning it, so CompletionList set aria-activedescendant to the
first item while that item was hidden. VoiceOver in Safari skipped it and
did not announce it once shown; only later arrow-key moves were read.
The list now names its selection in a deferred command after attaching.

Addresses #6167
Addresses #6168
Adding setTextInputActiveDescendant split the Javadoc from the method it
documents, so it described the new method instead.

Addresses #6167
@gtritchie gtritchie added this to the 2026.12 (Parrot Balsam) milestone Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

RStudio E2E - all platforms

1 test(s) failed

###################- 99% pass rate

Passed Failed Skipped Flaky
5362 1 275 3
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 4 0 16 0
✅ desktop-linux 1352 0 45 0
✅ desktop-macos 1347 0 51 0
❌ desktop-windows 1322 1 78 2
✅ server-linux 1289 0 53 1
✅ setup 48 0 32 0
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit 297e1c1ebaeb005a057dbc921cf935e28fb7fe29 - Run #2143

@gtritchie
gtritchie merged commit 4ab72d3 into main Nov 10, 2026
5 of 9 checks passed
@gtritchie
gtritchie deleted the bugfix/completion-popup-screen-reader branch November 10, 2026 00:20
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.

Console history popup not announced by screen reader Autocomplete popups not announced by screen readers

1 participant