feat(samples): point headless-search-react at BarcaKnowledge with knowledge-base facets#7897
Open
alexprudhomme wants to merge 14 commits into
Open
feat(samples): point headless-search-react at BarcaKnowledge with knowledge-base facets#7897alexprudhomme wants to merge 14 commits into
alexprudhomme wants to merge 14 commits into
Conversation
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
@coveo/atomic
@coveo/atomic-hosted-page
@coveo/atomic-legacy
@coveo/atomic-react
@coveo/auth
@coveo/bueno
@coveo/create-atomic
@coveo/create-atomic-component
@coveo/create-atomic-component-project
@coveo/create-atomic-result-component
@coveo/create-atomic-rollup-plugin
@coveo/headless
@coveo/headless-react
@coveo/shopify
commit: |
…wledge-base facets Set the search hub to BarcaKnowledge via a shared engine configuration and replace the generic sample facets with knowledge-base fields (ec_category, article_type, robot_series, difficulty_level).
Add a global stylesheet using the Coveo brand colors (coral, blue, yellow, mint) as plain solid accents, render sections as cards, restyle the header/nav, and use the official Coveo horizontal logo.
Search box on top, facets in a left sidebar, results in the main column, pager below, and advanced component demos in a collapsible section.
…ample Replace the kitchen-sink reference with a focused, idiomatic search UI mirroring the search-vite sample: a single useController hook plus small per-controller components (search box, facets, sort, results, pager), pointed at the BarcaKnowledge search hub. Drop SSR, routing, SAML/auth, and the class+function component duplication.
…eact Add a CategoryFacet component bound to the ec_category field (pipe-delimited hierarchy) with drill-down and breadcrumb, alongside the existing article type, robot series, difficulty, and author facets.
Add a DateFacet (Past week/month/quarter/year) bound to the date field, labeling each range by parsing the relative-date unit, and give each facet a bordered outline.
Format the README with oxfmt, drop the unused searchHub export, and remove the stale knip entry/ignore patterns (server/server.tsx, src/pages/AtomicReactPage.css) left over from the minimal rewrite.
The unused searchHub export (fixed in engine.ts) was the only knip error; the stale entry/ignore patterns are non-fatal config hints. Reverting the knip.js edit keeps this PR scoped to search-react and avoids marking all projects affected (which pulled in an unrelated, failing SSR-NextJS e2e).
Add a ResultLink component using buildInteractiveResult so opening a result logs a click analytics event, restoring the result tracking that powers query suggestions.
- Reintroduce filterProtocol URI allowlist for result links and add rel=noopener noreferrer (guards against javascript: hrefs) - Use aria-current="page" for the current pager button and omit it otherwise
0c26d17 to
d563ded
Compare
Align the package name with samples/CONTRIBUTING.md (@coveo/ui-kit-sample-<name>); stays private until published.
y-lakhdar
approved these changes
Jul 2, 2026
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.
KIT-5685
Problem
The
headless-search-reactsample was wired to the generic sample search hub, demoed facets on generic fields, and had grown into a large multi-page demo (with SSR server code and many legacy feature pages). We want a small, copy-friendly scaffold that targets the BarcaKnowledge knowledge base.Solution
SearchEngineatsearchHub = 'BarcaKnowledge'. This is done in a newsrc/engine.ts(buildEngine()) built ongetSampleSearchEngineConfiguration()— there is no separateengine-configuration.tsmodule, and the SSR/server code was removed as part of the consolidation.useControllerhook for Headless controller subscriptions.ec_category(hierarchical),article_type,robot_series,difficulty_level, plusauthoranddate.ResultLinkcomponent usesbuildInteractiveResultso opening a result logs a click analytics event (feeds query suggestions). Resulthrefs go through afilterProtocolallowlist and open withrel="noopener noreferrer".aria-current="page"(omitted otherwise).Tested
pnpm buildpasses;vitest1/1 passes;oxlint/oxfmtclean.POST /rest/searchreturns 200 withsearchHub=BarcaKnowledgeand the new facets.Notes