-
Notifications
You must be signed in to change notification settings - Fork 875
Search 3.0: backend support for experience field in settings API (RSM-2291)
#48540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
adamwoodnz
merged 11 commits into
trunk
from
copilot/add-backend-support-experience-field
May 6, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ba2fbcd
feat(search): add backend support for experience field (RSM-2291)
Copilot f4e9afa
Search: narrow `experience` storage shape (RSM-2291)
adamwoodnz 0ea57f9
Search: rename `classic` experience to `inline` (RSM-2291)
adamwoodnz 860d670
Search: address backend PR review feedback (RSM-2291)
adamwoodnz b1e47a0
Search: cover update_experience() error-propagation branches (RSM-2291)
adamwoodnz e15730a
Search dashboard: stop rendering ModuleControl when feature-selector …
adamwoodnz ed61648
Sync: whitelist jetpack_search_experience option (RSM-2291)
adamwoodnz 24b58b4
Search: type-guard `experience` before sanitize_text_field() (RSM-2291)
adamwoodnz 4af42ed
Search: reject `experience` + `swap_classic_to_inline_search` mixing …
adamwoodnz caa3678
Search: propagate Modules::deactivate() result from update_experience…
adamwoodnz 3a5e726
Search: stabilize update_experience('off') no-op test (RSM-2291)
adamwoodnz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/packages/search/changelog/add-rsm-2291-experience-field-backend
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: minor | ||
| Type: added | ||
|
|
||
| Search: Add backend support for the `experience` field in the search settings REST endpoint. `POST /jetpack/v4/search/settings` accepts `experience` (`embedded`, `overlay`, `inline`, or `off`) and updates the package state in lockstep. `GET /jetpack/v4/search/settings` returns the active `experience`, derived from the legacy settings for sites that have not yet saved via the new UI. |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swap_classic_to_inline_searchis silently dropped when combined withexperience.validate_search_settings()rejects mixingexperiencewithmodule_active/instant_search_enabled(good), butswap_classic_to_inline_searchis allowed through — and then this early return ignores it without applying the value or surfacing an error. The validation error message also doesn't mention this field, so a caller debugging a missing swap update would have no signal.Today's only caller is the new front-end (which sends
{ experience }alone), so impact is theoretical. But it's a footgun for any external API consumer that bundles fields, and the asymmetry contradicts the validation's stated intent ("don't silently lose those fields").Fix options:
swap_classic_to_inline_searchwhenexperienceis set, orswap_classic_to_inline_searchbefore the early return (the existing branch below already handles a swap-only update path).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 4af42ed —
validate_search_settings()now also rejects mixingexperiencewithswap_classic_to_inline_search(returning400 rest_invalid_arguments). Updated the error message and extendedtest_update_settings_experience_rejects_mixed_legacy_fieldsto cover the new combination.