Repository navigation
Notices: switch to core Snackbar notices everywhere - #52193
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
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:
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. |
Code Coverage SummaryCoverage changed in 5 files.
Full summary · PHP report · JS report Coverage check overridden by
I don't care about code coverage for this PR
|
|
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 Three things need sorting before it can land. I pushed fixes for all three to 1. Dangling import — 2. Two my-jetpack suites fail to run — 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 .snackbar-notices--aQOoS .components-snackbar--tQbsf { margin-inline: auto; }Centre of the snackbar, viewport 1327 wide, centre at 664:
At x=16 the sidebar paints over it and the message is clipped: [screenshot uploading: My Jetpack toast clipped by the sidebar]
[screenshot uploading: My Jetpack toast centred after the fix]
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]
A few smaller things I ran into, curious how you see them:
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 |
|
Feel free to push to the branch.
Same for anything targeting component internal selectors; not sustainable as a fix. |
|
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. |
5249482 to
317bd65
Compare
|
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
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:
SEO with the override gone, your original question:
Every screen, same probe — count, which list, center pixel (viewport centre is 664):
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: Note the rebase rewrote your commit, so this needed a force-push. Still open from last time:
How does this look? — Terminator |
|
Sounds good! |
|
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. |
329ab93 to
970726b
Compare
|
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
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 ( One thing worth flagging while this is open: jest.mock( '@wordpress/notices', () => ( { store: 'core/notices' } ) );Anything that mocks Typecheck clean; my-jetpack 309, components 115, videopress 1329, plugins/jetpack 952 + 493. — Terminator |
| @@ -1,10 +1,17 @@ | |||
| @use "../scss/mixins/breakpoints"; | |||
| @use "../scss/functions/rem"; | |||
| @use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; | |||
There was a problem hiding this comment.
I don't understand why we have this roundabout way of importing @wordpress/base-styles instead of doing it directly.
There was a problem hiding this comment.
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-stylesdirectly — 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
cba4ee5 to
aeee27b
Compare
@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. |
|
Re-reviewed at Verdict: minor issues, no blockers.
— Terminator |
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>
aeee27b to
5fec96e
Compare
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>













Follow-up to #52015
Proposed changes
Related product discussion/links
Does this pull request change what data or activity we track or use?
Testing instructions