Skip to content

Notices: switch to core Snackbar notices everywhere - #52193

Merged
CGastrell merged 12 commits into
trunkfrom
update/move-jetpack-notices-to-bottom-left
Sep 28, 2026
Merged

CGastrell merged 12 commits into
trunkfrom
update/move-jetpack-notices-to-bottom-left

Conversation

@simison

@simison simison commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #52015

Proposed changes

  • Switch to directly using core Notices fully across the repo instead of using a custom component in between.

Related product discussion/links

Does this pull request change what data or activity we track or use?

Testing instructions

  • Test notices on every screen

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the update/move-jetpack-notices-to-bottom-left branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/move-jetpack-notices-to-bottom-left
bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/move-jetpack-notices-to-bottom-left

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added [Feature] Publicize Now Jetpack Social, auto-sharing [JS Package] Components [Package] My Jetpack [Package] Newsletter [Package] Publicize [Package] Scan [Package] Seo [Package] VideoPress [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Social Issues about the Jetpack Social plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Status] In Progress [Tests] Includes Tests Admin Page React-powered dashboard under the Jetpack menu RNA labels Sep 10, 2026
@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: October 6, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Social plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Videopress plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Sep 10, 2026
@jp-launch-control

jp-launch-control Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 5 files.

File Coverage Δ% Δ Uncovered
projects/packages/videopress/src/client/hooks/use-resumable-uploader/index.ts 7/43 (16.28%) -11.63% 5 💔
projects/packages/videopress/src/dashboard/components/onboarding-modal/intro-video.tsx 9/15 (60.00%) -13.33% 2 ❤️‍🩹
projects/packages/publicize/_inc/components/services/use-request-access.ts 0/33 (0.00%) 0.00% 1 ❤️‍🩹
projects/packages/videopress/src/dashboard/hooks/use-update-chapters.ts 5/5 (100.00%) 0.00% 0 💚
projects/packages/videopress/src/dashboard/components/editor/use-edit-session.ts 102/105 (97.14%) 0.95% -1 💚

Full summary · PHP report · JS report

Coverage check overridden by I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. .

@CGastrell

CGastrell commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Took the "all in" version for a spin on a JN site (WP 7.1.1). I think the direction is right — picking boot's placement as the single answer is what lets the SEO override delete cleanly, and dropping Scan's second SnackbarList removes the duplicate hazard instead of restyling around it. One snackbar per surface everywhere I checked.

Three things need sorting before it can land. I pushed fixes for all three to fix/notices-snackbar-52193, one commit each — cherry-pick them, or say the word and I'll open them as a PR into your branch.

1. Dangling import — projects/packages/my-jetpack/_inc/data/products/use-install-plugins.ts:1 still imports the deleted useGlobalNotices. It's the only typecheck error and it also fails Build all projects. It needs { type: 'snackbar' } as well, or the "installed successfully" toast gets created and never rendered.

2. Two my-jetpack suites fail to run — module-toggle and pending-notice mock @wordpress/data wholesale, so the real notices store resolves keyedReducer to undefined. Same shim the VideoPress suites here already carry. Jest-only; wp-notices is externalized at runtime.

3. My Jetpack toasts land bottom-left, under the admin sidebar. This one took a live site to spot. It's the only mount using a .module.scss, so CSS Modules hashes the .components-snackbar selector that snackbar-container() nests, and the centering half of the mixin never matches. Shipped CSS:

.snackbar-notices--aQOoS .components-snackbar--tQbsf { margin-inline: auto; }

Centre of the snackbar, viewport 1327 wide, centre at 664:

Surface Centre
SEO / Newsletter (boot's list) 663
AI hub 664
Jetpack Settings 664
My Jetpack 87

At x=16 the sidebar paints over it and the message is clipped:

[screenshot uploading: My Jetpack toast clipped by the sidebar]
notices-my-jetpack-after-as-submitted

:global(.components-snackbar) sorts it — the pattern that file already uses for :global(.jp-admin-page__page):

[screenshot uploading: My Jetpack toast centred after the fix]

notices-my-jetpack-after-fixed

And here's the SEO page with the override gone, which was your original question — boot's placement, nothing overriding it:

[screenshot uploading: SEO page snackbar, boot placement]

notices-seo-after

A few smaller things I ran into, curious how you see them:

  • Losing the type: 'snackbar' default means a missed call site renders nothing, silently. Use class_exists() guard for Featured_Content. #1 was exactly that miss. Would a thin helper or a lint rule be worth it, rather than leaning on review to catch the next one?
  • _inc/client/settings/index.jsx:117 mounts <SnackbarNotices />, but nothing in _inc/client dispatches to @wordpress/notices — the Sharing tab's Publicize section is the legacy toggle, not the package. It's dead weight before and after this PR, so maybe worth dropping while we're in here?
  • js-packages/components changelog is patch for removing a public export — I think that wants minor. And since the toast moves in My Jetpack, backup/protect/search/boost surface the same change as the three plugins that got entries.
  • The branch says "bottom-left" but everything else lands bottom-centre, so my fix makes My Jetpack match the rest. Shout if it's meant to be the other way round and I'll flip it.

Two gaps in what I checked: the legacy Newsletter mount (that URL serves the wp-build dashboard on my site), and VideoPress/Social/Scan, which are plan-gated on a free JN site. Those only dispatch, and boot's renderer is verified on the pages I could reach — but worth a second pair of eyes if you have a site that reaches them.

How does this look to you?

— Terminator

@simison

simison commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

Feel free to push to the branch.

snackbar-notices--aQOoS type overrides as fixes won't be safe; something in the surrounding product CSS would need changes preferably instead.

Same for anything targeting component internal selectors; not sustainable as a fix.

@CGastrell

CGastrell commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Agreed, and thanks — that override was the wrong shape. Reworked it.

The real problem is that My Jetpack is the only one of the mounts placing its snackbars from a CSS module. snackbar-container() styles .components-snackbar itself, so a module hashes that selector out of existence and the centering silently never applies. The AI hub, Jetpack Settings and Newsletter mounts all use plain stylesheets, which is why only this one drifted.

So instead of re-declaring anything, the rule moves to the package's global stylesheet (_inc/style.module.scss, next to the other rules that style wp-admin chrome) and the component takes a plain class. We now write nothing that targets component internals — the mixin emits its own selector, unhashed:

.my-jetpack-snackbar-notices { position: fixed; bottom: …; }
.my-jetpack-snackbar-notices .components-snackbar { margin-inline: auto; }

Same result on the site, arrived at properly — centre 663 against a viewport centre of 664, one snackbar, via a real module toggle:

[screenshot uploading: My Jetpack toast centred via the global class]
notices-my-jetpack-global-class

Pushed all three to update/move-jetpack-notices-to-bottom-left. Typecheck is clean and the my-jetpack suite is green (24/187).

Worth noting the same trap applies to anything else that reaches for that mixin from a .module.scss later — it fails quietly, with no build warning and no visual clue until someone looks at a toast on a wide screen.

— Terminator

@simison

simison commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

Doesn't My Jetpack now use WP build and Boot container? Thought I saw that happen but could be wrong. That would ship notice slot without My Jetpack doing anything.

@CGastrell
CGastrell force-pushed the update/move-jetpack-notices-to-bottom-left branch from 5249482 to 317bd65 Compare September 21, 2026 16:08
@CGastrell

CGastrell commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Rebased onto trunk and swept every screen this touches. Two findings.

Trunk has a duplicate-toast bug today, and this PR fixes it. My Jetpack and the AI Hub moved onto wp-build after this branch forked (#52446, #52411), so boot's Root already mounts a SnackbarNotices. Trunk still mounts <GlobalNotices /> inside boot's stage — one toggle, two toasts:

01-my-jetpack-trunk-duplicate 02-ai-hub-trunk-duplicate

So both of this PR's mounts on those pages were redundant too. I dropped my earlier centering commit and deleted the mounts instead, as this branch already does for Scan:

03-my-jetpack-after-fixed 04-ai-hub-after-fixed

SEO with the override gone, your original question:

05-seo-after

Every screen, same probe — count, which list, center pixel (viewport centre is 664):

Screen Under boot Lists Centre
My Jetpack yes 1 — boot's 663
AI Hub yes 1 — boot's 663
Newsletter (wp-build) yes 1 — boot's 663
Newsletter (legacy app) no 1 — its own 663
Jetpack Settings no 1 — its own 663
SEO yes 1 — boot's 663
Scan yes 1 — boot's 663
VideoPress yes 1 — boot's 663
Social yes 1 — boot's 663

Newsletter's legacy app and Jetpack Settings aren't boot pages, so those two mounts stay.

Caveat on the shots: My Jetpack's are a real module toggle; the AI Hub pair is a dispatched notice, since AI saves need a plan the test site lacks.

Two rebase extras: private-thumbnail-source.test.tsx landed on trunk mocking the subpath this branch deletes, and the AI Hub's save-confirmation tests now render the app beside a SnackbarNotices (what boot supplies) since the mount is gone. Typecheck and all suites green.

Note the rebase rewrote your commit, so this needed a force-push.

Still open from last time:

  • _inc/client/settings/index.jsx:117 mounts <SnackbarNotices /> but nothing in _inc/client dispatches to it. Drop it while we're here?
  • js-packages/components: I'd had GlobalNotices removed outright, but the package is published to npm and we can't see who imports it outside the monorepo — so it's deprecated instead now, same shape as the Chip shim in Componentry: Migrate Chip to @wordpress/ui Badge #48162. Changelog is minor/deprecated, and the removal can ride the next major. Nothing in this repo imports it any more.
  • backup/protect/search/boost surface the My Jetpack change too, so they may want changelog entries alongside the three that have them.

How does this look?

— Terminator

@github-actions github-actions Bot added the Docs label Sep 21, 2026
@simison

simison commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

Sounds good!

@simison

simison commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

BTW I think it's fine to remove instead of deprecate. It's so easy to migrate to core ones it doesn't seem issue with JP components, which aren't really used outside this repo anyway.

@CGastrell
CGastrell force-pushed the update/move-jetpack-notices-to-bottom-left branch from 329ab93 to 970726b Compare September 21, 2026 18:29
@CGastrell

Copy link
Copy Markdown
Contributor

Rebased onto trunk again — #52494 landed in the middle of this and overlaps us in a useful way.

@enejb hit the same thing from the other direction and removed <GlobalNotices /> from my-jetpack-screen, with the same conclusion:

No snackbar list here: the wp-build page shell already renders the notices store, and a second list showed every notice twice.

So the My Jetpack half is fixed on trunk now and my commit for it is gone — dropped as empty during the rebase. The AI Hub is still duplicating on trunk (_inc/client/ai/main.jsx:434), so that one here is still doing work.

One thing worth flagging while this is open: use-main-features.test.tsx came with #52494 and mocks @wordpress/data wholesale, which trips over the core notices store — keyedReducer is not a function, and the suite won't run. That's the third suite needing the same one-liner:

jest.mock( '@wordpress/notices', () => ( { store: 'core/notices' } ) );

Anything that mocks @wordpress/data wholesale and reaches a file dispatching to the notices store will need it, so expect a couple more while this is in flight.

Typecheck clean; my-jetpack 309, components 115, videopress 1329, plugins/jetpack 952 + 493.

— Terminator

@CGastrell
CGastrell marked this pull request as ready for review September 21, 2026 19:07
@CGastrell
CGastrell requested a review from a team as a code owner September 21, 2026 19:07
@@ -1,10 +1,17 @@
@use "../scss/mixins/breakpoints";
@use "../scss/functions/rem";
@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why we have this roundabout way of importing @wordpress/base-styles instead of doing it directly.

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.

Fair point, and I've switched both files to @use "@wordpress/base-styles/mixins" directly.

To be clear about where it came from: the wrapper is the majority pattern in the monorepo, so I followed it rather than invented it. Counting stylesheets under projects/:

  • @automattic/jetpack-base-styles/gutenberg-base-styles — 106 files
  • @wordpress/base-styles directly — 44 files

The wrapper itself is six lines of @forward over z-index, colors, variables, breakpoints, mixins and animations. Its one real benefit is giving a project the mixins without declaring @wordpress/base-styles itself — but only 24 projects declare it directly, so for the rest the wrapper is doing actual work.

Neither of these two is in that group: plugins/jetpack and packages/newsletter both already depend on @wordpress/base-styles@13.1.0, and each was pulling the wrapper in for exactly one mixin. _mixins.scss is self-sufficient (it @uses its own wpds fallbacks, variables, colors, breakpoints and functions), so the direct import works standalone. Emitted CSS is byte-identical in both bundles and stylelint is happy.

Treating this as a proof of concept rather than a cleanup — the other 106 are out of scope here, and unpicking them needs the per-project dependency check doing first, since a direct import breaks any project that doesn't declare the package. Happy to file an issue for that sweep if it looks worth doing.

— Terminator

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.

@CGastrell
CGastrell force-pushed the update/move-jetpack-notices-to-bottom-left branch from cba4ee5 to aeee27b Compare September 22, 2026 13:01
@CGastrell

Copy link
Copy Markdown
Contributor

BTW I think it's fine to remove instead of deprecate. It's so easy to migrate to core ones it doesn't seem issue with JP components, which aren't really used outside this repo anyway.

@simison I agree, but since it's a published package and there's precedent on how we handle this, I think it's no harm to first deprecate it.

@CGastrell

Copy link
Copy Markdown
Contributor

Re-reviewed at aeee27b, merged locally with current trunk. The merge is clean. Typecheck and the JS suites pass (my-jetpack, videopress, newsletter, publicize, components, jetpack gui).

Verdict: minor issues, no blockers.

  1. Two My Jetpack call sites still use the deprecated useGlobalNotices: features/use-bulk-feature-switch.ts:68 and features/use-main-features.ts:106. They still work through the shim, but they need the same useDispatch( noticesStore ) + { type: 'snackbar' } swap. Trunk's feature-list-bulk.test.tsx also still mocks the hook.
  2. The same 10-line @wordpress/data mock is copied into about 9 VideoPress test files. A shared mock would stop them drifting apart.
  3. The plugins/jetpack changelog is Type: other. The toast now shows in a new place on screen, so enhancement fits better.
  4. Code coverage check fails. It needs an override label.

— Terminator

@simison simison added the I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. label Sep 28, 2026
simison and others added 11 commits September 28, 2026 13:01
use-install-plugins was left on the deleted export, so typecheck and the build
failed. Convert it like use-activate-plugins and use-deactivate-plugins, and
pass the snackbar type the wrapper used to default.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both suites mock @wordpress/data wholesale, so the real notices store resolved
keyedReducer to undefined and the suites failed to run. Mock the store the way
the VideoPress suites already do.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
private-thumbnail-source landed on trunk mocking the global-notices subpath
this branch removes, so the suite could not run. Mock the core store instead,
like its siblings here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The AI Hub moved onto wp-build in #52411, so boot's Root already mounts a
SnackbarNotices and a second list shows every toast twice.

Drop the mount and its placement rule. The save-confirmation tests render the
app beside a SnackbarNotices, which is what boot supplies in production, so
they keep asserting on the text a user reads.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@automattic/jetpack-components is published to npm, so dropping the named
exports under a patch would break downstream consumers on a semver-compatible
upgrade. We cannot see who imports it outside this monorepo.

Restore the component, the hook and the barrel export, mark both deprecated,
add a README pointing at SnackbarNotices, and file the changelog as a minor
deprecation. Nothing in this repo imports it any more, so it can go in the
next major.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
use-main-features landed on trunk mocking @wordpress/data wholesale, and it
reaches pending-notice, which this branch points at the core notices store.
The real store then resolves keyedReducer to undefined and the suite cannot
run. Mock the store, like its siblings here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two continuation lines kept spaces where prettier wants a tab. Rebase replays
do not run the pre-commit hook, so the drift survived the earlier conflict
resolution and failed the ESLint job.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both files pulled in the jetpack-base-styles wrapper for one mixin. The
wrapper only forwards @wordpress/base-styles, and both projects already
depend on it directly, so the indirection buys nothing here.

Emitted CSS is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
use-bulk-feature-switch landed on trunk mocking @wordpress/data wholesale and
reaches a file this branch points at the core notices store, so keyedReducer
resolves to undefined and the suite cannot run. Same one-liner as its siblings.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Trunk added useEditSession after this branch; VideoPress no longer mounts GlobalNotices, so its notices would never render.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CGastrell
CGastrell force-pushed the update/move-jetpack-notices-to-bottom-left branch from aeee27b to 5fec96e Compare September 28, 2026 16:05
Boot renders only snackbar-type notices, so the three trim editor
notices dispatched without `type: 'snackbar'` never appeared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CGastrell

CGastrell commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor
Before After
Save fails before-error after-error
Save completes before-success after-success

@CGastrell
CGastrell merged commit 2b50f3b into trunk Sep 28, 2026
119 checks passed
@CGastrell
CGastrell deleted the update/move-jetpack-notices-to-bottom-left branch September 28, 2026 18:50
@github-actions github-actions Bot added [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. and removed [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Admin Page React-powered dashboard under the Jetpack menu Docs [Feature] Publicize Now Jetpack Social, auto-sharing I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [JS Package] Components [Package] My Jetpack [Package] Newsletter [Package] Publicize [Package] Scan [Package] Seo [Package] VideoPress [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Social Issues about the Jetpack Social plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. RNA [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants