[POC] chat "instant answer" result card in the PLP hits grid#7122
Draft
afrencalg wants to merge 1 commit into
Draft
[POC] chat "instant answer" result card in the PLP hits grid#7122afrencalg wants to merge 1 commit into
afrencalg wants to merge 1 commit into
Conversation
afrencalg
marked this pull request as draft
July 20, 2026 09:11
Up to standards ✅🟢 Issues
|
More templates
algoliasearch-helper
instantsearch-ui-components
instantsearch.css
instantsearch.js
react-instantsearch
react-instantsearch-core
react-instantsearch-nextjs
react-instantsearch-router-nextjs
vue-instantsearch
commit: |
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.
TL;DR
Standalone POC (examples/js/poc-chat-result-card/, single index.html, no build step) that injects a chat "instant answer" card directly into the hits grid, built two ways side by side: (A) reusing the existing chat widget with a compact layout template, and (B) a bespoke card on headless connectChat. Verdict: the engine is the same either way — this should become a card layout preset on the existing widget, not a new widget. Follow-up handoff to the full chat, backend-driven triggering (Rules userData), and PLP context all work with today's APIs.
What's in it
A vs B implementation toggle — A is ~30 lines of config (layout template, type: 'chatCard', persistence: false) and inherits markdown, tool carousels, suggestions, error/retry for free; B is ~200 lines of custom UI with full design freedom but re-implements everything visual. Both share connectChat for transport/streaming/tools/context.
Trigger engine — backend mode reads real Rules userData from results.userData (incl. card-position override from the rule consequence; simulated rules table as fallback since the demo index has none), plus heuristic / always / manual modes. Card shows a "why did I trigger" badge; search-as-you-type needs debounce + per-question dedupe (included).
"Continue in full chat →" — copies the card conversation into the overlay chat via setMessages() + setOpen(true).
Context A/B lab — streams the same question with and without turnContext (query, filters, top results) side by side with timings. With-context answers are clearly better grounded (e.g. with brand:Modal filtered, it correctly says Modal makes no laptops).
Findings / follow-ups
Recommend productizing as a compact card layout preset + trigger convention, shared engine with chat — no per-customer copy-paste.
Conversation ids differ between card and main chat — works because the transport is stateless, but analytics/feedback attribution needs a "transfer conversation" concept.
No new backend API needed for v1 triggering — Rules + userData suffices.