perf(explore): use useDeferredValue for datasource panel search#39970
Conversation
Replace useDebounceValue (FAST_DEBOUNCE-delayed) with React 18's useDeferredValue in the datasource panel's column/metric search. Refs #39890. Same rationale as #39928: the input field reads inputValue directly so typing stays responsive, while matchSorter reads searchKeyword (now deferred). React schedules the filter as low-priority work and interrupts it on each keystroke, so there's no fixed delay holding the deferred value behind. Drop the no-longer-needed Constants import. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code Review Agent Run #7626c3Actionable Suggestions - 0Additional Suggestions - 2
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Updates the Explore Datasource Panel’s column/metric search to use React 18’s useDeferredValue instead of a fixed-delay debounce, keeping the input responsive while deferring the expensive client-side filtering work.
Changes:
- Replaced
useDebounceValue(inputValue, Constants.FAST_DEBOUNCE)withuseDeferredValue(inputValue)for the datasource search keyword. - Removed the now-unused
ConstantsanduseDebounceValueimports.
…he#39970) Co-authored-by: Claude Code <noreply@anthropic.com>
SUMMARY
Refs #39890. Second
useDeferredValueadoption (after #39928). Replaces the fixed-delayuseDebounceValuewithuseDeferredValuein the explore Datasource Panel's column/metric search box.Why useDeferredValue is the right fit here
Same UI-filter pattern as #39928's TableExploreTree migration:
inputValuedirectly (kept responsive on every keystroke).matchSorterreadssearchKeyword, now derived viauseDeferredValue.FAST_DEBOUNCEwindow holding the filtered list behind the input.The
Constantsimport (only used forFAST_DEBOUNCE) is dropped.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
No visual change. Behaviorally: column/metric search in the explore datasource panel should feel snappier — typing never lags behind because the filter is no longer waiting on a debounce window before recomputing.
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION