[Studio UI] Add aria-expanded to tree nodes - #4050
Closed
idaiv wants to merge 4 commits into
Closed
Conversation
Expandable tree nodes now expose aria-expanded={true|false} so screen
readers announce whether a folder is open or closed. Only set on nodes
that have children; leaf nodes omit the attribute entirely.
Note: aria-selected requires role="treeitem" (current role is "button")
and will be added in the follow-up ARIA roles PR.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Verdict: Needs changes. The PR adds expansion-state semantics to the shared tree-node component.
Changes:
- Adds
aria-expandedto expandable nodes. - Omits the attribute from detected leaf nodes.
Review:
- Root cause/boundary: Correctly targets the owning
TreeNodecomponent. - Coverage: All consumers inherit the behavior, but
childrendoes not match the actualhasChildrenexpansion condition. - Compatibility: Additive; no public API break.
- Tests/docs: Automated regression coverage is missing; no documentation change is necessary.
- Risk: Screen-reader behavior remains manually unverified.
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const nodeContent = ( | ||
| <Flex | ||
| align="center" | ||
| aria-expanded={ isExpandable ? isExpanded : undefined } |
props.children is not an expansion source — TreeExpander only renders when hasChildren is true. Remove the redundant children length check. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
8 tasks
Contributor
Author
|
Superseded by #4048 which includes aria-expanded along with the full tree navigation rewrite. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Summary
aria-expanded={true|false}so screen readers announce folder open/closed statearia-selecteddeferred to ARIA roles PR (requiresrole="treeitem", current role is"button")Test plan
aria-expanded="false"when collapsedaria-expanded="true"aria-expandedattribute🤖 Generated with Claude Code