Debounce component search input#2433
Conversation
🎩 PreviewA preview build has been created at: |
60a4a12 to
f6d7ea7
Compare
d586cf4 to
89315de
Compare
f6d7ea7 to
27a3952
Compare
89315de to
547bdec
Compare
316495b to
89c4999
Compare
4a1f6c8 to
ba5f48a
Compare
89c4999 to
92a80e1
Compare
🤖 Code review — Debounce component search inputSmall, sensible perf fix for the top of the stack — by #2432 every keystroke could trigger IDF scoring (#2426), fuzzy Levenshtein (#2427), and embedding work, so gating input is well-justified. The Findings:
Overall good to go once the debounce-vs-deferred intent is clarified. |
ba5f48a to
fd4ebef
Compare
92a80e1 to
f8d7d77
Compare
fd4ebef to
04159ac
Compare
f8d7d77 to
1a2ae6e
Compare
03c9fa8 to
f23785c
Compare
bcaf99b to
23f25da
Compare
23f25da to
b790697
Compare
f23785c to
4d1b974
Compare
b790697 to
149103e
Compare
4d1b974 to
7f152b7
Compare
79faaaa to
a6ad948
Compare
7f152b7 to
a48133d
Compare
a6ad948 to
ca20ec6
Compare
ca20ec6 to
609edda
Compare

Description
The component search input now debounces user keystrokes by 200ms before updating the query state used for lexical search and AI search. A new
DebouncedComponentSearchInputcomponent manages its own local input value and only commits to the parent after the debounce delay, preventing expensive lexical search operations from running on every keystroke.useDeferredValueis applied to the committed query so that React can deprioritize the search re-renders, keeping the input responsive. The AI search button is now enabled only after the debounced query has settled, and the test has been updated to wait for that enabled state before clicking.Related Issue and Pull requests
Type of Change
Checklist
Screenshots (if applicable)
Test Instructions
Additional Comments
The
onCommitcallback reference is stabilised via auseRefso the debounceuseEffectdoes not restart its timer when the parent re-renders with a new callback identity.