Skip to content

Add content suggestions modal for AI Content Planner feature#23090

Open
vraja-pro wants to merge 31 commits intofeature/content-plannerfrom
content-planner-content-suggestion-modal
Open

Add content suggestions modal for AI Content Planner feature#23090
vraja-pro wants to merge 31 commits intofeature/content-plannerfrom
content-planner-content-suggestion-modal

Conversation

@vraja-pro
Copy link
Copy Markdown
Contributor

@vraja-pro vraja-pro commented Mar 23, 2026

Context

This PR adds the Content Suggestions Modal for the AI Content Planner feature. The modal displays AI-generated content suggestions after the user confirms they want to get suggestions, showing a loading skeleton while fetching and a list of selectable suggestion cards once results are ready.

Summary

This PR can be summarized in the following changelog entry:

  • Adds content suggestions modal with loading state and suggestion cards for the AI Content Planner feature.

Relevant technical choices:

  • The modal uses a loading skeleton with a gradient fade overlay while suggestions are being fetched.
  • Each suggestion card displays an intent badge (informational, navigational, or commercial) with matching colors and icons.
  • A UsageCounter component is shown in the modal header to display remaining spark usage.
  • The component reads isPremium from the Yoast SEO editor store to conditionally show beta/reset information in the usage counter tooltip.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Edit a post in the block editor. Open the Yoast sidebar or go to the metabox.
  • Click "Get content suggestions" in the editor and confirm the approve modal.
  • Verify the content suggestions modal opens with dummy suggestions.
  • Once loaded, verify suggestion cards appear with the correct design for intent badge, title, and description.
  • Test loading state design.
  • Close the modal and verify it closes correctly.

Accessibility:

Setup

  • macOS: Enable VoiceOver with Cmd + F5
  • Windows: Start NVDA (Ctrl + Alt + N) or JAWS
  • Open the WordPress post editor with the Yoast SEO sidebar visible

Test 1: Dialog is announced correctly on open

  • With the screen reader active, click "Get content suggestions" in the
    Yoast sidebar and confirm the approve modal, triggering the content
    suggestions modal.
  • Expected: Screen reader announces "Content suggestions, web dialog"
    (or equivalent for your screen reader).

Test 2: Close button has a descriptive label

  1. Open the modal.
  2. Navigate to the close button (Tab).
  3. Expected: Screen reader announces "Close content suggestions modal".
  4. Not expected: Just "Close" or "button".

Test 3: Loading state is announced

  1. Open the modal.
  2. Wait approximately 100ms (the loading state appears after a short
    delay).
  3. Expected: Screen reader announces "Yoast Analyzing your site content…"
    without the user navigating to it.
  4. Focus is on the close button.
  5. Expected: Announcement does not interrupt currently spoken text
    (polite, not assertive).
  6. When loading completes
  7. Expected: Screen reader announces "Select a suggestion to generate a
    structured outline for your post."

Test 4: Suggestions are keyboard accessible

  1. When suggestions are visible, press Tab to navigate through them.
  2. Expected: Each suggestion is reachable and announced as a button with
    its title.

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

  • Same steps as above.

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

  • AI Content Planner sidebar/metabox editor item
  • Content suggestions modal UI

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.
  • This PR also affects Yoast SEO for Google Docs. I have added a changelog entry starting with [yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached the Google Docs Add-on label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.
  • I have run grunt build:images and commited the results, if my PR introduces new images or SVGs.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes Content Planner: Create the modal for the content suggestions

@vraja-pro vraja-pro requested a review from a team as a code owner March 23, 2026 10:59
@vraja-pro vraja-pro added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Mar 23, 2026
@vraja-pro vraja-pro changed the base branch from trunk to 1105-next-post-create-cta-inline-banner-and-approve-modal March 23, 2026 11:02
@JorPV JorPV requested a review from Copilot March 23, 2026 12:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new “Content suggestions” modal to the AI Content Planner flow, intended to show a loading state while fetching AI suggestions and then present selectable suggestion cards.

Changes:

  • Introduces ContentSuggestionsModal with loading skeleton UI and intent-badged suggestion cards.
  • Wires the new modal into ContentPlannerEditorItem so it opens after the approve step.
  • Adds a UsageCounter to the modal header (currently with placeholder values).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

File Description
packages/js/src/ai-content-planner/components/content-suggestions-modal.js New modal UI: loading skeleton, suggestion cards, intent badge mapping, usage counter.
packages/js/src/ai-content-planner/components/content-planner-editor-item.js Opens the new modal and currently supplies loading flag + placeholder suggestions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch.

…al' into content-planner-content-suggestion-modal
Copy link
Copy Markdown
Contributor

@JorPV JorPV left a comment

Choose a reason for hiding this comment

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

Please check review comments 👇🏼

vraja-pro and others added 2 commits March 23, 2026 15:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vraja-pro vraja-pro force-pushed the content-planner-content-suggestion-modal branch from 14717e3 to 27a4ee4 Compare March 24, 2026 11:42
@vraja-pro vraja-pro added this to the feature/content-planner milestone Mar 24, 2026
Base automatically changed from 1105-next-post-create-cta-inline-banner-and-approve-modal to feature/content-planner March 24, 2026 14:38
vraja-pro and others added 5 commits March 25, 2026 11:35
Co-authored-by: Jordi-PV <88150345+JorPV@users.noreply.github.com>
Co-authored-by: Jordi-PV <88150345+JorPV@users.noreply.github.com>
Co-authored-by: Jordi-PV <88150345+JorPV@users.noreply.github.com>
Modal.Container.Content only accepts children and className — it doesn't
  spread other props, so aria-live="polite" is silently dropped and never reaches the DOM.

  The fix is in the source component — wrap the content in a plain <div> that actually renders the attribute
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 25, 2026

Pull Request Test Coverage Report for Build c96dde2aca4e3ba550d825fafdd19d79d3a9c72d

Details

  • 40 of 42 (95.24%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 56.656%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/js/src/ai-content-planner/components/content-planner-editor-item.js 0 2 0.0%
Totals Coverage Status
Change from base Build df688fa2632afc948072e05a911ef32cd0b0545e: 0.05%
Covered Lines: 15308
Relevant Lines: 26346

💛 - Coveralls

@github-actions
Copy link
Copy Markdown

A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch.

@vraja-pro vraja-pro force-pushed the content-planner-content-suggestion-modal branch from b24a56c to 73bbe9a Compare March 27, 2026 11:13
@vraja-pro vraja-pro force-pushed the content-planner-content-suggestion-modal branch from 73bbe9a to 474fa32 Compare March 27, 2026 11:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

*/
export const FeatureModal = ( { isOpen, onClose, isEmptyCanvas, isPremium, isUpsell, upsellLink } ) => {
const [ status, setStatus ] = useState( "idle" );

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.

Something like this:

Suggested change
const { title: dialogTitle } = getModalContent( isEmptyCanvas );

}, [ isOpen ] );

return (
<Modal isOpen={ isOpen } onClose={ onClose }>
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.

And this prop in the modal

Suggested change
<Modal isOpen={ isOpen } onClose={ onClose }>
<Modal isOpen={ isOpen } onClose={ onClose } aria-label={ status === "idle" ? dialogTitle : __( "Content suggestions", "wordpress-seo" ) }>>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, we have the label on the modal panel. I think aria label is more for input fields and buttons.

Screen reader needs time to pick up the modal title.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After the last update the green, yellow, orange and red dots are gone!

4 participants