feat(bulk-editor): row-level Save/Cancel and unsaved-changes tab-switch modal#23375
feat(bulk-editor): row-level Save/Cancel and unsaved-changes tab-switch modal#23375JorPV wants to merge 8 commits into
Conversation
Switching the Search/Social tab while rows have unsaved inline edits now opens a confirmation modal (Save changes / Continue without saving / Cancel) instead of silently discarding the edits. Save fires the row saves and switches; Continue discards and switches; Cancel stays on the current tab. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Coverage Report for CI Build 0Coverage decreased (-0.005%) to 57.932%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
|
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. |
There was a problem hiding this comment.
Pull request overview
Updates the Bulk Editor inline-edit UX to match the latest design by moving from per-field Apply/Discard actions to row-level Save/Cancel, and by preventing accidental loss of in-progress edits when switching between the Search/Social appearance tabs.
Changes:
- Replaces per-field Apply/Discard buttons with row-level Save/Cancel actions in the table’s Actions column.
- Adds an “Unsaved changes” confirmation modal that gates tab switching when rows are in edit mode.
- Updates and expands Jest coverage for the new row-level actions and tab-switch confirmation flows.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/js/tests/bulk-editor/bulk-editor-table.test.js | Updates table tests to assert row-level Save/Cancel behavior and row-level disablement while saving. |
| packages/js/tests/bulk-editor/app.test.js | Adds coverage for the unsaved-changes tab-switch modal and updates save flows from “Apply” to “Save”. |
| packages/js/src/bulk-editor/hooks/use-inline-edit.js | Removes the per-field discard seam from the inline-edit hook API while keeping per-field save. |
| packages/js/src/bulk-editor/components/unsaved-changes-modal.js | Introduces the new confirmation modal used when switching tabs with in-progress edits. |
| packages/js/src/bulk-editor/components/table/table-row.js | Implements row-level Save/Cancel actions and locks the entire row while any field is saving. |
| packages/js/src/bulk-editor/components/table/table-cells.js | Simplifies editable cells to just the textarea; actions move to the row-level controls. |
| packages/js/src/bulk-editor/components/table/bulk-editor-table.js | Updates inline-edit typedef/defaults to remove the per-field discard seam. |
| packages/js/src/bulk-editor/components/bulk-editor-content.js | Adds tab-switch guarding with pendingTab state and wires up the UnsavedChangesModal actions. |
| Object.entries( editing.editingRows ).forEach( ( [ id, row ] ) => | ||
| row.openFields.forEach( ( key ) => editing.onApplyField( { id: Number( id ), key } ) ) | ||
| ); | ||
| stopEditing(); |
There was a problem hiding this comment.
Acknowledged in the PR notes, flagging here for visibility: stopEditing() clears the local edit state and the tab switch happens regardless of whether the onApplyField promises resolve or reject. A save failure on this path is silently dropped — the user won't know a field didn't save. Acceptable for a "leaving anyway" flow, but worth a follow-up to at least surface a toast/notice if any promise rejects.
…r, and AI upsell into the row-level Save/Cancel redesign Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Context
Updates the inline-edit row UX to the latest design. The issue bundles two related changes; this PR covers the two Free-side ones:
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
bulk-editor-contentgates the switch onhasUnsavedEditsvia a localpendingTabstate; the modal lives alongside it (no store change).await, so clearing the edit state right after still posts the captured values.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
yarn install+grunt build:js, and open SEO → Bulk editor (admin.php?page=wpseo_page_bulk_edit).Row-level Save/Cancel
Unsaved-changes tab-switch modal
Accessibility / focus checks
Tabcycles within the modal;Escand the close X both dismiss it (same as Cancel).Relevant test scenarios
Test instructions for QA when the code is in the RC
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
Other environments
Documentation
Quality assurance
grunt build:imagesand committed the results, if my PR introduces or edits images or SVGs.Innovation
innovationlabel.Notes for the reviewer / merger
EditableFieldCellconflicts with Adds selection and bulk-action bar #23367. This PR rewritesEditableFieldCellonfeature/bulk-editor, which doesn't yet have Adds selection and bulk-action bar #23367's gradient-border / AnimateHeight tweaks to the same component. Whichever lands second will conflict — take care not to silently drop those styles or re-introduce the removed per-field Apply/Discard.Fixes Yoast/reserved-tasks#1310