Repository navigation
fix(compare): require configurationId - #7306
Merged
Merged
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 9 |
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: |
|
Size Change: -154 B (-0.01%) Total Size: 1.04 MB 📦 View Changed
ℹ️ View Unchanged
|
Haroenv
commented
Oct 19, 2026
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused validation changes have targeted test coverage and no identified blocking issues; tests were not executed.
No open issues 🎉
What changed in this PR
Moves missing configurationId errors to JavaScript CompareBar creation and React rendering, rather than button clicks, while preserving the connector guard for toggles-only setups.
Changes:
- Adds early validation in both widgets.
- Adds validation tests.
- Updates all-widget test helpers to supply a configuration ID.
| File | Description |
|---|---|
packages/react-instantsearch/src/widgets/CompareBar.tsx |
Validates the ID before calling the hook. |
packages/react-instantsearch/src/widgets/__tests__/CompareBar.test.tsx |
Tests the missing-ID render error. |
packages/react-instantsearch/src/widgets/__tests__/__utils__/all-widgets.tsx |
Supplies an ID to CompareBar. |
packages/instantsearch.js/src/widgets/compare-bar/compare-bar.tsx |
Validates and forwards the ID. |
packages/instantsearch.js/src/widgets/compare-bar/__tests__/compare-bar-test.ts |
Tests required options and valid creation. |
packages/instantsearch.js/src/widgets/__tests__/index.test.ts |
Supplies an ID during widget initialization. |
Review effort: Balanced
Haroenv
requested review from
a team,
afrencalg and
shaejaz
and removed request for
a team
October 19, 2026 15:58
Haroenv
marked this pull request as ready for review
October 19, 2026 15:58
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Haroenv
enabled auto-merge (squash)
October 19, 2026 15:58
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Haroenv
force-pushed
the
fix/compare-bar-configuration-id
branch
from
October 19, 2026 16:00
27988ae to
1cd9c3b
Compare
Haroenv
commented
Oct 19, 2026
shaejaz
approved these changes
Oct 20, 2026
Comment on lines
+90
to
+91
| // `CompareBar` is not part of `SingleWidget` (see `NON_COMPONENTS`), but | ||
| // `getAllInstantSearchWidgets` still renders it and it requires an ID. |
Contributor
There was a problem hiding this comment.
what's the reason for it not being in the single widget list?
Haroenv
added a commit
that referenced
this pull request
Oct 20, 2026
* fix(compareBar): require configurationId when the widget is created Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * test(compareBar): pass configurationId in widgets index test Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * fix(compare): require configurationId in the connector Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * docs(examples): read the compare selection from render state Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
afrencalg
added a commit
that referenced
this pull request
Oct 20, 2026
#7306 moved the check from `compare()` to widget creation; carry this PR's one-sentence wording over to the new location. The option's JSDoc and the docs link appended by `withUsage` already say where the ID comes from. Co-authored-by: Cursor <cursoragent@cursor.com>
afrencalg
added a commit
that referenced
this pull request
Oct 20, 2026
#7306 moved the check from `compare()` to widget creation; carry this PR's one-sentence wording over to the new location. The option's JSDoc and the docs link appended by `withUsage` already say where the ID comes from. Co-authored-by: Cursor <cursoragent@cursor.com>
Haroenv
added a commit
that referenced
this pull request
Oct 20, 2026
* fix(compare): clarify option validation messages Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * fix(compare): shorten the `configurationId` usage message #7306 moved the check from `compare()` to widget creation; carry this PR's one-sentence wording over to the new location. The option's JSDoc and the docs link appended by `withUsage` already say where the ID comes from. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Andras F <andras.ferencz@algolia.com> Co-authored-by: Cursor <cursoragent@cursor.com>
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
connectComparethrowsTheconfigurationIdoption is required.when it is created without aconfigurationId, and the option is typed as required. Every compare widget carries its own ID, so the shared-store ID and the click-time throw incompare()are removed.compareBar(JS) and<CompareBar>(React) get the check from the connector, so they no longer have their own guards.useComparenow takes required props. The React default-theme example passes the ID to its per-hituseComparecall.Result
A missing
configurationIdfails when the widget is created or rendered, instead of inside the Compare button's click handler. Tests cover the connector usage error; the widget and React tests pass aconfigurationId.🤖 Generated with Claude Code