feat(chat): add configurable reasoning panel aligned with Agent Studio - #7105
Open
afrencalg wants to merge 9 commits into
Open
feat(chat): add configurable reasoning panel aligned with Agent Studio#7105afrencalg wants to merge 9 commits into
afrencalg wants to merge 9 commits into
Conversation
added 6 commits
May 7, 2026 09:10
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # packages/instantsearch-ui-components/src/components/chat/ChatMessage.tsx
afrencalg
requested review from
FabienMotte,
Haroenv and
shaejaz
and removed request for
Haroenv and
shaejaz
July 6, 2026 12:56
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 36 |
TIP This summary will be updated as you push new changes.
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: |
Contributor
There was a problem hiding this comment.
Pull request overview
Promotes the chat “reasoning” proof-of-concept into a configurable feature across instantsearch-ui-components, instantsearch.js, and react-instantsearch, including a native <details>/<summary> reasoning panel aligned with the Agent Studio design and a loader caption derived from reasoning/tool context.
Changes:
- Add a new
ChatMessageReasoningpanel (collapsible/visibility strategies, translations, classNames) and wire it through chat wrappers (React InstantSearch + InstantSearch.js widget + UI components). - Introduce dependency-free reasoning summarizer utilities to compute a live loader caption (with PII redaction) and extend the loader styling/behavior to animate caption changes and show a progress hairline.
- Add unit/widget tests plus an example enabling
showReasoning, and update bundlesize thresholds.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react-instantsearch/src/widgets/Chat.tsx | Exposes showReasoning/visibility/summarizer/translations and forwards them into UI props. |
| packages/instantsearch.js/src/widgets/chat/chat.tsx | Adds widget params/templates for reasoning and forwards options into the UI renderer. |
| packages/instantsearch.js/src/widgets/chat/tests/chat.test.tsx | Verifies reasoning panel rendering defaults, enablement, and template-driven labels. |
| packages/instantsearch.css/src/components/chat/_chat-message-reasoning.scss | New styling for the reasoning accordion panel (Agent Studio-aligned). |
| packages/instantsearch.css/src/components/chat/_chat-message-loader.scss | Loader caption animation + progress hairline styling when preview is enabled. |
| packages/instantsearch.css/src/components/chat.scss | Includes the new reasoning stylesheet in the chat bundle. |
| packages/instantsearch-ui-components/src/lib/utils/reasoning.ts | New summarizer/categorizer utilities and context extraction for reasoning/tool calls. |
| packages/instantsearch-ui-components/src/lib/utils/index.ts | Exports the new reasoning utilities. |
| packages/instantsearch-ui-components/src/lib/utils/tests/reasoning-test.ts | Unit tests for categorization, tiered summarization, and context extraction. |
| packages/instantsearch-ui-components/src/components/index.ts | Exports ChatMessageReasoning as part of the components public surface. |
| packages/instantsearch-ui-components/src/components/chat/icons.tsx | Adds a BrainIcon used by the reasoning panel header. |
| packages/instantsearch-ui-components/src/components/chat/ChatMessages.tsx | Computes reasoningPreview for the loader and forwards reasoning options to messages. |
| packages/instantsearch-ui-components/src/components/chat/ChatMessageReasoning.tsx | New reasoning panel component based on native <details>/<summary>. |
| packages/instantsearch-ui-components/src/components/chat/ChatMessageLoader.tsx | Accepts reasoningPreview and adds animated caption + optional progress hairline. |
| packages/instantsearch-ui-components/src/components/chat/ChatMessage.tsx | Renders a single reasoning panel per message (anchored at first reasoning part). |
| packages/instantsearch-ui-components/src/components/chat/tests/ChatMessageReasoning.test.tsx | Component tests for default behavior, visibility strategies, translations, and classNames. |
| examples/react/getting-started/src/App.tsx | Enables showReasoning in the React getting-started example. |
| bundlesize.config.json | Updates bundle size ceilings to account for added functionality/styles. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
shaejaz
reviewed
Jul 7, 2026
This was referenced Jul 24, 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.
Summary
Promotes the reasoning proof-of-concept into a configurable, first-class chat feature across
instantsearch-ui-components,instantsearch.js, andreact-instantsearch. The reasoning UI is ported to match the Algolia dashboard(Agent Studio) design so it reads identically across surfaces.
What's included
<ChatMessageReasoning>panel — a collapsible accordion built on a native<details>/<summary>(zero JS, works across Preact/React/Vue). Matches the Agent StudioChatContextAccordion: Lucidebrainicon, a static"Reasoning" caption that pulses while streaming, a chevron that rotates on the native
[open]state, and a muted raw-text body. Collapsed by default.showReasoning(opt-in, off by default)reasoningVisibility:collapsed(default) |expanded|auto|hiddenreasoningTranslations/translations.reasoning: injectabletitleandtoggleLabel(JS templates:reasoningTitleText,reasoningToggleLabelText)reasoningClassNames: per-element class overridesreasoningSummarizer: overrides the live loader caption heuristicsubstitute label ("Searching the catalogue…") derived from a small, dependency-free
3-tier summarizer (server summary → tool-call inference → keyword heuristic),
with PII redaction.
_chat-message-reasoning.scss(satellite/algolia/nova themes).showReasoningenabled on the agent-backed<Chat>in theReact getting-started example.
the panel and the JS widget wiring.
Design
Ported to mirror the Agent Studio dashboard so the experience is seamless
between the dashboard and InstantSearch integrations.