Closed jjaeggli closed 1 week ago
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.73.1. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
Hi Johannees, I wanted to know if there had been any discussion of this issue, and if there was a proposed solution in mind. The complicating factor is that keyboard controls required to navigate the tree (left-right) are also required to navigate within the editor. As the suggest popup can occur automatically, using navigation keys would interfere with the user's workflow.
One possibility is that the tree content is automatically announced using an aria-live region after a timeout. The documentation would not be navigable but the same content would be presented to the user.
Another possibility is that when using a specific key to invoke the suggestion popup, ie. ctrl-space, the list popup becomes effectively a modal dialog, and must be dismissed via escape. This would allow navigation within the list via keyboard, but would be potentially disruptive to existing users. Additionally, the popup would now have two modes, "passive" and "interactive" which could also be confusing.
Currently, vscode users understand the nature of the popup intuitively - if they need to navigate and the suggestion is open, they instinctively hit escape to dismiss the box. Any change which traps navigation within the dialog may not actually significantly impact users if they reflexively hit escape to navigate already.
Another issue I've identified relating to the suggest tree structure is that the ">" (tooltip: "Read more") and overlay "X" close behave as toggles but are not identified as such. Currently they provide mouse only behavior because the overlay itself is mouse only, and as we've discussed is not accessible. An example of the overlay is here:
">" toggles sets the state of "show more always on" and "x" toggles the state of show more as always off.
The issues here are:
Suggestions on how to handle this:
This solves the needs of making the tree screen reader and visual keyboard-only user friendly.
Questions:
After working with this further I determined a better minimal approach to resolving this issue.
aria-describedby
. Therefore screen readers will read this after the suggestion label and will be clearer. Example:Current:
DisplayPositionclass DisplayPosition, Selected (1 of 1)
With aria-ariadescribedby
:
DisplayPosition, Selected (1 of 1), class DisplayPosition
The description is always announced as either with the expanded documentation overlay or the inline description the content is always visible (although often truncated when displayed inline).
This still disadvantages screen reader users to some degree as there is no ideal way to perform line by line navigation in the documentation box. Reaching this is still nearly impossible when using content navigation controls.
I found what I believe is another potential approach. It looks like there is a partially implemented feature from ~6 yrs ago to focus the suggest details as can be seen here:
The toggleDetailsFocus
method is currently bound to the ctrl + alt + space key combination. Therefore the current behavior is:
The implementation is currently incomplete. All that happens currently when suggest details receives the focus state is that the style is changed. The overlay does not receive focus, and screen readers are not able to interact with the dialog. However if this._details.widget.domNode.focus();
is added when entering the Details state, the screen reader is then able to use content navigation keys to interact with the content, which is actually what is needed here.
State management needs to be properly handled for exiting the details state.
@jjaeggli Thanks for looking into this important issue.
Since we often present sighted users with the details without requiring a user gesture, I'm wondering if we should make it configurable as to whether they're automatically read for screen reader users. While the details can be verbose, some screen reader users I've worked with have said that just pressing escape
will silence the info, so they don't mind it.
Sorry for the delay. The conclusion I came to on this was that when in a code window, the suggestions can contain rendered markdown text. Markdown has semantics which can be rendered as accessible HTML. In the suggestion documentation overlay, a visual user sees fully rendered markdown, however the details are only provided to the screenreader as a rendered text string without any of the associated semantics. Therefore it is possible to provide the same information to a screen reader if the documentation is focusable, reachable, and the user knows about it, however this is not currently the case. Just as examples, the rich suggestion could contain bulleted lists, code blocks, or links to other code, depending on what is provided by language support. Not providing proper semantics and not being reachable are problems for products based on vs web or monaco.
This was actually fixed in September 2024 with https://github.com/microsoft/vscode/pull/190096.
With ctrl+alt+space
you can now toggle focus between the editor and suggest details. When focus in the details part, screen readers will pick it up. To change the keybinding, the underlying command is toggleSuggestionFocus
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
Expected Behavior
In its current state, this has the fundamental issue in that it provides information to sighted users that it does not make available to screen reader users. More specifically, WCAG 2.1 1.3.1 Level A states:
The structure of the information provided, according to this criteria, is also relevant and should be conveyed to users.