Skip to content

Debounce settlements search query#382

Open
Samaro1 wants to merge 2 commits into
AnchorNet-Org:mainfrom
Samaro1:settlements-panel-debounce
Open

Debounce settlements search query#382
Samaro1 wants to merge 2 commits into
AnchorNet-Org:mainfrom
Samaro1:settlements-panel-debounce

Conversation

@Samaro1

@Samaro1 Samaro1 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Applies useDebouncedValue to SettlementsPanel's search query (matching the pattern already established in AnchorsPanel) so the filtered list only re-computes after the user pauses typing for the debounce delay.

Changes:

  • Imported useDebouncedValue in src/components/SettlementsPanel.tsx
  • Added SEARCH_DEBOUNCE_MS = 200 constant and derived debouncedQuery used in the visibleSettlements filter
  • The search <input> remains bound to the immediate (non-debounced) query so typing never lags
  • Updated existing filter tests to account for the debounce delay (waitFor / fake timers)
  • Added a dedicated "debounces the search filter" test with vi.useFakeTimers() asserting the list only updates after ~200ms

Closes #252

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.

Debounce SettlementsPanel's client-side search filter, matching AnchorsPanel's existing pattern

1 participant