1105 next post create cta inline banner and approve modal#23074
Conversation
e245268 to
e011216
Compare
bcd98c6 to
1c7df49
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces the “Next post” content-suggestions entry points across the WordPress editor UI (inline banner, sidebar/metabox items, and an approval modal), and updates the Yoast UI library to expose a gradient sparkles icon and reuse the gradient-border styling.
Changes:
- Add a new
ai-next-postpackage area with a WP data store, inline banner injection (BlockEdit filter), and an editor plugin to ensure an initial paragraph block. - Add an
EditorIntrocomponent and wire it into Gutenberg sidebar/metabox and Elementor fills. - Update
@yoast/ui-libraryto exportGradientSparklesIconand extract gradient-border styling for reuse.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ui-library/src/index.js | Exports GradientSparklesIcon for consumers. |
| packages/ui-library/src/elements/button/style.css | Extracts/adjusts AI button styles and adds reusable gradient border utility. |
| packages/ui-library/src/elements/button/index.js | Applies gradient-border class to ai-secondary button variant. |
| packages/js/src/initializers/block-editor-integration.js | Initializes the Next Post banner/plugin during block editor integration. |
| packages/js/src/elementor/components/fills/ElementorFill.js | Adds EditorIntro to Elementor sidebar fill. |
| packages/js/src/components/fills/SidebarFill.js | Adds EditorIntro + Next Post item to the Yoast sidebar (Gutenberg). |
| packages/js/src/components/fills/MetaboxFill.js | Adds EditorIntro + Next Post item to the Yoast metabox fill. |
| packages/js/src/components/EditorIntro.js | New “Optimize…” introduction component with optional CTA prompt text. |
| packages/js/src/ai-next-post/store/index.js | Registers the yoast-seo/next-post WP data store. |
| packages/js/src/ai-next-post/store/banner.js | Slice/actions/selectors for banner dismissal state. |
| packages/js/src/ai-next-post/next-post-editor-plugin.js | Inserts a paragraph block on truly empty canvases to anchor the inline banner. |
| packages/js/src/ai-next-post/initialize.js | Registers store + BlockEdit filter + editor plugin for the inline banner. |
| packages/js/src/ai-next-post/components/one-spark-note.js | Displays “Using 1 spark” note (non-premium state). |
| packages/js/src/ai-next-post/components/next-post-inline-banner.js | New inline banner UI under the first empty paragraph. |
| packages/js/src/ai-next-post/components/next-post-editor-item.js | Sidebar/metabox section with button + approve modal. |
| packages/js/src/ai-next-post/components/next-post-button.js | “Get content suggestions” button using AI secondary styling. |
| packages/js/src/ai-next-post/components/next-post-approve-modal.js | Approval modal with different copy for empty vs non-empty canvas. |
| packages/js/images/yoast.svg | Adds Yoast logo asset used by EditorIntro. |
Comments suppressed due to low confidence (1)
packages/ui-library/src/elements/button/style.css:56
button.yst-button--ai-primarylimits the AI primary styling to actual elements, but the Button component supportsas="a"(and has specific anchor overrides earlier in this stylesheet). As a result, using variant="ai-primary" withas="a"will miss these styles.
Consider styling .yst-button--ai-primary (no element qualifier) or adding an a.yst-button--ai-primary selector as well, similar to how .yst-button is handled for anchors.
button.yst-button--ai-primary {
@apply
yst-text-white
yst-ps-2
yst-gap-1.5
yst-bg-ai-500;
border-image: none;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/js/src/ai-next-post/components/next-post-approve-modal.js
Outdated
Show resolved
Hide resolved
packages/js/src/ai-next-post/components/next-post-inline-banner.js
Outdated
Show resolved
Hide resolved
packages/js/src/ai-next-post/components/next-post-editor-item.js
Outdated
Show resolved
Hide resolved
1. first block 2. New post 3. not dismissed
571a4ea to
de1dd54
Compare
packages/js/src/ai-content-planner/components/content-planner-editor-item.js
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
This PR introduces UI and editor integration for the “next post / content suggestions” feature in the WordPress editor, including an inline banner for new posts, an editor intro CTA, and an approval modal, while also extending the UI library with a reusable gradient sparkle icon and gradient border styling.
Changes:
- Add a new
ai-content-plannermodule with store, inline banner injection into Gutenberg, and sidebar/metabox editor items + approval modal. - Add an
EditorIntrocomponent and render it in Sidebar/Metabox/Elementor fills, with conditional CTA messaging based on AI feature + post type. - Update
@yoast/ui-libraryto export a gradient sparkles icon and refactor gradient border styling for AI button variants.
Reviewed changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds a new @wordpress/wordcount entry for content counting. |
| packages/js/package.json | Adds @wordpress/wordcount dependency for empty-canvas detection. |
| packages/js/src/initializers/block-editor-integration.js | Initializes the new content planner integration in the block editor. |
| packages/js/src/components/fills/SidebarFill.js | Adds EditorIntro and the content planner sidebar item (block editor + post + AI active only). |
| packages/js/src/components/fills/MetaboxFill.js | Adds EditorIntro and the content planner metabox item (block editor + post + AI active only). |
| packages/js/src/elementor/components/fills/ElementorFill.js | Adds EditorIntro (without CTA) for Elementor. |
| packages/js/src/components/EditorIntro.js | New intro text component for editor contexts. |
| packages/js/src/ai-content-planner/** | New store + banner injection + UI components (inline banner, approve modal, sidebar item). |
| packages/js/tests/ai-content-planner/components/approve-modal.test.js | Adds RTL/Jest coverage for the new approval modal. |
| packages/ui-library/src/index.js | Exposes GradientSparklesIcon from the button sparkles icon. |
| packages/ui-library/src/elements/button/index.js | Adds gradient-border class to the ai-secondary button variant. |
| packages/ui-library/src/elements/button/style.css | Refactors gradient border styling and adjusts AI primary selector. |
| packages/js/images/yoast.svg | Adds Yoast logo asset for the editor intro. |
Comments suppressed due to low confidence (1)
packages/ui-library/src/elements/button/style.css:54
- The selector for the AI primary variant is now
button.yst-button--ai-primary, which means AI-primary styling will no longer apply when the Button is rendered as an anchor (as="a"). There are existing usages ofvariant="ai-primary"on links (e.g. introductions modals), so this change will regress their styling. Consider reverting to.yst-button--ai-primary(or adding an additionala.yst-button--ai-primaryselector) so both button and anchor renders are covered.
button.yst-button--ai-primary {
@apply
yst-text-white
yst-ps-2
yst-gap-1.5
yst-bg-ai-500;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/js/src/ai-content-planner/components/content-planner-editor-item.js
Outdated
Show resolved
Hide resolved
packages/js/src/ai-content-planner/components/content-planner-editor-item.js
Show resolved
Hide resolved
JorPV
left a comment
There was a problem hiding this comment.
Some adjustments to be done 🔧
…-inline-banner-and-approve-modal
|
CR + ACC ✅ |

Context
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Optimize your content for discovery or get new content suggestions.in metabox and sidebarOptimize your content for discovery.and the button is not rendered when:Get content suggestionsbutton and check when:Looking for inspiration?and the description:Yoast identifies content gaps in your site structure and recommends topics that strengthen your topical authority.Get content suggestionsand the description:Yoast will analyze your site and recommend topics. Note: Applying a content suggestion will replace your current blogpost content & metadata.Using 1 sparkunder the button.Test ads.
_yoast_alerts_dismissedto:a:1:{s:26:"webinar-promo-notification";b:0;}src/promotions/domain/black-friday-promotion.php, change only the year in the second date to 2027:Relevant test scenarios
Test instructions for QA when the code is in the RC
QA can test this PR by following these steps:
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.[yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached theGoogle Docs Add-onlabel to this PR.Documentation
Quality assurance
grunt build:imagesand commited the results, if my PR introduces new images or SVGs.Innovation
innovationlabel.Fixes Next post: Create CTA inline banner, and approve modal