Skip to content

feat(ep-commerce): catalog-search enhancements for faceted search pages#353

Merged
field123 merged 1 commit into
masterfrom
feat/catalog-search-faceted-components
Jun 5, 2026
Merged

feat(ep-commerce): catalog-search enhancements for faceted search pages#353
field123 merged 1 commit into
masterfrom
feat/catalog-search-faceted-components

Conversation

@field123

@field123 field123 commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Closes #351. (Supersedes #352, which GitHub auto-closed when its head branch was renamed to drop a project-specific prefix.)

Reusable additions to the EP catalog-search components for building faceted, deep-linked search result pages. All handlers ride the $ctx data context so Plasmic designers wire interactions without component refs.

Changes

Component Addition
EPCatalogSearchProvider baseFilter prop — injected via InstantSearch <Configure filters> so it persists across facet refinement (adapter-level filter_by does not). highlightFullFields prop → Typesense highlight_full_fields.
EPSearchHits Exposes resolved extensions and rawData on currentProduct so the PDP field components work inside hit cards unchanged. Configurable productPathPrefix for the hit link. Recovers EP's bare-keyed highlights from the raw Typesense hit and exposes _snippetedDescription.
EPRefinementList singleSelect (radio-style via useMenu, count-desc ordering) + itemGap for the pill row. The design-time canvas mock mirrors the singleSelect flex pill-row so the visual builder matches runtime.
EPClearRefinements alwaysRender for always-visible "all"-style affordances (style off clearRefinementsData.canRefine).
EPSearchPagination goTo / next / prev exposed on searchPaginationData.
EPSearchAutocomplete clear / setQuery exposed on autocompleteData.

Why the base filter goes through <Configure filters>

The adapter joins Configure's filters with generated facet filters (&&), but drops additionalSearchParameters.filter_by as soon as InstantSearch generates its own filters (i.e. on any facet refinement). Routing the base filter through filters is the only way it survives a facet selection — verified live (selecting a scope facet no longer re-admits filtered-out documents, e.g. variation children).

Testing

  • All package tests pass (catalog-search-components.test.tsx extended: base-filter/highlight provider config, hit extensions + rawData + productPathPrefix + highlight recovery, singleSelect menu semantics + canvas mock layout).
  • Verified end-to-end against a live storefront search page (Playwright, 1440px + 390px): live search-as-you-type + URL sync + back/forward, autocomplete, single-select scope facet with live counts + clear-all, query-term highlighting in title and snippet, numbered pagination with page indicator, reference links to the PDP, empty state, header-search hand-off.

Notes

  • No production build artifacts are committed (source only).
  • Single commit on master.

Reusable additions to the EP catalog-search components for building
faceted, deep-linked search result pages:

- EPCatalogSearchProvider: `baseFilter` (injected via InstantSearch
  `<Configure filters>` so it survives facet refinement, unlike adapter
  `filter_by`) + `highlightFullFields` props.
- EPSearchHits: expose template `extensions` (resolved) and `rawData` on
  `currentProduct` so the PDP field components work inside hit cards
  unchanged; configurable `productPathPrefix` for the hit link; recover
  EP's bare-keyed highlights from the raw Typesense hit and expose
  `_snippetedDescription` (the marked excerpt).
- EPRefinementList: `singleSelect` (radio-style via `useMenu`, count-desc
  ordering) + `itemGap`; the canvas mock mirrors the singleSelect pill-row
  layout so the visual builder matches runtime.
- EPClearRefinements: `alwaysRender` for always-visible "all" affordances
  (style off `clearRefinementsData.canRefine`).
- EPSearchPagination: expose `goTo`/`next`/`prev` on `searchPaginationData`.
- EPSearchAutocomplete: expose `clear`/`setQuery` on `autocompleteData`.

The action handlers ride the data context so designers wire interactions
via `$ctx` without component refs. All package tests pass.
@field123 field123 merged commit 7320171 into master Jun 5, 2026
19 checks passed
@field123 field123 deleted the feat/catalog-search-faceted-components branch June 5, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EP Catalog Search: component gaps blocking a faceted search page

1 participant