Fix: reset search and filters when switching content types in Bulk Editor - #23514
Open
vraja-pro wants to merge 4 commits into
Open
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ntent type switch Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Coverage Report for CI Build 0Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage increased (+0.04%) to 55.598%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions21 previously-covered lines in 2 files lost coverage.
Coverage Stats💛 - Coveralls |
…nt types Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Bulk Editor state leakage by ensuring the query state (search + filters + pagination) is reset whenever the active content type changes, so each content type starts unfiltered.
Changes:
- Reset the entire Bulk Editor query slice to its initial state when
setActiveContentTypeis dispatched. - Update the query slice unit test to assert that all query state is reset (not just
page). - Clear the SearchBox’s local input value and cancel any pending debounced search when the content type changes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/js/tests/bulk-editor/store/query.test.js | Updates coverage to assert full query reset on content type switches. |
| packages/js/src/bulk-editor/store/query.js | Changes setActiveContentType handling to return createInitialQueryState() (full reset). |
| packages/js/src/bulk-editor/components/search-box.js | Resets local input state and cancels debounced dispatches on content type change. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 switching between content types in the Bulk Editor, the search query and filters applied to the previous content type were being carried over instead of resetting. Each content type should open with a clean, unfiltered state.
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
extraReducershandler forsetActiveContentTypeinquery.jspreviously only resetpageto1. It now returnscreateInitialQueryState(), which resetssearch,statuses,needsImprovement, andpageall at once.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
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 https://github.com/Yoast/plugins-automated-testing/issues/3086