Skip to content

Enhanced inserter notice handling for block patterns - #127

Merged
pirate-bot merged 1 commit into
developmentfrom
fix/117
Dec 4, 2026
Merged

pirate-bot merged 1 commit into
developmentfrom
fix/117

Conversation

@girishpanchal30

Copy link
Copy Markdown

Summary

Improved pattern-inserted notice detection in the DesignPackNotice component by supporting different WordPress core notice IDs and message formats, ensuring compatibility with WordPress versions before and after 6.8, including 6.8 itself.

Closes #117

Why no test case

This fix is JavaScript-only (DesignPackNotice.js), and Neve FSE has no test suite that can run it:

  • PHPUnit covers only theme loading (3 tests) and can't run editor JavaScript.
  • The repo has no Jest or Playwright setup, and the CI JS job only runs lint.

How it was verified instead. I ran a Playwright script against the real block editor on WordPress 7.1.5:

  • Before the fix, clicking a pattern showed core's "Pattern … inserted." snackbar but no Design Pack card.
  • After the fix, the card appears and stays after the snackbar fades.
  • Notices made to look like WP 6.7 (old id) and WP 6.8 ("Block pattern" wording) also show the card.
  • "Image inserted.", "Image uploaded and inserted." and "can't be inserted" don't show it.
  • A simulated German translation, including one written with %1$s, matched, and a translated image notice did not.

@pirate-bot

Copy link
Copy Markdown
Contributor

Plugin build for 01ebe79 is ready 🛎️!

@pirate-bot pirate-bot left a comment •

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.

🟢 Approved

This approves the fix: the Design Pack card now follows core's pattern-inserted snackbar on WordPress 6.3 through 7.1, on English and translated sites.

Validation details
  • Files reviewed: 1/1 changed files.
  • Core sources for 6.4, 6.7, 6.8, 6.9, 7.0 and 7.1 show both notice ids and both wordings. Each uses __() in the default domain.
  • The real matcher ran with core's i18n bundle and German 7.1 and Japanese 6.8 translations: cp /deps/wordpress/7.1/wp-includes/js/dist/hooks.js /workspace/checks/L1/hooks.js && timeout 30 node /workspace/checks/L… printed DEVIATIONS=0; CASES=24 (run R8)
  • A check over 218 core language packs (6.8 and 7.1) found no missed pattern notice and no matched image or error notice [R5].
  • On WordPress 7.1.5 with PHP 8.3.37, a pattern click showed the card, and it stayed after the snackbar faded. Image insertions showed no card.
Untested areas
  • WordPress versions before 7.1 were not run in the browser. Source reads and the isolated run cover them.
  • The browser did not produce core's Image inserted. snackbar. The isolated run covers it.
  • The theme has no JavaScript test suite, so no test was required.
  • The variant pass did not settle these places, where the fixed cause may still reach:
    • assets/js/src/components/DesignPackNotice.js:58 — unverified: no store/selector rename found in WordPress 5.5, 6.4, 6.8 or 7.1: /deps/wordpress/5.5/wp-includes/js/dist/notices.js:538-558, /deps/wordpress/6.4/wp-includes/js/dist/notices.js:640…
    • assets/css/src/common/generic.scss:38-60 — unverified: these depend on core DOM/classes, but no changed-class-to-broken-layout path was established. The suspected title-wrapper rename is not supported: edit-post-visual-editor__post-tit…
    • assets/css/src/editor.scss:3-9 — unverified: these depend on core DOM/classes, but no changed-class-to-broken-layout path was established. The suspected title-wrapper rename is not supported: edit-post-visual-editor__post-tit…
    • assets/css/src/blocks/navigation.scss:2-24 — unverified: these depend on core DOM/classes, but no changed-class-to-broken-layout path was established. The suspected title-wrapper rename is not supported: edit-post-visual-editor__post-tit…
    • not reached: wp.updates.ajax compatibility
    • assets/js/src/design-pack-notice.js:5-10 — unverified: The mount identifier is theme-owned, but the broader compatibility cause exposes another lead: unconditional createRoot() prevents mounting if supplied by WordPress 5.5, whose elem…

🤖 Automated review · run code-review-agent_6b128dca7f3fd5.20824181.


🤖 Review agent — review posted ✅ on 01ebe792 · approved · 0 findings · 30 min

Run code-review-agent_6b128dca7f3fd5.20824181 · trail

@pirate-bot
pirate-bot merged commit 49d2a97 into development Dec 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants