feat(cms-base-layer): support filters within search context#2503
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds reusable listing filters to the product search page by wiring the shared SwProductListingFilters* components to the useProductSearchListing() composable when used in a search context, and by updating the starter template search page to SSR-fetch and hydrate a listing suitable for filter rendering.
Changes:
- Updated the starter template
/searchpage to SSR-fetch product search listings, render the shared filter sidebar, and hydrate the shared listing state. - Made
SwProductListingFiltersandSwProductListingFiltersHorizontalswitch betweenuseCategoryListing()anduseProductSearchListing()based on alistingTypeprop and keep the search term in criteria/URL. - Minor docs formatting adjustments + added a changeset for the cms-base-layer minor bump.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/vue-starter-template/app/pages/search.vue | SSR-driven search listing + adds filter sidebar and listing hydration for search context |
| packages/cms-base-layer/app/components/SwProductListingFiltersHorizontal.vue | Allows filters to drive useProductSearchListing() and preserve search query in URL |
| packages/cms-base-layer/app/components/SwProductListingFilters.vue | Same as above for vertical filters component |
| apps/docs/src/resources/integrations/cms/sanity.md | Formatting-only doc adjustments |
| .changeset/tidy-falcons-glow.md | Declares minor release and describes new listingType behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Review summary from local testing: I found one behavioral issue worth fixing before merge: Filter UI state can drift from the route/listing after browser navigation or another query-only route change. Both Relevant spots:
Example reproduction:
A route-query watcher or route-derived selected filter state would keep the controls, active chips, reset button, and listing results aligned. Checks I ran locally:
All passed. |
Patryk Tomczyk (patzick)
left a comment
There was a problem hiding this comment.
Re-reviewed after the latest updates. The previous route/query filter-state drift is addressed by the new selected-filter state utility and tests. Local targeted tests, lint, and typechecks passed.
closes: #2250