feat(bulk-editor): add Save edits / Cancel edits for manual edits#23437
Open
JorPV wants to merge 3 commits into
Open
feat(bulk-editor): add Save edits / Cancel edits for manual edits#23437JorPV wants to merge 3 commits into
JorPV wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds batch “Save edits / Cancel edits” controls for manual inline edits in the bulk editor, and enforces mutual exclusion between manual editing and Premium AI suggestion review (disabling row editing while AI suggestions are pending).
Changes:
- Introduces batched manual save/discard behavior via
useInlineEdit(onApplyAll/onDiscardAll) and wires it into the bulk editor UI. - Adds a new
ManualReviewActionsUI in the bulk action bar with proper singular/plural copy and disabled state while saving. - Disables each row’s Edit button when Premium reports external pending changes (
hasExternalPendingChanges), with accompanying test coverage.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/js/tests/bulk-editor/hooks/use-inline-edit.test.js | Adds unit tests covering batched manual apply/discard behavior and failure handling. |
| packages/js/tests/bulk-editor/bulk-editor-table.test.js | Tests that row Edit buttons are disabled when Premium AI suggestions are pending. |
| packages/js/tests/bulk-editor/bulk-action-bar.test.js | Adds tests for ManualReviewActions copy/actions and for showing manual review actions alongside Free upsell buttons. |
| packages/js/src/bulk-editor/hooks/use-inline-edit.js | Adds isApplyingAll state and onApplyAll batching logic; exposes new handlers via editing. |
| packages/js/src/bulk-editor/components/table/table-row.js | Disables per-row Edit button when hasExternalPendingChanges is true. |
| packages/js/src/bulk-editor/components/table/table-body.js | Threads hasExternalPendingChanges down to each row. |
| packages/js/src/bulk-editor/components/table/bulk-editor-table.js | Accepts and passes hasExternalPendingChanges into the table body. |
| packages/js/src/bulk-editor/components/bulk-editor-content.js | Computes editCount, shows bulk actions when there are unsaved edits, and wires batch apply/discard props to BulkActions. |
| packages/js/src/bulk-editor/components/bulk-action-bar.js | Adds ManualReviewActions (Save/Cancel edits UI) and renders it when there are unsaved manual edits. |
Coverage Report for CI Build 55556Coverage increased (+0.03%) to 55.036%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats💛 - Coveralls |
…s enhancing save functionality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Free users should be albe to make several manual edits across rows and save them in one action, instead of applying each field one by one. This adds batch Save edits / Cancel edits actions for manual edits. Per a product decision, manual editing and AI generation are mutually exclusive.
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
onApplyAllgroups every editing row's open drafts into one request per endpoint (update_search/update_social), reusing the existing bulk-update routes;onDiscardAllclears all drafts, reverting to the last-saved values.hasExternalPendingChanges), and AI generation is already disabled while manual edits are unsaved — so only one review bar shows at a time.ManualReviewActions, gated on the active tab); Premium needs no change, as its AI-disable-while-editing behaviour already exists.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Free — manual editing (Save edits / Cancel edits)
Run on a site with only Yoast SEO Free active.
Premium — manual + AI (mutual exclusion)
Run on a site with Yoast SEO Premium active and a valid subscription.
BulkReviewActions).You should never see the same label set for both, and the summary text differs too ("N rows with unsaved changes" for manual vs the AI suggestion count).
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 committed the results, if my PR introduces or edits images or SVGs.Innovation
Fixes Yoast/plugins-automated-testing#3063