Repository navigation
fix keyboard access to editor gutter controls with screen reader support on - #19851
Open
kevinushey wants to merge 8 commits into
Open
kevinushey wants to merge 8 commits into
kevinushey wants to merge 8 commits into
Conversation
…ort on Ace's keyboard gutter handler found the row to start from through the gutter layer's highlighted cursor cell, which RStudio turns off, so Enter on the focused gutter threw and focus never left it. The fix is in the Ace fork (rstudio/rstudio-ace, bugfix/gutter-keyboard-without-line-highlight); this moves the pin to it and rebuilds the bundles. Addresses #13787
Moves the Ace pin to the fork commit that lets Enter and Space fold from the widget on a region's closing row, and that keeps the gutter's blur from throwing once the row that held focus is gone. Extends the tests to closing widgets, diagnostics, and a cursor at the end of a fold. Addresses #13787
Moves the Ace pin to the fork commit that renders a pending scroll before looking for the cursor's gutter row, and that focuses the gutter when a fold made from a closing widget has no opening widget to focus. Addresses #13787
Moves the Ace pin to the fork commit that focuses the widget opening the fold just made (or the gutter, when that widget's row is hidden, as after '} else {'), and that leaves focus on the gutter when the cursor's row has scrolled away. The e2e spec now waits for the gutter to finish each key before sending the next.
Addresses #13787
Moves the Ace pin to the fork commit that keeps focus on a closing fold widget whose activation folded nothing (Shift held), and that no longer pulls focus back into the gutter after it has moved elsewhere. The e2e spec sets the fold style it relies on. Addresses #13787
Moves the Ace pin to the fork commit that, after folding from a closing widget, hands focus to the opening row's widget only when it would unfold that fold again, and that scrolls to a cursor row that is only partly in view before searching for widgets. Addresses #13787
Moves the Ace pin to the fork commit that unfolds a region from its closing widget when that widget is still in view while the region is folded, instead of adding the same fold again and moving focus. Addresses #13787
RStudio E2E - all platformsAll tests passed!
All platforms - commit |
kevinushey
marked this pull request as ready for review
December 4, 2026 01:17
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
With screen reader support on, the source editor's gutter can take keyboard focus (Escape, then Shift+Tab) and announces "press Enter to interact with controls", but pressing Enter did nothing: focus stayed on the gutter, so fold widgets and diagnostic icons couldn't be reached by keyboard.
Fixes #13787.
Draft until rstudio/rstudio-ace#16 merges: the Ace pin here points at that PR's head commit, and moves to the
rstudio/parrot-balsamcommit once it lands (the bundles are rebuilt then; they should come out the same).Approach
The cause is in Ace's keyboard gutter handler. On Enter it read the row to start from off the gutter layer's
$cursorCell, which the layer only sets while it highlights the cursor's gutter line.AceEditorWidgetturns that highlight off, so the read threwTypeError: Cannot read properties of undefined (reading 'row'). Stock Ace does the same withenableKeyboardAccessibilityon andhighlightGutterLineoff.The fix is in our Ace fork (rstudio/rstudio-ace#16) rather than a mixin or turning the highlight on: the handler now finds the cursor's gutter row from the session, so it no longer depends on the highlight, and RStudio's themes, which style the highlighted gutter line, look the same as before. This PR moves the pin in
sync-ace-commitsand carries the rebuiltace.js/ace-uncompressed.js;sync-ace-commitsreproduces them from the pin.Getting past Enter exposed two more gaps in the same handler, fixed in the same fork PR:
Not addressed, for follow-ups: toggling the
enable_screen_readerpreference off and on without a reload installs a second handler (the menu command reloads, so only a direct preference write does this); a next-edit-suggestion gutter marker can take focus although Enter has nothing to show for it; and a few fold-mode-specific cases on closing widgets (modifier keys, XML tags sharing a line), listed in rstudio/rstudio-ace#16.Automated Tests
src/gwt/test/gutter_keyboard_test.html(new, registered in the test page runner, run byant testpage): 26 checks against the bundled Ace configured as the IDE configures it. Covers Enter from the gutter, arrow keys, folding and unfolding with Enter and Space, a cursor at the end of a fold, closing fold widgets, a diagnostic with its message,} else {, an off-screen cursor, and scrolling after the focused row is gone. Before the fix, Enter raised theTypeErrorabove and focus stayed on the gutter.e2e/rstudio/tests/panes/editor/gutter_keyboard.test.ts(new): the reported steps in the IDE. Turns on screen reader support, opens an R file, Escape, Shift+Tab, Enter, then moves between fold widgets and folds from both an opening and a closing widget. Fails on main at the Enter step with the sameTypeError.gutter_handler_test.js.QA Notes
y <- (2), Enter from the gutter focuses the diagnostic icon; Enter or Space shows its message, Escape hides it, and a second Escape returns to the gutter.Documentation
None needed.
Checklist
NEWS.md