Keep the focus keyphrase read-only when the SEO analysis is off - #23593
Open
JorPV wants to merge 5 commits into
Open
Keep the focus keyphrase read-only when the SEO analysis is off#23593JorPV wants to merge 5 commits into
JorPV wants to merge 5 commits into
Conversation
…or/seo-analysis-disabled
…lysis is off The bulk editor let users edit the focus keyphrase even with the SEO analysis site feature disabled, unlike the post editor which hides the field entirely. The column stays visible here on purpose — the keyphrase is still useful context — but it no longer opens for editing. Read-only fields are kept out of the row draft, so they never become open fields. Since every save path iterates the open fields, `focus_keyphrase` can no longer reach an update payload and blank an existing keyphrase. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Coverage Report for CI Build 7Coverage at 41.03% (no base build to compare)Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A confirmed edge-case bug in onApplyRow can leave skipped/read-only open fields stuck in a perpetual “saving” state because setSavingField is still applied to all openFields.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR aligns the bulk editor with the “SEO analysis off” behavior by keeping the Focus keyphrase column visible for context while preventing edits, and by wiring a localized “analysis active” flag into the bulk editor’s Redux store so UI/editing behavior is consistent across tabs.
Changes:
- Added a new
analysisstore slice that readswpseoBulkEditorData.analysis.keywordAnalysisActiveand exposes a selector for “SEO analysis active”. - Made the Focus keyphrase field read-only when SEO analysis is disabled, and ensured inline-edit save paths exclude read-only fields from drafts and request payloads.
- Added/updated Jest coverage for the new slice and the read-only keyphrase behavior in the table and inline-edit hook.
File summaries
| File | Description |
|---|---|
| packages/js/tests/bulk-editor/store/analysis.test.js | New tests for initializing/selecting the SEO analysis active flag. |
| packages/js/tests/bulk-editor/hooks/use-inline-edit.test.js | New coverage to ensure read-only fields don’t enter drafts or request payloads. |
| packages/js/tests/bulk-editor/field-sets.test.js | Updates field set expectations and adds a read-only scenario test. |
| packages/js/tests/bulk-editor/bulk-editor-table.test.js | Verifies the keyphrase column stays visible but does not render an input when analysis is off. |
| packages/js/tests/bulk-editor/app.test.js | Seeds localized analysis state before store registration for consistent test behavior. |
| packages/js/src/bulk-editor/store/index.js | Registers the new analysis slice (actions/selectors/initial state/reducer). |
| packages/js/src/bulk-editor/store/analysis.js | New Redux slice + selector for the localized analysis active flag. |
| packages/js/src/bulk-editor/hooks/use-inline-edit.js | Excludes read-only fields from drafts and blocks read-only fields from save payloads. |
| packages/js/src/bulk-editor/field-sets.js | Adds readOnly support and marks Focus keyphrase read-only when analysis is off. |
| packages/js/src/bulk-editor/components/bulk-editor-content.js | Builds field sets based on the store’s “analysis active” flag so tabs reflect read-only behavior. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
onApplyRow marked every open field as saving, but only the fields that made it into a request were ever closed or unset. A read-only field that reached the open fields would sit in a permanent saving state and hold the row in edit mode. Only the fields actually going out are marked saving now, and a field that can never be saved is closed instead. A missing endpoint is deliberately not treated that way: that field stays open so it can be retried once the endpoint exists. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JorPV
marked this pull request as ready for review
September 4, 2026 14:37
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
When the SEO analysis site feature is disabled, the post editor hides the focus keyphrase input entirely. The bulk editor did not follow the same behaviour: the keyphrase column was still fully editable, so users could set a keyphrase that nothing would ever assess.
Per the discussion on the issue, the bulk editor deliberately diverges from the post editor here — the column stays visible, because the stored keyphrase is still useful context when scanning rows, but it is no longer editable.
The companion Premium PR blocks bulk AI generation in the same situation.
Summary
Relevant technical choices
focus_keyphrasecan never reach an update payload and blank a stored keyphrase.analysisstore slice rather than a newpreferencesentry. The flag is already localized underwpseoBulkEditorData.analysis; duplicating it intopreferenceswould give the page two sources of truth for one option.Test instructions for the acceptance test before the PR gets merged
Note
Test together with the Premium PR for the AI generation half of this fix.
Yoast SEO > Settings > Site features, and turn SEO analysis off and click Save changes.Yoast SEO > Tools > Bulk editorand confirm the Focus keyphrase column is still present and still shows each post's keyphrase.update_searchrequest body containsseo_titlebut nofocus_keyphrase.focus_keyphrase.yarn workspace @yoast/wordpress-seo jest tests/bulk-editorand expect 38 suites / 387 tests passing.Relevant test scenarios
The bulk editor has a content-type sub-navigation, so check at least Posts and Pages.
Test instructions for QA when the code is in the RC
Impact check
analysisslice).Other environments
Documentation
Quality assurance
Innovation
Fixes Yoast/plugins-automated-testing#3138