rusackas opened a new pull request, #39928:
URL: https://github.com/apache/superset/pull/39928

   ### SUMMARY
   
   Refs #39890. First `useDeferredValue` adoption following the React 18 
upgrade.
   
   Replaces the fixed-delay `useDebounceValue` with `useDeferredValue` in 
`TableExploreTree`'s schema browser search (the recently-debounced search from 
#39489).
   
   ### Why useDeferredValue is strictly better here
   
   - **No fixed timeout.** The deferred update runs as low-priority work and is 
automatically interrupted on each new keystroke, so the filter never lingers 
behind the input.
   - **Input stays responsive** because it reads `searchTerm` directly (line 
472 of the file). The expensive tree-filter computation reads 
`deferredSearchTerm` instead.
   - **One fewer custom-hook dependency.** Uses the React primitive.
   
   The other `useDebounceValue` consumers 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
   
   1. Open SQL Lab and pick a database with many schemas/tables.
   2. Type into the schema-browser search field rapidly. Input should feel 
responsive throughout.
   3. Filter results should converge after you stop typing — same end state as 
before.
   4. Clearing the field should restore the full tree.
   5. `npm test -- --testPathPatterns='TableExploreTree'` — passes locally 
(11/11).
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: #39890
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to