Core: Fix aria-controls attribute on sidebar nodes to include all children#31491
Conversation
There was a problem hiding this comment.
1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
LGTM
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
@valentinpalkovic @ghengeveld, my understanding of this issue is that:
- it is an accessibility improvements, as currently only the first child is linked to the section button instead of all children
- but it does not close the linked issue which hints that some IDs are printed for child buttons that aren't reachable in the DOM, so there could be a separate bug for which we would want a repro repository
- worth noting that both the existing and proposed code may be challenged by #31267 which seeks to address the navigability of the sidebar more widely; it might be nicer to end users of we use proper list nesting instead of creating detached DOM elements that need an
aria-controlsattribute
|
@valentinpalkovic I've circled back with a11y experts and the general consensus is that |
|
View your CI Pipeline Execution ↗ for commit 8de88ca.
☁️ Nx Cloud last updated this comment at |
…dren explicitly set in aria-controls
8de88ca to
c2e6661
Compare
|
@candrepa1 don't worry too much about upgrading your branch :) The maintainers will take care of it if needed when they get around to merging :) Things are a bit busy right now with the Storybook 9 release but you haven't been forgotten. |
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 0 | 0 | 0 |
| Self size | 0 B | 3 KB | 🚨 +3 KB 🚨 |
| Dependency size | 0 B | 580 B | 🚨 +580 B 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/addon-backgrounds
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 0 | 0 | 0 |
| Self size | 0 B | 3 KB | 🚨 +3 KB 🚨 |
| Dependency size | 0 B | 596 B | 🚨 +596 B 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/addon-controls
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 0 | 0 | 0 |
| Self size | 0 B | 3 KB | 🚨 +3 KB 🚨 |
| Dependency size | 0 B | 584 B | 🚨 +584 B 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/addon-measure
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 0 | 0 | 0 |
| Self size | 0 B | 3 KB | 🚨 +3 KB 🚨 |
| Dependency size | 0 B | 580 B | 🚨 +580 B 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/addon-outline
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 0 | 0 | 0 |
| Self size | 0 B | 3 KB | 🚨 +3 KB 🚨 |
| Dependency size | 0 B | 580 B | 🚨 +580 B 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/addon-toolbars
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 0 | 0 | 0 |
| Self size | 0 B | 3 KB | 🚨 +3 KB 🚨 |
| Dependency size | 0 B | 584 B | 🚨 +584 B 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/addon-viewport
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 0 | 0 | 0 |
| Self size | 0 B | 3 KB | 🚨 +3 KB 🚨 |
| Dependency size | 0 B | 584 B | 🚨 +584 B 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/addon-vitest
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 6 | 6 | 0 |
| Self size | 550 KB | 630 KB | 🚨 +80 KB 🚨 |
| Dependency size | 1.49 MB | 1.49 MB | 0 B |
| Bundle Size Analyzer | Link | Link |
storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 51 | 49 | 🎉 -2 🎉 |
| Self size | 31.72 MB | 31.38 MB | 🎉 -341 KB 🎉 |
| Dependency size | 17.43 MB | 17.41 MB | 🎉 -22 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/angular
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 199 | 208 | 🚨 +9 🚨 |
| Self size | 191 KB | 606 KB | 🚨 +415 KB 🚨 |
| Dependency size | 29.72 MB | 29.81 MB | 🚨 +83 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/ember
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 205 | 208 | 🚨 +3 🚨 |
| Self size | 28 KB | 28 KB | 🚨 +227 B 🚨 |
| Dependency size | 28.95 MB | 28.97 MB | 🚨 +21 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 537 | 540 | 🚨 +3 🚨 |
| Self size | 903 KB | 216 KB | 🎉 -687 KB 🎉 |
| Dependency size | 59.04 MB | 59.06 MB | 🚨 +17 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 131 | 127 | 🎉 -4 🎉 |
| Self size | 3.08 MB | 2.39 MB | 🎉 -685 KB 🎉 |
| Dependency size | 22.31 MB | 22.14 MB | 🎉 -171 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-native-web-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 162 | 161 | 🎉 -1 🎉 |
| Self size | 35 KB | 35 KB | 🎉 -139 B 🎉 |
| Dependency size | 23.32 MB | 23.30 MB | 🎉 -16 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 121 | 120 | 🎉 -1 🎉 |
| Self size | 32 KB | 32 KB | 🎉 -107 B 🎉 |
| Dependency size | 20.25 MB | 20.24 MB | 🎉 -15 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-webpack5
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 286 | 284 | 🎉 -2 🎉 |
| Self size | 25 KB | 25 KB | 0 B |
| Dependency size | 43.71 MB | 43.69 MB | 🎉 -20 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
sb
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 52 | 50 | 🎉 -2 🎉 |
| Self size | 1 KB | 1 KB | 🎉 -20 B 🎉 |
| Dependency size | 49.15 MB | 48.78 MB | 🎉 -363 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/cli
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 218 | 324 | 🚨 +106 🚨 |
| Self size | 582 KB | 244 KB | 🎉 -338 KB 🎉 |
| Dependency size | 94.80 MB | 98.17 MB | 🚨 +3.37 MB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 187 | 267 | 🚨 +80 🚨 |
| Self size | 31 KB | 31 KB | 🚨 +152 B 🚨 |
| Dependency size | 78.90 MB | 82.57 MB | 🚨 +3.67 MB 🚨 |
| Bundle Size Analyzer | Link | Link |
create-storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 1 | 1 | 0 |
| Self size | 12.50 MB | 11.02 MB | 🎉 -1.49 MB 🎉 |
| Dependency size | 98 KB | 98 KB | 0 B |
| Bundle Size Analyzer | Link | Link |
@storybook/preset-react-webpack
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 177 | 175 | 🎉 -2 🎉 |
| Self size | 24 KB | 24 KB | 🎉 -171 B 🎉 |
| Dependency size | 30.53 MB | 30.52 MB | 🎉 -15 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
Closes #31382
What I did
A parent should have the list of all children in
aria-controls. Currently, only the first child is being used.I did not see any testing for accessibility, so I'm unsure if i must add an unit test for this change.
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Before

After

Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>