feat(autocomplete): add multi-index support#81
Open
sarahdayan wants to merge 3 commits intofeat/headersfrom
Open
feat(autocomplete): add multi-index support#81sarahdayan wants to merge 3 commits intofeat/headersfrom
sarahdayan wants to merge 3 commits intofeat/headersfrom
Conversation
Add the ability to configure additional indices on the autocomplete widget, each rendered as a separate section in the dropdown. Includes index-specific hitsPerPage, search parameters, header templates, and custom item templates. Adds the IndicesConfigField toolbar component for managing index entries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix stale closure in removeEntry, use stable keys for drag-and-drop reconciliation, scope draggable to grip handle, validate hitsPerPage, avoid destructive innerHTML cleanup, and update stale test assertions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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
Autocomplete now supports multiple indices, each rendered as a separate section in the dropdown. Users can add, remove, reorder (drag-and-drop), and independently configure each index section from the toolbar.
Each index entry supports a section header, hits per page, item template mapping (auto-hidden for Query Suggestions indices), and custom search parameters. Query Suggestions indices are auto-detected and pre-configured with a "Suggestions" header.
On the runtime side, the
indicesparameter is transformed into proper autocomplete source configs with per-section search parameters, headers, and item templates.Also fixes the
placement: 'inside'cleanup in the middleware to only remove injected content instead of wiping the entire target element.