feat(components): standardize wp-admin snackbars, bottom-centered#447
Conversation
0e45f0e to
2718d3e
Compare
Adopt core's snackbar-container() mixin (bottom, 24px, centered, no border) for the wizard snackbar list, advertising placements wizard, and story-budget notices. Reduce WizardSnackbar to the wizard-store onRemove glue, dropping its bespoke positioning and type-colored borders. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2718d3e to
d360543
Compare
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR standardizes wp-admin snackbars across Newspack admin surfaces by switching bespoke fixed-position styling to WordPress core’s shared snackbar-container() layout and by mapping notice severity to Snackbar’s screen-reader politeness (assertive for errors, polite otherwise).
Changes:
- Replaces custom snackbar positioning CSS with
@wordpress/base-stylessnackbar-container()for wizard snackbars, the advertising placements wizard, and Story Budget notices. - Removes wizard snackbar “severity border” styling and introduces a shared snackbar list container for bottom-centered stacking.
- Adds accessibility improvements by mapping error notices to
politeness="assertive"(wizard snackbars + Story Budget).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/newspack-story-budget/src/style.scss | Updates Story Budget notice container to use core snackbar-container() and standardized stacking gap. |
| plugins/newspack-story-budget/src/app/index.js | Sets Snackbar politeness based on notice status (assertive for errors). |
| plugins/newspack-plugin/src/wizards/advertising/style.scss | Replaces custom fixed positioning with core snackbar-container() for placements wizard snackbars. |
| packages/components/src/wizard/index.js | Wraps wizard notices in a shared .newspack-wizard__snackbar-list container for standardized positioning/stacking. |
| packages/components/src/wizard/components/WizardSnackbar.js | Removes visual severity styling concerns; maps wizard notice type to Snackbar politeness while keeping wizard-store removal behavior. |
| packages/components/src/wizard/components/style.scss | Adds snackbar list container styling using core mixin + standardized gap. |
|
Hey @thomasguillot, good job getting this PR merged! 🎉 Now, the Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label. If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label. Thank you! ❤️ |
# newspack-components [4.5.0-alpha.1](https://github.com/Automattic/newspack-workspace/compare/newspack-components@4.4.0...newspack-components@4.5.0-alpha.1) (2026-07-10) ### Bug Fixes * **audience:** avoid [object Object] in segment summary ([#541](#541)) ([336e382](336e382)) * **components:** avoid interactive nesting in CoreCard header ([#396](#396)) ([dca53d4](dca53d4)) ### Features * **components:** standardize wp-admin snackbars, bottom-centered ([#447](#447)) ([8c09d8b](8c09d8b)) * **content-gate:** add pre-save checklist and gate preferences ([#408](#408)) ([5ef856b](5ef856b))
All Submissions:
Changes proposed in this Pull Request:
PR 2 of 2 in the snackbar audit, covering the wp-admin (back-end) snackbars. PR #445 covered the front-end (newspack-ui / my-account) side.
Standardizes every wp-admin snackbar onto a single neutral style: positioned at the bottom, 24px from the edge, visually centered, with no border. This adopts core's
snackbar-container()mixin (from@wordpress/base-styles, shipped alongside the snackbar-centering change in@wordpress/components30.6+), so the back-end side becomes mostly deletion of bespoke CSS rather than new styling.Three surfaces were affected:
WizardSnackbarinnewspack-components): dropped the bespokebottom-leftpositioning and the success/error/warning colored borders. The component is now just the wizard-storeonRemoveglue around core'sSnackbar; its notices render inside a centered container.bottom: 16px; left: 50%; translateX(-50%)container with the shared mixin.bottom: 24px; left-paddedcontainer with the shared mixin so its notices center too.Accessibility: removing the colored borders dropped the success/error/warning visual signal, so that semantic distinction now lives in the screen-reader announcement instead. Core's
Snackbarannounces on mount viaspeak()(@wordpress/a11y); we map notice severity to itspolitenessso error notices announce assertively and everything else announces politely. This applies to wizard snackbars (WizardSnackbarmaps the noticetype) and Story Budget (maps the@wordpress/noticesstatus); the advertising wizard only emits success confirmations, so it stays polite.Closes DSGNEWS-185.
How to test the changes in this Pull Request:
pnpm --filter newspack buildandpnpm --filter newspack-story-budget build, then load the local site.SnackbarList) and stay centered.#wp-a11y-speak-assertive/#wp-a11y-speak-politelive regions in the DOM), confirm an error notice is announced assertively while success/info notices announce politely.Other information: