Search 3.0: add Compact Search block pattern with filter + sort popovers#48288
Search 3.0: add Compact Search block pattern with filter + sort popovers#48288adamwoodnz wants to merge 12 commits intotrunkfrom
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a `display` attribute ("select" | "popover") to jetpack/sort-control.
In popover mode the block renders an icon-button trigger that opens a
floating menu; the native <select> remains the default. Also adds
`onWindowClickClosePopovers` and `onEscapeClosePopovers` window-event
handlers to the Interactivity store (shared with the upcoming filter
popover), and three derived-state getters (`isSortByRelevance`,
`isSortByNewest`, `isSortByOldest`) for `aria-checked` bindings — using
getters rather than inline `===` expressions because the Interactivity
API only evaluates simple property paths in directives.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds the jetpack/filter-popover block — a compact trigger button (filter icon + active-count badge) that opens a popover panel wrapping its inner blocks (filter-checkbox + active-filters). Popover open/close is driven by state.isFilterPopoverOpen / actions.toggleFilterPopover from the Interactivity store; outside-click and Escape handlers close it. Also wires the new block into register-blocks.js with its InnerBlocks.Content save function (replacing the shared null save used by purely dynamic blocks). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
95bb955 to
c5ea4ed
Compare
Code Coverage SummaryCoverage changed in 6 files. Only the first 5 are listed here.
4 files are newly checked for coverage.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
Fixes RSM-1071
Proposed changes
Adds a Compact Search Jetpack Search block pattern — a single-row toolbar (search + filter popover + sort popover) over a dense result list, inspired by the WordPress Dataview list layout.
jetpack/filter-popover— a container forfilter-checkbox+active-filtersinner blocks, surfaced as an icon trigger with an active-filter count badge; opens arole="dialog"panel.jetpack/search-resultsnow supportslayout: "card" | "compact". Compact mode hides the breadcrumb path and image, renders title + date + author on one line, and uses tighter spacing.jetpack/sort-controlnow supportsdisplay: "select" | "popover". Popover mode renders an icon trigger →role="menu"withmenuitemradiooptions.isFilterPopoverOpen/isSortPopoverOpenstate,toggleFilterPopover/toggleSortPopover/closeAllPopovers/selectSortOrderactions,onWindowClickClosePopovers/onEscapeClosePopoverswindow handlers for Dataview-style outside-click + Esc close, plusactiveFilterCountandisSortByRelevance/isSortByNewest/isSortByOldestderived getters.normalizeResultnow surfacesauthorfrom the v1.3author.namefield (accepts both string and array shapes).compact-search.phpcomposessearch-input+filter-popover(with category / tag / post-typefilter-checkboxchildren) +sort-control[display=popover]+results-count+search-results[layout=compact]+no-results+load-more.All new styles use
currentColor/color-mix/var(--wp--preset--color--background)so they inherit the active theme palette (extending the pattern established by the base branch).Related product discussion/links
cursor/search-blocks-theme-adaptive-colors-8486(theme-adaptive block colors — not yet merged)Does this pull request change what data or activity we track or use?
No.
Testing instructions
Requires the Jetpack Search blocks feature flag to be enabled.
Golden path:
Filter popover:
Sort popover:
Accessibility / Dataview parity:
aria-expandedflips totrue.Escape— the open popover closes.Theme inheritance:
Regression check:
<select>for sort and the samesearch-results"card" layout as before.Screenshots (from the issue, for reference)
Target initial UI, filter-open state, and filter-applied state are documented on RSM-1071 — the one deliberate departure from Dataview is using a sort icon where Dataview uses a gear.
🤖 Generated with Claude Code