You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Redesigns Search Dev Tools around a sidebar + detail layout, replacing the stacked overlay where every query expanded in place.
Sidebar: every query on the page with its timing, matched hits, failure state and calling file. Paths truncate from the left so the file name and line number stay visible. Cross-site queries add how many sites they searched (4 hits · 2 sites).
Detail view: status chip, hits, timing and the index the query hit; an editable request with an inline Run button (or ⌘/Ctrl+Enter) once edited, Reset, and WP_Query / Trace tabs; a collapsible response tree with Expand all, Collapse all and Copy. A failed re-run says so in the chip (Edited · failed).
Header strip: Elasticsearch version, rate limiting and concurrency, then the current site's post types, statuses and meta allow list.
Multisite cross-site queries ('sites' => [ 2, 3 ] or 'all') show which indexes they reached, including the real indexes behind the network alias, with returned hits per index.
Hit counts: a capped total (relation: gte) reads as a lower bound (10,000+ hits), and a non-2xx Elasticsearch status marks a re-run as failed.
Edits and runs survive closing the panel: drafts, in-flight runs and their results or errors carry over when the panel is closed and reopened or another query is selected.
Light and dark themes, following the system preference by default.
Large payloads stay responsive: responses above 1 MB / 50,000 lines show as plain text on Expand all (or straight away if huge even when folded), and requests above 200 KB are edited without syntax highlighting.
Accessibility: single-tab-stop keyboard navigation in the response tree, ARIA tabs, a focus trap, screen-reader announcements for runs and copy, and WCAG AA contrast in both themes.
Smaller pages: the page data is printed compactly instead of pretty-printed (about 3x smaller).
Also removes the clipboard and pluralize dependencies and unused assets/styles, adds Node unit tests for the view-model logic, adds lint + unit test steps to the Search Dev Tools workflow, and rewrites the e2e spec and page object for the new UI.
Light:
Dark:
Changelog Description
Changed
Search Dev Tools: Redesigned the panel with a query sidebar, a detail view with editable requests and a collapsible response viewer, light and dark themes, and improved keyboard and screen reader support.
Pre-review checklist
This change works and has been tested locally or in Codespaces (or has an appropriate fallback).
This change works and has been tested on a sandbox.
This change has relevant unit tests (if applicable).
This change uses a rollout method to ease with deployment (if applicable - especially for large scale actions that require writes).
This change has relevant documentation additions / updates (if applicable).
I've created a changelog description that aligns with the provided examples.
Pre-deploy checklist
VIP staff: Ensure any alerts added/updated conform to internal standards (see internal documentation).
Steps to Test
Check out this PR (with git submodule update for ElasticPress) and start a VIP local dev environment with Enterprise Search enabled and this checkout as mu-plugins (vip dev-env create --elasticsearch --mu-plugins=/path/to/vip-go-mu-plugins), then index content with wp vip-search index --setup.
Visit a search page (e.g. /?s=hello) as an administrator and click Search in the Admin Bar.
Select queries in the sidebar; check the WP_Query and Trace tabs and fold/unfold the response.
Edit the request, run it with Run or ⌘/Ctrl+Enter, and confirm the response updates and the chip reads Edited; Reset restores the original. Close and reopen the panel: the edit and result are still there.
Toggle Light / Dark.
Optional (multisite): define EP_IS_NETWORK, run wp vip-search recreate-network-alias, and run a WP_Query with 'sites' => 'all' to see the site count in the sidebar (e.g. 11 hits · 3 sites), the indexes in the header and per-index hits.
Automated: npm run lint && npm test && npm run build in search/search-dev-tools, CI=1 ./bin/test.sh --filter Search_Dev_Tools_Test, and npm --prefix __tests__/e2e test -- specs/searchdevtools.spec.ts.
❌ Patch coverage is 84.53608% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.76%. Comparing base (d7026ce) to head (20b35ef).
Replace the stacked overlay with a sidebar + detail layout:
- Sidebar lists every query with timing, matched hits, failures and the
calling file (truncated from the left so the file name stays visible).
Cross-site queries add the number of sites they searched ("4 hits · 2 sites").
- Detail view: status chip, hits, timing and index; editable request with
inline Run / Cmd+Enter, Reset, WP_Query and Trace tabs; collapsible
response tree with Expand all / Collapse all and Copy.
- Header strip with Elasticsearch, rate limiting and concurrency, plus the
current site's post types, statuses and meta allow list.
- Multisite cross-site queries show the indexes they reached, including
the real indexes behind the network alias, with hits per index.
- Light and dark themes.
- Large payloads stay responsive: plain-text fallback for very large
responses, no highlighting for very large requests.
- Accessibility: native dialog, fieldset and output elements, keyboard
navigation for the list, tree and tabs, focus containment, live
announcements, AA contrast.
- Page data is printed compactly (about 3x smaller).
Drops the clipboard and pluralize dependencies and unused assets. Adds
Node unit tests, lint and unit test steps in CI, and rewrites the e2e
spec for the new UI.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unit:
- Drop the multi-index half of the alias compaction test, which no longer
tests compaction, and a cross-site assertion the URL fallback also passes.
- Drop a line-count check that used the function under test as its oracle.
- Merge the two per-index hit count tests, and the dotted-key path test into
the unique render key test.
- Keep only the plain-number total case in the countHits test.
E2E:
- Merge the two single-run guard steps into one.
- Drop the raw REST JSON check; the on-screen response already covers it.
- Actually check that invalid JSON sends no request.
- Fold the highlighted-key counter into isRequestHighlighted().
PHPUnit:
- Trim the index-part provider to its distinct cases and drop type-only
assertions from the info test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the Dev Tools copy of the URL-to-index helper and its test; core's
helper does the same thing and is already tested.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
If the modern Clipboard API is present but writeText() rejects (for example because clipboard permission is denied by policy), this returns the rejection and never tries the existing execCommand fallback. The Copy button then silently does nothing even though the fallback may still work. Catch a rejected writeText() call and continue into the fallback path.
Expose failed re-run status text beyond color styling
For a failed re-run, the chip still says only “Edited” or “Re-run”; failure is conveyed solely by its red styling because the adjacent textual hit state is deliberately hidden. A user who cannot perceive that color and later revisits the result has no textual indication that it failed. Include “failed” in the chip’s visible or accessible name when summary.failed is true.
Avoid treating unresolved aliases as concrete indexes
search/search-dev-tools/src/utils.js:251
When the network-alias lookup fails, the backend intentionally returns an empty list and omits alias_indexes. This fallback then treats vip-…-post-all itself as a concrete index, so a cross-site query is reported as reaching “1 site” and the breakdown includes the alias as an index even though the reached indexes are unknown. Preserve an explicit alias-lookup status (or detect an unresolved -all alias) and avoid presenting the alias/member count as real data.
- Copy falls back to execCommand when the Clipboard API refuses the write.
- A failed re-run says so in the status chip ("Edited · failed"), not only
with its color.
- When the network alias lookup fails, the backend flags it and the UI
shows "all sites via post-all" instead of treating the alias as an index;
the per-index counts come from the hits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The breakdown now lists only the hits each index returned. Remove the
helper, request-size parsing and styles that only served the
"+N not returned" item.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Note
This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.
If both clipboard paths are refused, this catch leaves the button unchanged and emits no live-region message, so screen-reader users receive no feedback that Copy failed. Announce the failure here (and consider a visible error state for sighted users) rather than silently swallowing it.
A refused or unavailable clipboard was swallowed silently. Show "Copy failed"
on the button and announce it to screen readers; a newer copy restarts the
label's reset timer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A transport failure becomes the re-run's result: the header reads
"Re-run/Edited · failed", the response shows the error, and it is
announced like a non-2xx response.
- Hide the per-index breakdown for failed results.
- The Run endpoint reports "non-JSON" only for an undecodable body and passes
other JSON (string or array messages) through.
- Clear the live region when the panel opens or closes, so it doesn't start
with a stale message.
- Indent the JSON tree with the padding style again: Preact sets it through
the CSSOM, which a strict style-src CSP doesn't block.
Co-Authored-By: Claude Opus 5.5 <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
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.
Description
Redesigns Search Dev Tools around a sidebar + detail layout, replacing the stacked overlay where every query expanded in place.
4 hits · 2 sites).Edited · failed).'sites' => [ 2, 3 ]or'all') show which indexes they reached, including the real indexes behind the network alias, with returned hits per index.relation: gte) reads as a lower bound (10,000+ hits), and a non-2xx Elasticsearch status marks a re-run as failed.Also removes the
clipboardandpluralizedependencies and unused assets/styles, adds Node unit tests for the view-model logic, adds lint + unit test steps to the Search Dev Tools workflow, and rewrites the e2e spec and page object for the new UI.Light:
Dark:

Changelog Description
Changed
Pre-review checklist
Pre-deploy checklist
Steps to Test
git submodule updatefor ElasticPress) and start a VIP local dev environment with Enterprise Search enabled and this checkout as mu-plugins (vip dev-env create --elasticsearch --mu-plugins=/path/to/vip-go-mu-plugins), then index content withwp vip-search index --setup./?s=hello) as an administrator and click Search in the Admin Bar.EP_IS_NETWORK, runwp vip-search recreate-network-alias, and run aWP_Querywith'sites' => 'all'to see the site count in the sidebar (e.g.11 hits · 3 sites), the indexes in the header and per-index hits.Automated:
npm run lint && npm test && npm run buildinsearch/search-dev-tools,CI=1 ./bin/test.sh --filter Search_Dev_Tools_Test, andnpm --prefix __tests__/e2e test -- specs/searchdevtools.spec.ts.🤖 Generated with Claude Code