Skip to content

Debounce component search input#2433

Open
Mbeaulne wants to merge 1 commit into
06-18-add_client-side_embeddings_cached_in_indexeddbfrom
06-18-fix_search_input_lag
Open

Debounce component search input#2433
Mbeaulne wants to merge 1 commit into
06-18-add_client-side_embeddings_cached_in_indexeddbfrom
06-18-fix_search_input_lag

Conversation

@Mbeaulne

@Mbeaulne Mbeaulne commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

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 DebouncedComponentSearchInput component 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. useDeferredValue is 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

  • Bug fix
  • New feature
  • Improvement
  • Cleanup/Refactor
  • Breaking change
  • Documentation update

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

Test Instructions

  1. Open the Dashboard Components view.
  2. Type rapidly into the search box and confirm the UI remains responsive without lag on each keystroke.
  3. Pause typing and confirm search results appear after ~200ms.
  4. Verify the AI search button only becomes enabled once the debounced query has committed.
  5. Click AI search and confirm it runs against the expected candidate pool.

Additional Comments

The onCommit callback reference is stabilised via a useRef so the debounce useEffect does not restart its timer when the parent re-renders with a new callback identity.

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: 06-18-fix_search_input_lag/ba5f48a

@Mbeaulne Mbeaulne changed the title fix search input lag Debounce component search input Jun 18, 2026
@Mbeaulne Mbeaulne marked this pull request as ready for review June 18, 2026 18:53
@Mbeaulne Mbeaulne requested a review from a team as a code owner June 18, 2026 18:53
@Mbeaulne Mbeaulne force-pushed the 06-18-add_client-side_embeddings_cached_in_indexeddb branch from 60a4a12 to f6d7ea7 Compare June 18, 2026 19:46
@Mbeaulne Mbeaulne force-pushed the 06-18-fix_search_input_lag branch 2 times, most recently from d586cf4 to 89315de Compare June 18, 2026 20:28
@Mbeaulne Mbeaulne force-pushed the 06-18-add_client-side_embeddings_cached_in_indexeddb branch from f6d7ea7 to 27a3952 Compare June 18, 2026 20:28
@Mbeaulne Mbeaulne force-pushed the 06-18-fix_search_input_lag branch from 89315de to 547bdec Compare June 18, 2026 20:49
@Mbeaulne Mbeaulne force-pushed the 06-18-add_client-side_embeddings_cached_in_indexeddb branch 2 times, most recently from 316495b to 89c4999 Compare June 18, 2026 21:02
@Mbeaulne Mbeaulne force-pushed the 06-18-fix_search_input_lag branch from 547bdec to 4a1f6c8 Compare June 18, 2026 21:02
@Mbeaulne Mbeaulne force-pushed the 06-18-fix_search_input_lag branch from 4a1f6c8 to ba5f48a Compare June 18, 2026 21:16
@Mbeaulne Mbeaulne force-pushed the 06-18-add_client-side_embeddings_cached_in_indexeddb branch from 89c4999 to 92a80e1 Compare June 18, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant