Skip to content

fix(illustrated-message): center actions slot content#6457

Open
cdransf wants to merge 2 commits into
mainfrom
cdransf/illustrated-message-actions-slot-alignment
Open

fix(illustrated-message): center actions slot content#6457
cdransf wants to merge 2 commits into
mainfrom
cdransf/illustrated-message-actions-slot-alignment

Conversation

@cdransf

@cdransf cdransf commented Jun 26, 2026

Copy link
Copy Markdown
Member

Description

Wraps the slot[name="actions"] in a .swc-IllustratedMessage-actions div with display: flex; justify-content: center so that buttons and button groups placed in the actions slot are horizontally centered, consistent with the illustration, heading, and description above them.

Motivation and context

When PR #6454 added slot="actions" support to swc-illustrated-message, the slot was placed as a direct child of .swc-IllustratedMessage-content (a flex column). That container uses text-align: center for inline text but has no align-items: center, so block-level slotted content defaulted to left-aligned. The fix follows the existing wrapper pattern already used for .swc-IllustratedMessage-description.

Related issue(s)

  • fixes SWC-2312

Screenshots (if appropriate)

Before/after of the Actions story at size l showing centered button.

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

  • Actions slot single button is centered
    a. Open the Illustrated Message Actions story in Storybook
    b. Confirm the "Browse files" button is horizontally centered below the heading and description at sizes s, m, and l
  • Actions slot button group is centered
    a. On the same story, scroll to the "No results found" instance with two buttons
    b. Confirm the button group is horizontally centered as a unit, with both buttons still laid out in a row
  • No regression to heading or description alignment
    a. Confirm the heading and description text remain centered across all sizes

Device review

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

Accessibility testing checklist

  • Keyboard (required — document steps below)
    a. Open the Illustrated Message Actions story in Storybook
    b. Press Tab to move focus into the component
    c. Confirm focus lands on the "Browse files" button and the focus indicator is visible
    d. On the button-group instance, confirm Tab moves between "Clear filters" and "Browse all" in order with no trapped focus
  • Screen reader (required — document steps below)
    a. Open the Illustrated Message Actions story with VoiceOver or NVDA
    b. Navigate into the component and confirm the heading, description, and button label are each announced correctly
    c. Confirm no duplicate or unexpected announcements from the wrapper div (it has no role or label and should be transparent to the accessibility tree)

@cdransf cdransf self-assigned this Jun 26, 2026
@cdransf cdransf requested a review from a team as a code owner June 26, 2026 19:50
@cdransf cdransf added Component:Illustrated message Spectrum 2 Issues related to Spectrum 2 labels Jun 26, 2026
@changeset-bot

changeset-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9ebb370

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

@github-actions

Copy link
Copy Markdown
Contributor

📚 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-6457

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.

@cdransf cdransf added Status:Ready for review PR ready for review or re-review. run_vrt Triggers the Chromatic VRT run for 2nd-gen labels Jun 26, 2026

@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.

Thanks for working on this! Little suggestion to simplify.

Comment thread 2nd-gen/packages/swc/components/illustrated-message/illustrated-message.css Outdated
@cdransf cdransf requested a review from 5t3ph June 26, 2026 20:49

@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.

Yay CSS! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component:Illustrated message run_vrt Triggers the Chromatic VRT run for 2nd-gen Spectrum 2 Issues related to Spectrum 2 Status:Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants