perf(sql-lab): use useDeferredValue for schema browser search#39928
Merged
Conversation
Replace the fixed-delay useDebounceValue with React 18's useDeferredValue in TableExploreTree's tree filter. Refs #39890. useDeferredValue is strictly better for this use case: - No fixed timeout — the deferred update runs as low-priority work and is interrupted automatically on each new keystroke. - The user-facing input stays responsive (it reads searchTerm directly), while the expensive tree filter computation reads deferredSearchTerm. - Removes one custom hook dependency from this component. Other useDebounceValue consumers (SQL editor auto-save, validation, JS editor) are debounced API calls, not UI filters, and stay as-is. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Code Review Agent Run #f56d62Actionable Suggestions - 0Additional Suggestions - 1
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 |
This was referenced May 8, 2026
msyavuz
approved these changes
May 11, 2026
qfcwell
pushed a commit
to qfcwell/superset
that referenced
this pull request
May 12, 2026
…#39928) Co-authored-by: Claude Code <noreply@anthropic.com>
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.
SUMMARY
Refs #39890. First
useDeferredValueadoption following the React 18 upgrade.Replaces the fixed-delay
useDebounceValuewithuseDeferredValueinTableExploreTree's schema browser search (the recently-debounced search from #39489).Why useDeferredValue is strictly better here
searchTermdirectly (line 472 of the file). The expensive tree-filter computation readsdeferredSearchTerminstead.The other
useDebounceValueconsumers in the codebase (SQL editor auto-save, SQL validation, JS editor parsing) debounce API calls or expensive parsing — not UI filtering — so they stay debounced. They're listed in #39890 for case-by-case follow-up but are not the same pattern.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
No visual change. Behaviorally: typing into the schema-browser search field should feel snappier — the input never lags while the tree filter catches up, because React deprioritizes the filter under typing pressure.
TESTING INSTRUCTIONS
npm test -- --testPathPatterns='TableExploreTree'— passes locally (11/11).ADDITIONAL INFORMATION