Add content suggestions modal for AI Content Planner feature#23090
Add content suggestions modal for AI Content Planner feature#23090vraja-pro wants to merge 31 commits intofeature/content-plannerfrom
Conversation
There was a problem hiding this comment.
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
ContentSuggestionsModalwith loading skeleton UI and intent-badged suggestion cards. - Wires the new modal into
ContentPlannerEditorItemso it opens after the approve step. - Adds a
UsageCounterto 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.
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Show resolved
Hide resolved
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
Outdated
Show resolved
Hide resolved
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
|
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
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
Outdated
Show resolved
Hide resolved
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
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-suggestions-modal.js
Outdated
Show resolved
Hide resolved
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Outdated
Show resolved
Hide resolved
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
14717e3 to
27a4ee4
Compare
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
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
Pull Request Test Coverage Report for Build c96dde2aca4e3ba550d825fafdd19d79d3a9c72dDetails
💛 - Coveralls |
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Jordi-PV <88150345+JorPV@users.noreply.github.com>
|
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. |
b24a56c to
73bbe9a
Compare
73bbe9a to
474fa32
Compare
There was a problem hiding this comment.
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.
packages/js/src/ai-content-planner/components/content-suggestions-modal.js
Outdated
Show resolved
Hide resolved
packages/js/tests/ai-content-planner/components/approve-modal.test.js
Outdated
Show resolved
Hide resolved
packages/js/tests/ai-content-planner/components/content-suggestions-modal.test.js
Show resolved
Hide resolved
| */ | ||
| export const FeatureModal = ( { isOpen, onClose, isEmptyCanvas, isPremium, isUpsell, upsellLink } ) => { | ||
| const [ status, setStatus ] = useState( "idle" ); | ||
|
|
There was a problem hiding this comment.
Something like this:
| const { title: dialogTitle } = getModalContent( isEmptyCanvas ); |
| }, [ isOpen ] ); | ||
|
|
||
| return ( | ||
| <Modal isOpen={ isOpen } onClose={ onClose }> |
There was a problem hiding this comment.
And this prop in the modal
| <Modal isOpen={ isOpen } onClose={ onClose }> | |
| <Modal isOpen={ isOpen } onClose={ onClose } aria-label={ status === "idle" ? dialogTitle : __( "Content suggestions", "wordpress-seo" ) }>> |
There was a problem hiding this comment.
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.
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:
Relevant technical choices:
UsageCountercomponent is shown in the modal header to display remaining spark usage.isPremiumfrom 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:
Accessibility:
Setup
Test 1: Dialog is announced correctly on open
Yoast sidebar and confirm the approve modal, triggering the content
suggestions modal.
(or equivalent for your screen reader).
Test 2: Close button has a descriptive label
Test 3: Loading state is announced
delay).
without the user navigating to it.
(polite, not assertive).
structured outline for your post."
Test 4: Suggestions are keyboard accessible
its title.
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 Content Planner: Create the modal for the content suggestions