a11y: Settings UI - #59429
Merged
Merged
Conversation
Anthony-Eid
approved these changes
Jun 17, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jun 17, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jun 17, 2026
This was referenced Jun 18, 2026
Closed
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
Adds: - aria attributes to most UI elements in settings UI - a new a11y API to GPUI - a fix for a GPUI keyboard focus bug ## Accesible settings UI Settings UI should now be fully accessible to users of assistive technology. **However**, there are some caveats: - accessibility features require zed to be launched with the `ZED_EXPERIMENTAL_A11Y=1` env var to be set - I have not exhaustively checked every control - There are some quite surprising keyboard focus behaviours which predate this code - The main Zed UI is still largely inaccessible, though a handful of shared components will now report themselves, but the experience is suboptimal. For anyone wishing to try out the settings UI: - make sure `ZED_EXPERIMENTAL_A11Y=1` is set - open zed - press `ctrl-,` (or `cmd+,` on a mac) to open settings UI in a separate window ## `aria_active_descendant` This is equivalent to the [`aria-activedescendant`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-activedescendant) API on the web. It allows a container to maintain focus, while indicating that one of its children should be active. Zed uses this for menus and combo boxes, for example. GPUI will report a div with `.aria_active_descendant()` as long as: - an ancestor is focused - only one descendant of the focused ancestor has `.aria_active_descendant()` Two descendants with this property where the focused node is a common ancestor is an error. ## GPUI keyboard fix GPUI will map a space or enter keypress to a div's `on_click` handler, if it exists. However, the keyboard-driven path was missing some checks that the mouseclick path has. With this PR, for an enter/space keypress to be considered a click, between the "key down" and "key up" events: - there must be no other key events - focus must not move to a different node This fixes an existing bug with combo boxes in zed where: - enter maps to `menu::Confirm` **on key down* - the menu item is selected - focus moves to the combo box - enter then triggers the combo box's `on_click` **on key up**, re-opening the menu --- Release Notes: - N/A or Added/Fixed/Improved ... --------- Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
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.
Adds:
Accesible settings UI
Settings UI should now be fully accessible to users of assistive technology.
However, there are some caveats:
ZED_EXPERIMENTAL_A11Y=1env var to be setFor anyone wishing to try out the settings UI:
ZED_EXPERIMENTAL_A11Y=1is setctrl-,(orcmd+,on a mac) to open settings UI in a separate windowaria_active_descendantThis is equivalent to the
aria-activedescendantAPI on the web.It allows a container to maintain focus, while indicating that one of its children should be active. Zed uses this for menus and combo boxes, for example.
GPUI will report a div with
.aria_active_descendant()as long as:.aria_active_descendant()Two descendants with this property where the focused node is a common ancestor is an error.
GPUI keyboard fix
GPUI will map a space or enter keypress to a div's
on_clickhandler, if it exists. However, the keyboard-driven path was missing some checks that the mouseclick path has.With this PR, for an enter/space keypress to be considered a click, between the "key down" and "key up" events:
This fixes an existing bug with combo boxes in zed where:
menu::Confirm*on key downon_clickon key up, re-opening the menuRelease Notes: