Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address numerous a11y issues in WB Stories #2509

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

marcysutton
Copy link
Member

@marcysutton marcysutton commented Mar 20, 2025

Summary:

[misc-a11y-issues] WB-1838: Add labels to toolbar icons
[misc-a11y-issues] WB-1837: Add labels to switches
[misc-a11y-issues] WB-1833: Add labels to radios
[misc-a11y-issues] WB-1832: Fix ids on Choices
[misc-a11y-issues] WB-1831: Add labels to checkboxes
[misc-a11y-issues] WB-1823: Add aria-label to listbox
[misc-a11y-issues] WB-1822: Fix actionItem role issue
[misc-a11y-issues] WB-1821: Fix tab role issue
[misc-a11y-issues] WB-1820: Fix label in button story
[misc-a11y-issues] WB-1819: Fix banner spinner label
[misc-a11y-issues] WB-1826: add listbox to options

Parent Issue: WB-1817

Test plan:

  1. Open stories in tickets
  2. Verify there are no violations in Storybook accessibility pane

@marcysutton marcysutton self-assigned this Mar 20, 2025
Copy link

changeset-bot bot commented Mar 20, 2025

🦋 Changeset detected

Latest commit: b42a7b6

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@khan-actions-bot khan-actions-bot requested a review from a team March 20, 2025 21:05
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Mar 20, 2025

Gerald

Required Reviewers
  • @Khan/wonder-blocks for changes to .changeset/brown-hairs-fly.md, __docs__/components/all-variants.tsx, __docs__/wonder-blocks-banner/banner.stories.tsx, __docs__/wonder-blocks-button/button.stories.tsx, __docs__/wonder-blocks-clickable/accessibility.stories.tsx, __docs__/wonder-blocks-dropdown/action-item.stories.tsx, __docs__/wonder-blocks-dropdown/listbox.stories.tsx, __docs__/wonder-blocks-dropdown/option-item-variants.stories.tsx, __docs__/wonder-blocks-dropdown/option-item.stories.tsx, __docs__/wonder-blocks-form/checkbox.stories.tsx, __docs__/wonder-blocks-form/choice.stories.tsx, __docs__/wonder-blocks-form/radio.stories.tsx, __docs__/wonder-blocks-switch/switch-best-practices.stories.tsx, __docs__/wonder-blocks-switch/switch.stories.tsx, __docs__/wonder-blocks-toolbar/toolbar.argtypes.tsx

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

Copy link
Contributor

github-actions bot commented Mar 20, 2025

npm Snapshot: NOT Published

🤕 Oh noes!! We couldn't find any changesets in this PR (e4dd2ca). As a result, we did not publish an npm snapshot for you.

Copy link
Contributor

github-actions bot commented Mar 20, 2025

Size Change: 0 B

Total Size: 98.9 kB

ℹ️ View Unchanged
Filename Size
packages/wonder-blocks-accordion/dist/es/index.js 3.54 kB
packages/wonder-blocks-banner/dist/es/index.js 1.55 kB
packages/wonder-blocks-birthday-picker/dist/es/index.js 1.88 kB
packages/wonder-blocks-breadcrumbs/dist/es/index.js 886 B
packages/wonder-blocks-button/dist/es/index.js 4.34 kB
packages/wonder-blocks-cell/dist/es/index.js 2.35 kB
packages/wonder-blocks-clickable/dist/es/index.js 3.07 kB
packages/wonder-blocks-core/dist/es/index.js 2.85 kB
packages/wonder-blocks-data/dist/es/index.js 6.25 kB
packages/wonder-blocks-dropdown/dist/es/index.js 19.5 kB
packages/wonder-blocks-form/dist/es/index.js 6.04 kB
packages/wonder-blocks-grid/dist/es/index.js 1.36 kB
packages/wonder-blocks-icon-button/dist/es/index.js 3.17 kB
packages/wonder-blocks-icon/dist/es/index.js 873 B
packages/wonder-blocks-labeled-field/dist/es/index.js 1.26 kB
packages/wonder-blocks-layout/dist/es/index.js 1.82 kB
packages/wonder-blocks-link/dist/es/index.js 2.04 kB
packages/wonder-blocks-modal/dist/es/index.js 5.5 kB
packages/wonder-blocks-pill/dist/es/index.js 1.49 kB
packages/wonder-blocks-popover/dist/es/index.js 4.92 kB
packages/wonder-blocks-progress-spinner/dist/es/index.js 1.52 kB
packages/wonder-blocks-search-field/dist/es/index.js 1.32 kB
packages/wonder-blocks-switch/dist/es/index.js 2.02 kB
packages/wonder-blocks-testing-core/dist/es/index.js 3.91 kB
packages/wonder-blocks-testing/dist/es/index.js 1.07 kB
packages/wonder-blocks-theming/dist/es/index.js 679 B
packages/wonder-blocks-timing/dist/es/index.js 1.79 kB
packages/wonder-blocks-tokens/dist/es/index.js 2.7 kB
packages/wonder-blocks-toolbar/dist/es/index.js 923 B
packages/wonder-blocks-tooltip/dist/es/index.js 7.01 kB
packages/wonder-blocks-typography/dist/es/index.js 1.23 kB

compressed-size-action

Copy link
Contributor

github-actions bot commented Mar 20, 2025

A new build was pushed to Chromatic! 🚀

https://5e1bf4b385e3fb0020b7073c-jmfuvfsauu.chromatic.com/

Chromatic results:

Metric Total
Captured snapshots 38
Tests with visual changes 0
Total stories 574
Inherited (not captured) snapshots [TurboSnap] 350
Tests on the build 388

Copy link
Member

@somewhatabstract somewhatabstract left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for getting these fixed up!

Copy link
Member

@beaesguerra beaesguerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay looks great! Thanks for addressing these issues in our stories 🎉 Left some questions!

@@ -83,7 +104,6 @@ export const Default: StoryComponentType = {
render: (args) => <ChoiceWrapper {...args} />,
args: {
label: "Pineapple (Control)",
value: "pineapple",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the value arg set so the value is set on the Pineapple choice on line 57?

<Choice aria-label="Pineapple" {...args} />

@@ -55,7 +55,9 @@ export default {
decorators: [
(Story): React.ReactElement<React.ComponentProps<typeof View>> => (
<View style={styles.example}>
<Story />
<div role="listbox" aria-label="Example">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something I've been doing to address a11y warnings is to disable specific rules if we know it is expected.

For example, for the NavigationTabItem stories, because it renders a <li> without a <ul> (since that's provided by NavigationTabs), we expect a related warning about that, but there should be no warnings when NavigationTabs and NavigationTabItem are used together! Here's an example of disabling the listitem rule when it's expected

Do we have a preference for disabling expected rules or wrapping it with additional things to make sure it's semantically correct? Curious to see if others have thoughts on this!

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.

4 participants