fix(illustrated-message): center actions slot content#6457
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 |
5t3ph
left a comment
There was a problem hiding this comment.
Thanks for working on this! Little suggestion to simplify.
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)
Screenshots (if appropriate)
Before/after of the Actions story at size l showing centered button.
Author's checklist
Reviewer's checklist
Manual review test cases
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
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
a. Confirm the heading and description text remain centered across all sizes
Device review
Accessibility testing checklist
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
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)