Skip to content

button: Expose accessible names in the script API - #3665

Merged
huacnlee merged 4 commits into
mainfrom
chatgpt/button-accessibility-label-3662
Oct 24, 2026
Merged

huacnlee merged 4 commits into
mainfrom
chatgpt/button-accessibility-label-3662

Conversation

@huacnlee

@huacnlee huacnlee commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Button.new("save").label("Save").accessibility_label("Save the current document") currently throws even though Rust Button supports the builder and the generated types permit it. Register the string method and replay it into the real Button builder.

This is limited to Button. Refs #3662; other components and inherited bridge APIs remain outside this change.

Public API

gpui-shell (JavaScript module gpui-component)

  • ButtonElement.accessibility_label(accessibility_label: string): ButtonElement — sets the accessible name independently of the visible label. The descriptor now supplies the concrete generated TypeScript declaration and validates the runtime argument.

Validation

  • Passed: cargo fmt --all --check, git diff --check, and node --check crates/shell/tests/types/run.mjs.
  • Added a mounted script regression comparing two buttons with the same visible label and distinct accessible names, then checking the explicitly named button's click callback.
  • Added generated-declaration, fluent TypeScript, and missing/numeric argument rejection checks.
  • CI at 6cf4a75408a08e347e8b4825f260f95e6ab67410: GPUI Shell Components passed, including 939 library tests (1 ignored), all 122 integration tests, the mounted accessible-name/click regression, and generated TypeScript contracts with runtime argument rejection checks.
  • The semantic regression uses GPUI Fast's existing GPUI_A11Y_ACTIVE=1 test support in an isolated subprocess; non-Fast builds retain script-call and click coverage.
  • Local attempts at integration tests, Clippy, and the TypeScript runner stopped at missing glib-2.0 development files. CI supplies the executed integration/type results above.
  • Attempted the new regression against unchanged main production code (ecd2c8ff42439b73b87a238d02db10fe20376740); the same dependency failure prevented a behavioral negative control.
  • Installing native dependencies failed with permission denied on /var/lib/apt/lists/partial; no sudo is available. Exact-head CI run 40049044700 is terminal: 17 jobs report success; Checks fails on the pre-existing Portuguese atual/Atual typo false positives in unchanged crates/component/locales/ui.yml:646,661,676. Shell Core (including Clippy) passed.
  • Windows Standard Runtime reports success, but its log contains three failures: llrt_pure_modules_execute_inside_the_shell_runtime (incomplete deflate stream), every_fs_call_settles_through_a_promise (round-trip mismatch), and websocket_reads_and_writes_text_and_binary_messages (empty binary message). All three have identical diagnostics in the base-main job at ecd2c8ff42439b73b87a238d02db10fe20376740; they are outside this Button change. The overall run is not green.

Review and assistance

Implemented with ChatGPT assistance on behalf of @huacnlee. Independently reviewed by a separate ChatGPT agent on behalf of @huacnlee at commit 6cf4a75408a08e347e8b4825f260f95e6ab67410: no remaining source-review findings. This is an independent AI source review, not a human review; executed CI evidence is listed above.

@huacnlee
huacnlee marked this pull request as ready for review October 24, 2026 05:05
@huacnlee
huacnlee enabled auto-merge (squash) October 24, 2026 05:05
@huacnlee
huacnlee merged commit 69a2077 into main Oct 24, 2026
18 checks passed
@huacnlee
huacnlee deleted the chatgpt/button-accessibility-label-3662 branch October 24, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant