Skip to content

docs(a11y): action menu a11y migration docs#6162

Merged
nikkimk merged 8 commits into
mainfrom
nikkimk/action-menu-a11y-migration
Apr 27, 2026
Merged

docs(a11y): action menu a11y migration docs#6162
nikkimk merged 8 commits into
mainfrom
nikkimk/action-menu-a11y-migration

Conversation

@nikkimk
Copy link
Copy Markdown
Contributor

@nikkimk nikkimk commented Apr 9, 2026

Description

In spectrum-web-components/CONTRIBUTOR-DOCS/03_project-planning/03_components/action-menu/accessibility-migration-analysis.md:

  • Documented recommendations for ARIA roles, states, and properties for the 2nd-gen action-menu
  • Shadow DOM and cross-root ARIA considerations documented, including any limitations or required workarounds (e.g., ElementInternals, cross-root ARIA delegation)
  • Accessibility tree expectations documented, including expected node roles, names, states, and hierarchy
  • Keyboard interaction model fully specified, covering focus management, key bindings, roving tabindex or active-descendant patterns, and focus trapping where applicable
  • Testing requirements defined, including unit tests, integration tests, and manual screen reader testing matrix (JAWS, NVDA, VoiceOver)
  • Known 1st-gen accessibility issues cataloged with disposition (fix in 2nd-gen, defer, or won't fix) and linked to any open GitHub issues or bugs
  • Applicable WAI-ARIA design pattern identified with relevant ARIA roles documented
  • 1st-gen component analysis completed, covering current ARIA implementation, keyboard handling, existing test coverage, and known issues with dispositions

Motivation and context

The ticket requests accessibility recommendations for action-menu as part of its migration from 1st-gen to 2nd-gen. The recommendations should produce a comprehensive set of accessibility requirements that the engineering team will use as the specification for the 2nd-gen implementation.

The 2nd-gen migration is an opportunity to address known accessibility gaps, align with the latest WAI-ARIA Authoring Practices, and ensure the component meets WCAG 2.2 AA compliance.

Related issue(s)

  • fixes SWC-1922

Screenshots (if appropriate)


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at 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 Action menu 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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 9, 2026

⚠️ No Changeset found

Latest commit: 5a930d0

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 marked this pull request as ready for review April 9, 2026 20:14
@nikkimk nikkimk requested a review from a team as a code owner April 9, 2026 20:14
@nikkimk nikkimk self-assigned this Apr 9, 2026
@nikkimk nikkimk requested a review from rubencarvalho April 9, 2026 20:14
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

📚 Branch Preview Links

🔍 First Generation 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-6162

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.

@caseyisonit caseyisonit added Status:Ready for review PR ready for review or re-review. 2nd gen These issues or PRs map to our 2nd generation work to modernizing infrastructure. High priority PR review PR is a high priority and should be reviewed ASAP labels Apr 20, 2026
@nikkimk nikkimk requested a review from cdransf April 22, 2026 21:03
@nikkimk nikkimk enabled auto-merge (squash) April 22, 2026 21:10
@nikkimk nikkimk disabled auto-merge April 22, 2026 21:10
Copy link
Copy Markdown
Member

@cdransf cdransf left a comment

Choose a reason for hiding this comment

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

Looks good! Added a few suggestions ✨


Treat **application command menus** (action menu) and **site navigation** patterns as separate 2nd-gen components or documented compositions. Their keyboard contracts, roles, and user expectations differ; conflating them encourages incorrect `role="menu"` on link lists and confusing screen reader interaction modes.

## Also read
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.

Suggested change
## Also read
### Also read


- [Action menu migration roadmap](./rendering-and-styling-migration-analysis.md) — 2nd-gen DOM, CSS, and API migration (placeholder until expanded).

## What it is not
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.

Suggested change
## What it is not
### What it is not

- **Action menu (commands):** **`swc-action-menu`** plus **`swc-menu`** with **`menu`** / **`menuitem`** family.
- **Navigation (links, site structure):** prefer disclosure navigation or menubar navigation examples as separate components or documented patterns; do not reuse **`swc-action-menu`** semantics for pure link navigation without a deliberate APG match.

## Shadow DOM and cross-root accessibility
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.

Suggested change
## Shadow DOM and cross-root accessibility
### Shadow DOM and cross-root accessibility

- Prefer focusable menu items with roving **`tabindex`** inside the menu root over `aria-activedescendant` pointing across shadow roots.
- Ensure visible focus rings and high contrast behavior for focused **`menuitem`** rows.

## Tree expectations
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.

Suggested change
## Tree expectations
### Tree expectations

- **`swc-menu`** root has **`role="menu"`** and an accessible name (from label or **`aria-labelledby`**) when needed.
- Items expose **`menuitem`** (or checkbox or radio variants) and correct **`aria-checked`** / **`aria-disabled`** as applicable.

## Keyboard
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.

Suggested change
## Keyboard
### Keyboard


When **`swc-menu`** supports **submenus**, also align submenu open/close and cross-level movement with the [menubar pattern keyboard table](https://www.w3.org/WAI/ARIA/apg/patterns/menubar/) (submenu section) or an equivalent documented mapping.

## Assistive technology and Escape
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.

Suggested change
## Assistive technology and Escape
### Assistive technology and Escape

- **Not** primary site navigation by default: for collections of links that navigate pages, the APG [disclosure navigation menu example](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/examples/disclosure-navigation/) explicitly avoids **`role="menu"`** because typical site navigation does not implement the full menu keyboard contract, and **`menu`** triggers interaction modes screen readers reserve for application widgets.
- **Not** `aria-activedescendant` for focus in 2nd-gen: cross-root ARIA does not solve active descendant across shadow boundaries reliably, and `aria-activedescendant` has known limitations on iOS VoiceOver. Action menu should use the proposed **`FocusgroupNavigationController`** (and related focus group work) as in [spectrum-web-components#6129](https://github.com/adobe/spectrum-web-components/pull/6129), not `aria-activedescendant`, for roving tabindex and arrow navigation inside the menu.

## Pattern in the WAI-ARIA APG
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.

Should this be updated? (And should it be under ## ARIA and WCAG context? Going off of the skill at .ai/skills/accessibility-migration-analysis/SKILL.md). ✨

Suggested change
## Pattern in the WAI-ARIA APG
### Pattern in the APG


**Takeaway:** use **`menu`** and **`menuitem`** family roles when behavior matches the menu button or menubar patterns. Use disclosure plus native links (or tabs or other patterns) when the primary job is in-page or multi-page navigation without application menu semantics.

## Guidelines
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.

Would this then be updated?

Suggested change
## Guidelines
### Guidelines that apply


<!-- Document content (editable) -->

## Overview
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.

From the skill:

Separate major sections with a horizontal rule (---) where existing docs use it (after Overview, after ARIA and WCAG context, after Related 1st-gen accessibility (Jira) before Recommendations, after Recommendations block before Testing).

Do we need those? ✨

@nikkimk nikkimk enabled auto-merge (squash) April 27, 2026 13:10
Copy link
Copy Markdown
Contributor

@rubencarvalho rubencarvalho left a comment

Choose a reason for hiding this comment

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

Left a few comments given the new menu direction 😄


## Overview

**`<swc-action-menu>`** (2nd-gen) is the Spectrum surface for a **menu button** that opens commands or choices in an overlay. On **smaller viewports** the menu should open in a **tray** by default for touch targets, readability, and escape from cramped layouts; on larger viewports it typically uses a **popover** unless the author **forces** popover (or tray) via API. It composes a trigger (typically a button) with `aria-haspopup="menu"`, `aria-expanded`, and `aria-controls` (or equivalent wiring) and a **`swc-menu`** that exposes **`role="menu"`** to assistive technologies regardless of tray vs popover presentation. The trigger and menu must share one DOM or shadow root because cross-root ARIA is not supported in browsers today.
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.

We found that we won’t have a concept of Tray for now, so this may need some adjustments.


### Composition and labelling

- Always compose **`swc-menu`** inside a parent that provides open/close, focus return to the trigger, and `aria-labelledby` or `aria-label` for the menu where needed.
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.

We will build menu as the current 1st gen action menu, meaning the trigger comes "included", so this may need some adjustments

- **Trigger and menu must share one root:** the trigger (button) and the **`swc-menu`** surface must live in the same tree root (for example both inside the **`swc-action-menu`** shadow root or the same light-DOM subtree owned by that host). **Cross-root ARIA** — ID references such as **`aria-controls`**, **`aria-labelledby`**, and **`aria-activedescendant`** across separate shadow roots — is not supported in browsers today, so splitting the trigger and menu across unrelated custom element boundaries breaks those relationships.
- Trigger should mirror APG menu button attributes (`aria-haspopup`, `aria-expanded`, `aria-controls` when appropriate).

### Viewport and presentation (tray vs popover)
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.

2nd-gen mobile drill-down is still WIP on the design side. There are currently no decisions on the future of tray. We will keep these out of scope until we know more.

Comment on lines +141 to +148
<swc-action-menu label="Actions">
<swc-menu id="actions-menu">
<swc-menu-item>Duplicate</swc-menu-item>
<swc-menu-item>Rename</swc-menu-item>
<swc-menu-separator></swc-menu-separator>
<swc-menu-item>Delete</swc-menu-item>
</swc-menu>
</swc-action-menu>
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 believe we may collapse this further, e.g.:

Suggested change
<swc-action-menu label="Actions">
<swc-menu id="actions-menu">
<swc-menu-item>Duplicate</swc-menu-item>
<swc-menu-item>Rename</swc-menu-item>
<swc-menu-separator></swc-menu-separator>
<swc-menu-item>Delete</swc-menu-item>
</swc-menu>
</swc-action-menu>
<swc-menu label="Actions">
<swc-menu-item>Duplicate</swc-menu-item>
<swc-menu-item>Rename</swc-menu-item>
<swc-menu-separator></swc-menu-separator>
<swc-menu-item>Delete</swc-menu-item>
</swc-menu>

@nikkimk nikkimk merged commit 5af55c8 into main Apr 27, 2026
30 checks passed
@nikkimk nikkimk deleted the nikkimk/action-menu-a11y-migration branch April 27, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2nd gen These issues or PRs map to our 2nd generation work to modernizing infrastructure. High priority PR review PR is a high priority and should be reviewed ASAP Status:Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants