feat(ep-commerce): catalog-search enhancements for faceted search pages#352
Closed
field123 wants to merge 1 commit into
Closed
feat(ep-commerce): catalog-search enhancements for faceted search pages#352field123 wants to merge 1 commit into
field123 wants to merge 1 commit into
Conversation
48fc968 to
f88c895
Compare
f88c895 to
dbe9e38
Compare
dbe9e38 to
219b440
Compare
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.
1867323 to
9cb1b78
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #351.
Reusable additions to the EP catalog-search components for building faceted, deep-linked search result pages. All handlers ride the
$ctxdata context so Plasmic designers wire interactions without component refs.Changes
EPCatalogSearchProviderbaseFilterprop — injected via InstantSearch<Configure filters>so it persists across facet refinement (adapter-levelfilter_bydoes not).highlightFullFieldsprop → Typesensehighlight_full_fields.EPSearchHitsextensionsandrawDataoncurrentProductso the PDP field components work inside hit cards unchanged. ConfigurableproductPathPrefixfor the hit link. Recovers EP's bare-keyed highlights from the raw Typesense hit and exposes_snippetedDescription.EPRefinementListsingleSelect(radio-style viauseMenu, count-desc ordering) +itemGapfor the pill row. The design-time canvas mock mirrors thesingleSelectflex pill-row so the visual builder matches runtime.EPClearRefinementsalwaysRenderfor always-visible "all"-style affordances (style offclearRefinementsData.canRefine).EPSearchPaginationgoTo/next/prevexposed onsearchPaginationData.EPSearchAutocompleteclear/setQueryexposed onautocompleteData.Why the base filter goes through
<Configure filters>The adapter joins
Configure'sfilterswith generated facet filters (&&), but dropsadditionalSearchParameters.filter_byas soon as InstantSearch generates its own filters (i.e. on any facet refinement). Routing the base filter throughfiltersis 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
catalog-search-components.test.tsxextended: base-filter/highlight provider config, hit extensions +rawData+productPathPrefix+ highlight recovery,singleSelectmenu semantics + canvas mock layout).Notes
master.