Skip to content

feat(actiongroup): full fidelity styles#6484

Draft
rise-erpelding wants to merge 23 commits into
swc-2212/migrate-action-groupfrom
swc-2216/action-group-full-fidelity
Draft

feat(actiongroup): full fidelity styles#6484
rise-erpelding wants to merge 23 commits into
swc-2212/migrate-action-groupfrom
swc-2216/action-group-full-fidelity

Conversation

@rise-erpelding

@rise-erpelding rise-erpelding commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Description

Phase 5 (styling / full fidelity) of the swc-action-group migration, per SWC-2216.

  • Stories: Extended action-group.stories.ts to full Phase 5 scope: Anatomy, Sizes, Orientations, Static colors, Disabled, Compact (horizontal and vertical shown side by side), Quiet (demonstrates the compact-join being disabled when both are set), Justified.
  • action-group.css: Built out from the Phase 5 stub — flex layout with size-based gap (spacing-100 default, spacing-75 at xs/s, translated from spectrum-two's actiongroup/index.css); orientation="vertical" column stacking; justified equal-fill via flex: 1 1 0%; compact border-join implemented via a CSS custom-property cascade onto --swc-action-button-border-*-radius (interior corners zeroed per child position, outer corners left at the button's natural radius); compact has no effect when quiet is also set, matching 1st-gen. Focus-ring stacking in compact mode uses :focus-within rather than :focus-visibledelegatesFocus retargets :focus/:focus-within onto the custom-element host in Chromium but not :focus-visible, so the original :focus-visible selector never matched and the z-index escalation was dead, letting a focused button's ring get covered by an adjacent button's border (resolves SWC-1342).
  • ActionGroup.ts: Wrapped the slot in an internal .swc-ActionGroup element per the migration plan's Phase 5 checklist; added the @cssprop --swc-action-group-gap doc tag.
  • action-button.css / ActionButton.ts (prerequisite, per migration plan): Exposed four logical corner-radius custom properties (--swc-action-button-border-{start-start,start-end,end-start,end-end}-radius), each falling back to the existing --swc-action-button-border-radius, so action-group's compact mode can override individual corners without hardcoding a size-specific token. Also added inline-size: 100% to .swc-ActionButton — the shadow-DOM <button> was shrink-wrapping to its own content regardless of how wide an ancestor flex layout stretched the custom-element host, so vertical and vertical + compact action groups rendered with visibly unequal button widths even though the (invisible) host boxes were already stretched correctly.

Motivation and context

Implements SWC-2216 (Phase 5: styling) of the Action Group 2nd-gen migration epic (SWC-2212), translating the spectrum-two S2 source (components/actiongroup/index.css) into the 2nd-gen token-based CSS structure per the approved migration plan. This is the last functional gap before Phase 6 (testing) and Phase 7 (documentation) — API and accessibility semantics were completed in SWC-2215.

Related issue(s)

  • SWC-2212: Gen2 migration: Action Group (epic)
  • SWC-2216: Migrate rendering and styles (Phase 5)
  • SWC-1342: sp-action-group sets z-index on focused button, hiding focus indicator (resolved)

Screenshots (if appropriate)

  • Storybook — Compact story: horizontal and vertical variants side by side, showing joined borders with outer-corner-only rounding.
  • Storybook — Orientations, Sizes, Static colors, Justified stories.

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

  • Compact join renders with correct corner radii

    1. Open the Action Group Compact story in the 2nd-gen Storybook (yarn storybook from 2nd-gen/)
    2. Inspect both the horizontal and vertical groups
    3. Expect: shared borders between adjacent buttons collapse to a single 1px line; only the outer corners of the strip are rounded; interior corners are square
  • Compact focus ring is never clipped by a neighbor

    1. In the Compact story, Tab into the horizontal group, then press to move through each button
    2. Repeat for the vertical group with
    3. Expect: at every position (first, middle, last), the focused button's complete rectangular focus ring is visible and unobstructed by the adjacent button's border
  • Vertical and vertical + compact groups have equal-width buttons

    1. In the Orientations story and the vertical group in the Compact story, compare button widths visually and via DevTools (getBoundingClientRect() on each swc-action-button's inner <button>)
    2. Expect: all buttons in a given vertical group are the same width, matching the widest label
  • Quiet disables the compact join

    1. Open the Quiet story
    2. Compare the quiet-only group to the quiet + compact group
    3. Expect: both render identically — no border join, no corner-radius reset, regardless of compact
  • Justified fills the available width

    1. Open the Justified story
    2. Expect: all three buttons expand equally to fill the constrained container width, with even gaps
  • Standalone and horizontal action-button usage is unaffected

    1. Open the Action Button stories (all variants) and the Action Group Playground/Overview stories in default (horizontal) orientation
    2. Expect: no width or layout regression from the inline-size: 100% change on .swc-ActionButton — standalone buttons and horizontal groups still size to content, not to 100% of some ancestor

Device review

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

Accessibility testing checklist

Required: Complete each applicable item and document your testing steps (replace the placeholders with your component-specific instructions).

  • Keyboard (required — document steps below) — What to test for: Focus order is logical; Tab reaches the component and all interactive descendants; Enter/Space activate where appropriate; arrow keys work for tabs, menus, sliders, etc.; no focus traps; Escape dismisses when applicable; focus indicator is visible.

    1. Open the Action Group Compact story in 2nd-gen Storybook
    2. Tab into the horizontal group — expect: focus lands on the first button with a fully visible focus ring
    3. Press to move to the second, then third button — expect: at each step, the focused button's ring is complete and not covered by either neighbor
    4. Repeat steps 2–3 in the vertical group using
    5. No regression to Tab/Arrow behavior established in SWC-2215 (one Tab stop into the strip; arrow keys move among items; wraps at the ends)
  • Screen reader (required — document steps below) — What to test for: Role and name are announced correctly; state changes (e.g. expanded, selected) are announced; labels and relationships are clear; no unnecessary or duplicate announcements.

    1. Open the Action Group Compact and Justified stories with VoiceOver (macOS) or NVDA (Windows)
    2. Navigate through the group — expect: no change in announcements from the non-styled group (styling-only phase); group and button roles/names announce exactly as established in SWC-2215

@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 647ca0c

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

This PR includes changesets to release 85 packages
Name Type
@adobe/spectrum-wc Minor
@spectrum-web-components/core Minor
@spectrum-web-components/action-group Patch
@spectrum-web-components/action-bar Patch
@spectrum-web-components/vrt-compare Patch
@spectrum-web-components/bundle Patch
documentation Patch
@spectrum-web-components/accordion Patch
@spectrum-web-components/action-button Patch
@spectrum-web-components/action-menu Patch
@spectrum-web-components/alert-banner Patch
@spectrum-web-components/alert-dialog Patch
@spectrum-web-components/asset Patch
@spectrum-web-components/avatar Patch
@spectrum-web-components/badge Patch
@spectrum-web-components/breadcrumbs Patch
@spectrum-web-components/button-group Patch
@spectrum-web-components/button Patch
@spectrum-web-components/card Patch
@spectrum-web-components/checkbox Patch
@spectrum-web-components/clear-button Patch
@spectrum-web-components/close-button Patch
@spectrum-web-components/coachmark Patch
@spectrum-web-components/color-area Patch
@spectrum-web-components/color-field Patch
@spectrum-web-components/color-handle Patch
@spectrum-web-components/color-loupe Patch
@spectrum-web-components/color-slider Patch
@spectrum-web-components/color-wheel Patch
@spectrum-web-components/combobox Patch
@spectrum-web-components/contextual-help Patch
@spectrum-web-components/dialog Patch
@spectrum-web-components/divider Patch
@spectrum-web-components/dropzone Patch
@spectrum-web-components/field-group Patch
@spectrum-web-components/field-label Patch
@spectrum-web-components/help-text Patch
@spectrum-web-components/icon Patch
@spectrum-web-components/icons-ui Patch
@spectrum-web-components/icons-workflow Patch
@spectrum-web-components/icons Patch
@spectrum-web-components/iconset Patch
@spectrum-web-components/illustrated-message Patch
@spectrum-web-components/infield-button Patch
@spectrum-web-components/link Patch
@spectrum-web-components/menu Patch
@spectrum-web-components/meter Patch
@spectrum-web-components/modal Patch
@spectrum-web-components/number-field Patch
@spectrum-web-components/overlay Patch
@spectrum-web-components/picker-button Patch
@spectrum-web-components/picker Patch
@spectrum-web-components/popover Patch
@spectrum-web-components/progress-bar Patch
@spectrum-web-components/progress-circle Patch
@spectrum-web-components/radio Patch
@spectrum-web-components/search Patch
@spectrum-web-components/sidenav Patch
@spectrum-web-components/slider Patch
@spectrum-web-components/split-view Patch
@spectrum-web-components/status-light Patch
@spectrum-web-components/swatch Patch
@spectrum-web-components/switch Patch
@spectrum-web-components/table Patch
@spectrum-web-components/tabs Patch
@spectrum-web-components/tags Patch
@spectrum-web-components/textfield Patch
@spectrum-web-components/thumbnail Patch
@spectrum-web-components/toast Patch
@spectrum-web-components/tooltip Patch
@spectrum-web-components/top-nav Patch
@spectrum-web-components/tray Patch
@spectrum-web-components/underlay Patch
@spectrum-web-components/custom-vars-viewer Patch
@spectrum-web-components/story-decorator Patch
@spectrum-web-components/base Patch
@spectrum-web-components/grid Patch
@spectrum-web-components/opacity-checkerboard Patch
@spectrum-web-components/reactive-controllers Patch
@spectrum-web-components/shared Patch
@spectrum-web-components/styles Patch
@spectrum-web-components/theme Patch
@spectrum-web-components/truncated Patch
@spectrum-web-components/eslint-plugin Patch
@spectrum-web-components/stylelint-header-plugin Patch

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

display: inline-flex;
position: relative;
inline-size: 100%;
gap: var(--swc-action-button-gap, token("base-gap-medium"));

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.

🚫 [stylelint] <order/properties-order> reported by reviewdog 🐶
Expected "gap" to come before "inline-size"

@rise-erpelding rise-erpelding changed the base branch from main to swc-2212/migrate-action-group July 8, 2026 16:04
@github-actions

github-actions Bot commented Jul 8, 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-6484

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

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 28956788727

Warning

No base build found for commit a969bf6 on swc-2212/migrate-action-group.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 96.262%

Details

  • Patch coverage: 86 of 86 lines across 1 file are fully covered (100%).

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 39252
Covered Lines: 37986
Line Coverage: 96.77%
Relevant Branches: 6466
Covered Branches: 6023
Branch Coverage: 93.15%
Branches in Coverage %: Yes
Coverage Strength: 460.37 hits per line

💛 - Coveralls

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