docs(actiongroup): complete migration plan#6412
Conversation
|
📚 Branch Preview Links🔍 First Generation Visual Regression Test ResultsWhen 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: If the changes are expected, update the |
|
|
||
| - `swc-action-group` is a composite keyboard control: one Tab stop into the strip, arrow-key navigation among children via `FocusgroupNavigationController`, and optional managed selection (`selects="single|multiple"`). It is substantially more complex than `swc-button-group`, which has no roving tabindex. | ||
| - Three ARIA-breaking changes ship in this migration: host is always `role="group"` (never `toolbar` or `radiogroup`); children are always `role="button"` (never `radio` or `checkbox`); selection state is exposed via `aria-pressed`/`aria-checked` on the button's focus target rather than through host or child role changes. | ||
| - The `selects` API is retained. `swc-action-group` is the appropriate home for selection behavior until `swc-segmented-control` and `swc-toggle-button-group` exist in 2nd-gen. Consumer chooses the right component for their UX; action-group does not mandate a migration to those alternatives. |
There was a problem hiding this comment.
Are we definitely doing a toggle button group eventually? Accessibility analysis mentions it too but just want to double-confirm.
| - `swc-action-group` is a composite keyboard control: one Tab stop into the strip, arrow-key navigation among children via `FocusgroupNavigationController`, and optional managed selection (`selects="single|multiple"`). It is substantially more complex than `swc-button-group`, which has no roving tabindex. | ||
| - Three ARIA-breaking changes ship in this migration: host is always `role="group"` (never `toolbar` or `radiogroup`); children are always `role="button"` (never `radio` or `checkbox`); selection state is exposed via `aria-pressed`/`aria-checked` on the button's focus target rather than through host or child role changes. | ||
| - The `selects` API is retained. `swc-action-group` is the appropriate home for selection behavior until `swc-segmented-control` and `swc-toggle-button-group` exist in 2nd-gen. Consumer chooses the right component for their UX; action-group does not mandate a migration to those alternatives. | ||
| - Compact mode border-radius is handled entirely in CSS: action-group uses `::slotted(:first-child)` and `::slotted(:last-child)` to set `--swc-action-button-border-*-radius` custom properties, which cascade into action-button's shadow DOM. No JS attribute propagation needed; action-button must expose those properties as overridable fallbacks in its shadow CSS. |
There was a problem hiding this comment.
Originally it thought adding a data-group-position attribute was the best way to handle styling, this is a bit more aligned with how we handled accordion.
|
|
||
| | # | What changes | 1st-gen behavior | 2nd-gen behavior | Consumer migration path | | ||
| | --- | ------------ | ---------------- | ---------------- | ----------------------- | | ||
| | **B1** | `vertical` boolean → `orientation` attribute | `vertical` boolean; no default | `orientation="horizontal"` default, `orientation="vertical"` | Replace `<sp-action-group vertical>` with `<swc-action-group orientation="vertical">`. Confirmed: matches button-group PR #6395 convention. 1st-gen `vertical` gets `@deprecated` JSDoc + `window.__swc.warn()` runtime warning. | |
There was a problem hiding this comment.
Aligns with button-group - since this hasn't hit main yet it's referencing the PR, should it?
| | -------- | ---- | ------- | --------- | ----- | | ||
| | `compact` | `boolean` | `false` | `compact` | **Confirmed** (Figma). Figma labels this "Density: Compact". Buttons visually join; shared borders collapse. Quiet mode disables compact styling (same as 1st-gen). | | ||
| | `disabled` | `boolean` | `false` | `disabled` | **Confirmed** (a11y analysis). New in 2nd-gen. Uses `aria-disabled="true"` on host and propagates to children; children remain keyboard-reachable per APG guidance (SWC-621). | | ||
| | `justified` | `boolean` | `false` | `justified` | **Inferred** (SWC convention). Children fill available width equally. React S2 uses `isJustified`; 2nd-gen SWC convention drops the `is` prefix on booleans; `justified` follows that pattern. | |
There was a problem hiding this comment.
Not in the design spec but I guess observed by spectrum-css and React
5t3ph
left a comment
There was a problem hiding this comment.
Putting "Request changes" because we may need group discussion/React insight on deferring/removing selection + if/when we will add toggle button group.
|
|
||
| ### Behavioral semantics | ||
|
|
||
| #### Selection management |
There was a problem hiding this comment.
I think this should be removed entirely or at least deferred since the underlying ability of some sort of identifier for action buttons was also deferred (see value notes).
React does not have this ability, either, and it also would feel odd to have this and then pull it back when toggle button group is available.
cdransf
left a comment
There was a problem hiding this comment.
This looks awesome! Just had one question ✨
| ## TL;DR | ||
|
|
||
| - `swc-action-group` is a composite keyboard control: one Tab stop into the strip, arrow-key navigation among children via `FocusgroupNavigationController`, and optional managed selection (`selects="single|multiple"`). It is substantially more complex than `swc-button-group`, which has no roving tabindex. | ||
| - Three ARIA-breaking changes ship in this migration: host is always `role="group"` (never `toolbar` or `radiogroup`); children are always `role="button"` (never `radio` or `checkbox`); selection state is exposed via `aria-pressed`/`aria-checked` on the button's focus target rather than through host or child role changes. |
There was a problem hiding this comment.
Should we make the split between aria-pressed/aria-checked a bit clearer since button should only have aria-pressed? (It looks like we use the / as an either or like this elsewhere in the plan) ✨
Description
Phase 1 (preparation) of the 1st-gen to 2nd-gen
swc-action-groupmigration. Adds the component migration plan to CONTRIBUTOR-DOCS and updates the migration status table.The plan covers:
vertical→orientationrename with 1st-gen deprecation notice;--mod-*custom properties dropped; host role fixed torole="group"in all modes; child roles fixed torole="button"only (noradio/checkbox);RovingTabindexControllerreplaced byFocusgroupNavigationController;changeevent ordering fix (SWC-889);labelrequired warning whenselectsis set (SWC-1121); focus z-index fix (SWC-1342).emphasizedpropagation (deferred pending action-button); consumer guidance for futureswc-segmented-control/swc-toggle-button-groupalternatives;orientation="both"extension.selectsmodes,aria-pressedvsaria-checked), compact mode position-attribute mechanism (data-group-position), focus management, child propagation,changeevent ordering, cancelation timing (queueMicrotaskpattern), and re-enable reconciliation forselects="single".Motivation and context
Planning output for SWC-2214. The migration plan is the required Phase 1 artifact; no implementation work proceeds without it.
Related issue(s)
Screenshots (if appropriate)
N/A — documentation only.
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Migration plan is accurate and complete
CONTRIBUTOR-DOCS/03_project-planning/03_components/action-group/migration-plan.md.1st-gen/packages/action-group/src/ActionGroup.ts.Status table updated
CONTRIBUTOR-DOCS/03_project-planning/02_workstreams/02_2nd-gen-component-migration/01_status.md.Device review
Accessibility testing checklist
No interactive code changes. The plan documents the accessibility requirements for the implementation phases; no runtime behavior to test here.