Skip to content

fix: replace deprecated EditorSnackbars with SnackbarNotices#386

Merged
dcalhoun merged 1 commit intotrunkfrom
fix/replace-deprecated-editor-snackbars
Mar 18, 2026
Merged

fix: replace deprecated EditorSnackbars with SnackbarNotices#386
dcalhoun merged 1 commit intotrunkfrom
fix/replace-deprecated-editor-snackbars

Conversation

@dcalhoun
Copy link
Copy Markdown
Member

@dcalhoun dcalhoun commented Mar 18, 2026

What?

Replace the deprecated wp.editor.EditorSnackbars component with wp.notices.SnackbarNotices.

Why?

wp.editor.EditorSnackbars was deprecated in @wordpress/editor v7.0 and will be removed in v7.2, generating a deprecation warning in the console on every editor load:

[Warning] wp.editor.EditorSnackbars is deprecated since version 7.0 and will be removed in version 7.2. Please use wp.notices.SnackbarNotices instead.

How?

  • Swap EditorSnackbars (from @wordpress/editor) for SnackbarNotices (from @wordpress/notices) in layout/index.jsx
  • Replace the internal WordPress class components-editor-notices__snackbar with a project-owned gutenberg-kit-layout__snackbar class
  • Move the snackbar positioning styles from editor/style.scss into layout/style.scss, co-locating them with the component that renders the snackbar

Testing Instructions

  1. Open the editor in your desktop web browser by running make dev-server and navigating to the local URL with the ?dev_mode parameter appended (e.g. http://localhost:5173/?dev_mode).
  2. Open the browser console (Web Inspector).
  3. Verify the following deprecation warning is no longer present:

    wp.editor.EditorSnackbars is deprecated since version 7.0 and will be removed in version 7.2. Please use wp.notices.SnackbarNotices instead.

  4. Trigger a snackbar notice (e.g. copy all content via the editor menu) and verify it displays correctly.

Accessibility Testing Instructions

N/A — no user-facing UI changes.

Screenshots or screencast

N/A — no user-facing UI changes.

`wp.editor.EditorSnackbars` is deprecated since @wordpress/editor v7.0
and will be removed in v7.2. Replace with `wp.notices.SnackbarNotices`,
using a project-owned `gutenberg-kit-layout__snackbar` class and moving
the positioning styles to layout/style.scss.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dcalhoun dcalhoun added the [Type] Code Quality Issues or PRs that relate to code quality label Mar 18, 2026
@dcalhoun dcalhoun marked this pull request as ready for review March 18, 2026 00:27
@dcalhoun dcalhoun requested a review from adalpari March 18, 2026 00:27
Copy link
Copy Markdown

@adalpari adalpari left a comment

Choose a reason for hiding this comment

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

Works as expected! 👏 👏

@dcalhoun dcalhoun merged commit c3b3224 into trunk Mar 18, 2026
14 checks passed
@dcalhoun dcalhoun deleted the fix/replace-deprecated-editor-snackbars branch March 18, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants