Open
Conversation
same sort of implementation as for hits
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 11 |
| Duplication | 14 |
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: |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds default Algolia Insights click tracking for Autocomplete items (similar to Hits) when Insights is enabled.
Changes:
- Pass
sendEventfrom the Autocomplete connector down to the UIAutocompleteIndexcomponent (React InstantSearch + InstantSearch.js). - Enrich Autocomplete connector hits with
__positionand__queryIDso Insights events have the required metadata. - Add widget-level tests to assert default click + auxclick events are emitted and associated with the correct index.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/common/widgets/autocomplete/insights.tsx | Adds integration-style tests asserting default Autocomplete Insights click behavior. |
| tests/common/widgets/autocomplete/index.ts | Registers the new Autocomplete insights test suite in common widget tests. |
| packages/react-instantsearch/src/widgets/Autocomplete.tsx | Threads sendEvent into AutocompleteIndex for React InstantSearch. |
| packages/instantsearch.js/src/widgets/autocomplete/autocomplete.tsx | Threads sendEvent into AutocompleteIndex for InstantSearch.js widget wrapper. |
| packages/instantsearch.js/src/connectors/autocomplete/connectAutocomplete.ts | Enriches connector hits with absolute positions and query IDs for Insights. |
| packages/instantsearch.js/src/connectors/autocomplete/tests/connectAutocomplete-test.ts | Updates connector tests to reflect enriched hits and correct 1-based positions. |
| packages/instantsearch-ui-components/src/components/autocomplete/AutocompleteIndex.tsx | Adds default click/auxclick handlers that emit internal Insights click events. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
FabienMotte
reviewed
Apr 15, 2026
| ...requests.map( | ||
| ({ indexName }: Parameters<SearchClient['search']>[0][number]) => | ||
| createSingleSearchResponse({ | ||
| index: indexName, |
Contributor
There was a problem hiding this comment.
Should we add queryID and assert it below in the 3 tests?
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
adds default click events to autocomplete
Result
same sort of implementation as for hits, autocomplete has click events by default (if insights is enabled)