Skip to content

docs(components): give the stories and examples accessible names (part of #3015) - #3050

Merged
mfal merged 4 commits into
mainfrom
docs/accessible-names-3015
Sep 1, 2026
Merged

docs(components): give the stories and examples accessible names (part of #3015)#3050
mfal merged 4 commits into
mainfrom
docs/accessible-names-3015

Conversation

@mfal

@mfal mfal commented Sep 1, 2026

Copy link
Copy Markdown
Member

Part of #3015. Split out of #3022, which now carries only the react-tunnel fix. Everything here is a caller passing a name that was always available — no component code, no locale file, no generated artifact.

Warning Reality
DonutChart, Select aria-label is already public API (inherited from Aria.ProgressBarProps, already in the generated remote element). Three stories just never passed it
Modal --long-content Came from the RadioGroup inside the story, not from Modal
ProgressBar docs The status example passed its text as raw children, which renders but never becomes a label. Wrapped in <Label>
GridListInner needs a name List already supports aria-label/aria-labelledby; five ListItem stories omitted it
textValue required List.Item already has the prop; four stories omitted it

aria-hidden on DonutChart's inner ProgressBar was considered and rejected — it would hide aria-valuenow/aria-valuetext, which is the chart's actual content.

textValue was deliberately not made required or auto-derived: required would break the public API, and deriving text from an arbitrary renderFn is not reliable. The react-aria warning stays as the signal, now documented on the List page.

A code scan turned up the same two defects in four docs examples the issue had not listed (content/avatar, two patterns/anlegeprozess examples); those are fixed too.

No new UI text

No locale file was touched — every accessible name comes from a caller. The only new prose is two German best-practice bullets on the DonutChart and List docs pages.

Verified

  • All story ids from the issue that this PR covers report 0 warnings (Playwright against Storybook, console.warn wrapped with a stack trace to name the react-aria frame).
  • eslint + prettier clean on every changed file, rebased onto current main (1.1.4).

The three Slider stories from the issue are fixed by #3022, not here.

🤖 Generated with Claude Code

mfal and others added 3 commits September 1, 2026 13:40
Three examples left a form control without an accessible name, and
react-aria warned about each one (#3015):

- the two `CountryOptions` Select stories had no `<Label>`
- the RadioGroup in Modal's LongContent story had none either; it sits
  under a `Permissions` heading, so it gets that as an `aria-label`
- the ProgressBar status example passed its text as raw children, which
  renders but never becomes a label — wrapped in `<Label>` now

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Default, WithUnit and WithTextValue stories left the inner react-aria
`ProgressBar` unnamed, so a screen reader announced a bare value and
react-aria warned (#3015).

`aria-label` is part of `DonutChartProps` already, inherited from
`Aria.ProgressBarProps`, and every docs example passes it — the stories
were the outliers. Hiding the progressbar from assistive tech instead
would drop the value, which is the point of the chart. The requirement now
appears in the page's best practices, where it was only implicit in the
examples.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
react-aria needs both, and warned 48 times per dev run without them
(#3015): a `GridList` with no accessible name, and `GridListItem`s with
non-plain-text children but no `textValue` — which also breaks
type-to-select on those items.

Both are existing `List` properties, so this is a fix to the examples, not
to the component. The List page gains the missing `textValue` best
practice; the `aria-label` one was already there.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./packages/components/

Status Category Percentage Covered / Total
🔵 Lines 78.69% 746 / 948
🔵 Statements 78.57% 763 / 971
🔵 Functions 80.09% 165 / 206
🔵 Branches 70.33% 377 / 536
File CoverageNo changed files found.
Generated in workflow #6507 for commit 866f3fb by the Vitest Coverage Report Action

@mfal
mfal requested a review from Lisa18289 September 1, 2026 11:47
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

Preview environments are ready:

Type URL
docs pr-3050.docs.review.flow-components.de
storybook pr-3050.storybook.review.flow-components.de

Images:

  • docs: ghcr.io/mittwald/flow/docs:pr-3050
  • storybook: ghcr.io/mittwald/flow/storybook:pr-3050

@mfal
mfal enabled auto-merge (squash) September 1, 2026 13:59
Comment thread apps/docs/src/content/components/content/avatar/examples/status-example.tsx Outdated
Comment thread apps/docs/src/content/components/content/avatar/examples/status-example.tsx Outdated
Comment thread packages/components/src/components/Modal/stories/Default.stories.tsx Outdated
`Section` already labels a contained `List`: its props context hands the
list an `aria-labelledby` pointing at the section heading, and `Items`
drops that link as soon as an `aria-label` is present. The two
`aria-label`s on the Avatar status example were therefore redundant and
replaced a live reference with a duplicated string — reverted.

The `Modal` story's `RadioGroup` now references its `Permissions`
heading via `aria-labelledby` instead of repeating the text. A local
`id` wins over the one the section's props context supplies, so the
group is named by the heading a sighted user reads.

`create-container.tsx` keeps its `aria-label`: that section holds three
headings, and the props context gives all of them the same id, so the
inherited `aria-labelledby` would name the volume list "Entrypoint".

Verified in a browser test: without the `aria-label` the typedList list
inside the section resolves to "Benachrichtigungen" and react-aria emits
no accessible-name warning.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mfal
mfal disabled auto-merge September 1, 2026 14:19
@mfal
mfal enabled auto-merge (squash) September 1, 2026 14:19
@mfal
mfal merged commit 5e0322a into main Sep 1, 2026
30 of 32 checks passed
@mfal
mfal deleted the docs/accessible-names-3015 branch September 1, 2026 14:38
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.

2 participants