Cache search index in query and show skeleton while typing#2471
Open
Mbeaulne wants to merge 1 commit into
Open
Cache search index in query and show skeleton while typing#2471Mbeaulne wants to merge 1 commit into
Mbeaulne wants to merge 1 commit into
Conversation
🎩 PreviewA preview build has been created at: |
Collaborator
Author
8 tasks
94bf16a to
905bce9
Compare
2e4cdd9 to
2c11f71
Compare
This was referenced Jun 29, 2026
2c11f71 to
f84f5fb
Compare
9db5c6e to
c547aec
Compare
c547aec to
7c40739
Compare
f84f5fb to
7d9f4e2
Compare
8 tasks
7d9f4e2 to
370138a
Compare
7c40739 to
cdd3ff0
Compare
84aa8ca to
dbf3739
Compare
dbf3739 to
7590eab
Compare
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.

Description
Improves search responsiveness by showing a skeleton loading state immediately when the user starts typing, preventing the UI from performing expensive sorting and searching operations on keystrokes that haven't yet committed to a query transition.
A new
isSearchingflag is set as soon as the local input value diverges from the committed query. WhileisSearchingis true, the active query is treated as empty, sorted index computation is skipped, and the results area renders a skeleton. Once the debounced commit fires,isSearchingis cleared and the real results appear.The
pauseSearchoption is threaded intouseComponentSearchV2Stateso the editor-side component search panel gets the same behaviour.The hydration query now builds and caches the search index (
IndexEntry[]) alongside the hydrated references, so expensive index derivation is tied to the library fingerprint cache rather than recomputed on every render. The library fingerprint now includes source kind, id, and label so cache entries correctly invalidate when the source set changes.Pre-computed token and phrase caches (
searchableTokens,searchablePhrases) are stored on eachIndexEntryat index-build time, eliminating repeated tokenization and regex work on every keystroke insidescoreEntry.Search suggestions are now only computed when there are no lexical or collection matches and rerank is not active, avoiding unnecessary work when results are already present.
Related Issue and Pull requests
Type of Change
Checklist
Screenshots (if applicable)
Test Instructions
Additional Comments
The
buildSourcedHydratedReferenceshelper is no longer needed and has been removed. The hydration query now pairs each hydrated reference with its source directly, making the post-hydration join step unnecessary.