Repository navigation
slider: Add accessibility labels - #3494
Merged
madcodelife merged 2 commits intoOct 13, 2026
Merged
madcodelife merged 2 commits into
madcodelife merged 2 commits into
Conversation
Add optional accessible names to Base and Component Slider builders and apply them to the existing Slider node. Forward names through Component, cover rendered-node updates, and document both APIs in English and Chinese. Fixes longbridge#3468 AI-assisted implementation, regression test, and documentation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Thank you. |
madcodelife
enabled auto-merge (squash)
October 13, 2026 15:10
madcodelife
disabled auto-merge
October 13, 2026 15:10
madcodelife
enabled auto-merge (squash)
October 13, 2026 15:10
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.
Fixes #3468
Description
Base and Component Slider expose a slider role and numeric metadata, but neither provides an API for naming the control. Add an optional
accessibility_label(...)builder to both layers. Component forwards the name to Base, which applies it to its existingRole::Slidernode.The label defaults to
None, preserving existing callers. The change follows the existing builder naming and Base/Component ownership boundary. Slider state, bounds, step, orientation, pointer handling and accessibility increment/decrement handlers retain their existing implementation. Per-thumb semantics for range sliders are outside this change.Add one rendered-node regression to the existing Slider integration module and document the API for Base and Component in English and Simplified Chinese. The production diff contains 7 files: 128 insertions and 8 deletions. The screenshot fixture and verification artifacts are published on a separate fork evidence branch.
Screenshot
Actual Linux GPUI WGPU offscreen captures, using the same fixture on clean latest-upstream snapshots before and after applying the patch. The lower verification panel reads labels from real rendered GPUI nodes; it is only part of the review fixture.
The controls-only captures have 0 changed pixels in both themes.
Controls-only captures and raw observations are available at a fixed evidence commit.
Public API
gpui-base
Added to
gpui_base::slider::Slider:Sets the accessible name on the existing Slider node.
gpui-component
Added to
gpui_component::slider::Slider:Forwards the accessible name to the underlying Base Slider.
How to Test
Run from the repository root (omit
--offlineif dependencies are not cached):All commands passed on upstream base
8d4907da456a4f363c7ee1c22c553f44c3c58500plus commit0825fb2f5ec5f9c1a2c93ef01cc57961d5c4443a. There were 4 passing Slider integration tests, 4 passing Base unit tests, and 2 passing Component unit tests.The added regression queries Base and Component by their existing stable Slider IDs and checks role, node count and label across omitted labels, two distinct labels, non-ASCII renaming, and label removal on a later render. The three existing pointer/disabled integration regressions are unchanged.
Independent before/after verification with the review fixture:
E0599errors; the existing APIs render four Slider nodes whose labels are allNone.Rendered-node observations and image hashes and validation command logs are available for review. A reproduction script recreates both clean source revisions, checks expected compilation/runtime results and compares the controls-only PNGs:
git clone --branch evidence/slider-3468-0825fb2f https://github.com/lurenjia534/gpui-component.git slider-3468-review cd slider-3468-review python3 evidence/slider-3468/reproduce.py --output review-outputNative screen-reader speech, the native Story window and macOS/Windows runtime verification have not been performed. The offscreen fixture verifies GPUI rendering and node metadata.
AI Assistance
AI assisted with issue analysis, the optional label implementation, the rendered-node regression, bilingual documentation, static review, validation commands and the separate screenshot fixture.
Checklist