dialog: make the close button accessible - #2969
Merged
Merged
Conversation
Put the localized name and Cancel action on the same semantic Button. The outer DialogClose wrapper leaves the named child without native AXPress.
Contributor
Author
…buttons" This reverts commit 89d04e7.
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.

The dialog’s close button has no accessible name or
AXPressaction on macOS. This patch gives the button a localized name and moves the existingCancelhandler from its wrapper onto the button.Native accessibility dumps of the same close button, before and after (unrelated fields omitted):
{ "role": "AXButton", - "title": "", + "title": "Close", "enabled": "1", - "actions": [] + "actions": ["AXPress"] }Appearance and public API are unchanged. The name uses
Dialog.close(need to check non-English versions). Closing still goes throughCancel, including theon_cancelcallback and its ability to prevent dismissal.Screenshot
How to Test
Use Space for button activation: the existing Dialog Enter binding invokes Confirm instead, a separate keyboard-routing issue. Didn't fix here.
Code checks
cargo test -p gpui-base -p gpui-component --lib --locked cargo clippy -p gpui-base -p gpui-component -p gpui-component-story --all-targets --locked -- -D warnings rustfmt --check --edition 2024 crates/component/src/dialog/dialog.rs771 base and 418 component tests passed, along with strict Clippy and formatting. No new Rust test was added; the close-button regression was checked through native accessibility.
Checklist
AI assistance
OpenAI’s
gpt-6-astrahelped prepare the patch, native verification scripts, and this description. I reviewed the changes; the checks reported above were run by the agent and myself also initially