Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 4 |
| Duplication | 7 |
TIP This summary will be updated as you push new changes. Give us feedback
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: |
There was a problem hiding this comment.
Pull request overview
Adds a “greeting” (empty-state) surface for the Chat widget so the UI can render a custom or built-in greeting when there are no messages yet, across InstantSearch.js templates and React.
Changes:
- Added a
greetingtemplate /messagesGreetingComponenthook to render a greeting whenmessagesis empty. - Introduced built-in greeting exports:
chatGreeting()(InstantSearch.js templates) andChatGreeting(React component). - Added CSS styles and updated bundlesize thresholds; added tests covering greeting rendering behavior.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/common/widgets/chat/templates.tsx | Adds coverage for greeting rendering when empty vs non-empty messages. |
| packages/react-instantsearch/src/widgets/Chat.tsx | Wires messagesGreetingComponent into the React Chat widget and passes needed actions to messages props. |
| packages/react-instantsearch/src/components/index.ts | Re-exports the new ChatGreeting component. |
| packages/react-instantsearch/src/components/ChatGreeting.tsx | Adds React wrapper for the built-in UI greeting component. |
| packages/instantsearch.js/src/widgets/chat/chat.tsx | Adds greeting template support and forwards sendMessage/setInput into messages props for greeting usage. |
| packages/instantsearch.js/src/templates/index.ts | Exports the new chatGreeting template helper. |
| packages/instantsearch.js/src/templates/chat-greeting.tsx | Implements the built-in greeting template for InstantSearch.js (Preact). |
| packages/instantsearch.css/src/components/chat/_chat-greeting.scss | Adds default styling for the greeting component. |
| packages/instantsearch.css/src/components/chat.scss | Includes the new greeting styles in the chat stylesheet entry. |
| packages/instantsearch-ui-components/src/components/index.ts | Re-exports ChatGreeting from UI components. |
| packages/instantsearch-ui-components/src/components/chat/ChatMessages.tsx | Renders an optional greeting component when there are no messages; forwards sendMessage/setInput. |
| packages/instantsearch-ui-components/src/components/chat/ChatGreeting.tsx | Implements the base greeting UI component and translations. |
| bundlesize.config.json | Updates size limits to account for added functionality. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
FabienMotte
left a comment
There was a problem hiding this comment.
Should we update an example to demo emptyComponent with the ChatGreeting component?
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
FX-3766
This PR adds support for a greeting component/template. This allows the chat widget to show a UI when there are no messages in the Chat. It also introduces an importable
ChatGreeting/chatGreetingcomponent for a built in greeting component that can be used.Reference example implementation for a React greeting component: