Skip to content

docs(thumbnail): accessibility migration analysis#6447

Merged
nikkimk merged 9 commits into
mainfrom
nikkimk/swc-2196-thumbnail-a11y
Jul 7, 2026
Merged

docs(thumbnail): accessibility migration analysis#6447
nikkimk merged 9 commits into
mainfrom
nikkimk/swc-2196-thumbnail-a11y

Conversation

@nikkimk

@nikkimk nikkimk commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Description

In CONTRIBUTOR-DOCS/03_project-planning/03_components/thumbnail/accessibility-migration-analysis.md:

  • Documented recommendations for ARIA roles, states, and properties for the 2nd-gen Thumbnail: role="img" on the host, aria-label required for the accessible name, and alt="" on the slotted <img> to avoid redundant announcements
  • Shadow DOM and cross-root ARIA considerations documented: decorative wrappers only, no cross-root ID references needed
  • Accessibility tree expectations documented for default (with slotted image), "hide image" variant, and thumbnail embedded in disabled or selected parent
  • Keyboard interaction model specified: not focusable; parent component is responsible for focus, disabled, and selected states
  • Testing requirements defined, including unit tests, aXe/Storybook, Playwright ARIA snapshots, contrast checks, and manual screen reader testing in browse mode
  • Known 1st-gen accessibility gaps cataloged: no role="img" on host, alt on slotted <img> rather than aria-label on host, and disabled/focused/selected exposed as thumbnail attributes
  • disabled, focused, and selected are called out as state the thumbnail must not own; visual treatment for these comes from a parent component
  • 1st-gen Jira items cataloged with status; gen2 tickets and audit epics excluded per doc rules

Motivation and context

The 2nd-gen migration is an opportunity to address known accessibility gaps, align with WAI-ARIA Authoring Practices, and ensure the component meets WCAG 2.2 AA compliance. The primary change from 1st-gen is moving from alt on the slotted <img> to role="img" + aria-label on the host, making the semantics consistent across all rendering modes (slotted image, CSS background, checkerboard).

Related issue(s)

  • resolves SWC-2196

Screenshots (if appropriate)


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

Review the Thumbnail accessibility migration analysis

  • ARIA roles, states, and properties covered
  • Shadow DOM and cross-root ARIA considerations covered
  • Accessibility tree documented
  • Keyboard interaction fully specified
  • Testing requirements defined
  • Known 1st-gen issues cataloged with dispositions
  • Review the changes that include the adaptive dual-border guidance

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

Accessibility testing checklist

This PR adds only documentation (a contributor planning doc). No interactive component was added or modified. No runtime behavior changed.

  • Keyboard — not applicable; no component code was added or modified
  • Screen reader — not applicable; no component code was added or modified

@nikkimk nikkimk self-assigned this Jun 23, 2026
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5852fda

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@nikkimk nikkimk added the a11y Issues or PRs related to accessibility label Jun 23, 2026
@nikkimk nikkimk marked this pull request as ready for review June 23, 2026 20:46
@nikkimk nikkimk requested a review from a team as a code owner June 23, 2026 20:46
@nikkimk nikkimk added Status:Ready for review PR ready for review or re-review. High priority PR review PR is a high priority and should be reviewed ASAP labels Jun 23, 2026
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 Gen1 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6447

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@coveralls

coveralls commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 28890658393

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage decreased (-0.001%) to 96.254%

Details

  • Coverage decreased (-0.001%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 39169
Covered Lines: 37903
Line Coverage: 96.77%
Relevant Branches: 6459
Covered Branches: 6016
Branch Coverage: 93.14%
Branches in Coverage %: Yes
Coverage Strength: 461.83 hits per line

💛 - Coveralls

@cdransf cdransf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great! ✨

@5t3ph 5t3ph left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Question on labeling strictness

|-------|------------|
| **One semantic role** | `swc-thumbnail` is an image container. It exposes one prescribed role: `role="img"`. **Do not** allow authors to override the host role (for example, do **not** expose `role="button"` or `role="presentation"`). If an interactive thumbnail is needed, authors should wrap the component inside an interactive element like a button or link. |
| **Host `role="img"`** | Set `role="img"` on the host element. This is **prescribed and fixed**. The host carries the image semantics in all rendering modes: slotted image, CSS background, or checkerboard only. |
| **Accessible name (required)** | Every thumbnail must have a name that assistive technology can announce. Use `aria-label` on the host (for example `aria-label="Layer 1 preview"`). An empty or missing accessible name fails [WCAG 1.1.1](https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html). A dev-mode warning is appropriate when no name is detectable at runtime. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think most often the name will come from associated content (visible layer name, card title, etc) and the thumbnail itself will effectively be alt="". So I'm not sure throwing a warning is necessary if we default to an empty alt?

@nikkimk nikkimk Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@5t3ph we could follow asset's pattern of the decorative attribute being required. What are your thoughts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My bad: it was swc-avatar that had the decorative property. And decorative sets aria-hidden

@5t3ph 5t3ph self-assigned this Jun 25, 2026
@nikkimk nikkimk requested a review from 5t3ph July 6, 2026 14:48
@nikkimk nikkimk enabled auto-merge (squash) July 7, 2026 14:42
@nikkimk nikkimk disabled auto-merge July 7, 2026 15:09
@nikkimk nikkimk enabled auto-merge (squash) July 7, 2026 18:33
@nikkimk nikkimk added the run_vrt Triggers the Chromatic VRT run for 2nd-gen label Jul 7, 2026
@nikkimk nikkimk disabled auto-merge July 7, 2026 18:37
@nikkimk nikkimk enabled auto-merge (squash) July 7, 2026 18:51
@nikkimk nikkimk merged commit aa25c41 into main Jul 7, 2026
33 of 34 checks passed
@nikkimk nikkimk deleted the nikkimk/swc-2196-thumbnail-a11y branch July 7, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y Issues or PRs related to accessibility High priority PR review PR is a high priority and should be reviewed ASAP run_vrt Triggers the Chromatic VRT run for 2nd-gen Status:Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants