korbit-ai[bot] commented on code in PR #34536:
URL: https://github.com/apache/superset/pull/34536#discussion_r2254513908


##########
superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx:
##########
@@ -124,6 +131,7 @@ export const useExploreAdditionalActionsMenu = (
   const { addDangerToast, addSuccessToast } = useToasts();
   const dispatch = useDispatch();
   const [isDropdownVisible, setIsDropdownVisible] = useState(false);
+  const [dashboardSearchTerm, setDashboardSearchTerm] = useState('');

Review Comment:
   ### Missing Search Debounce <sub>![category 
Performance](https://img.shields.io/badge/Performance-4f46e5)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The search term state triggers re-renders on every keystroke without any 
debouncing.
   
   
   ###### Why this matters
   Without debouncing, rapid typing causes excessive re-renders and potentially 
unnecessary API calls or filtering operations.
   
   ###### Suggested change ∙ *Feature Preview*
   Implement debouncing for the search term updates:
   ```jsx
   import { useMemo, useState, useCallback } from 'react';
   import debounce from 'lodash/debounce';
   
   const [dashboardSearchTerm, setDashboardSearchTerm] = useState('');
   const debouncedSetSearch = useMemo(
     () => debounce(value => setDashboardSearchTerm(value), 300),
     []
   );
   ```
   
   
   ###### Provide feedback to improve future suggestions
   [![Nice 
Catch](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/be2eb221-25e5-486a-b7de-8771d70e40b7/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/be2eb221-25e5-486a-b7de-8771d70e40b7?what_not_true=true)
  [![Not in 
Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/be2eb221-25e5-486a-b7de-8771d70e40b7?what_out_of_scope=true)
 [![Not in coding 
standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/be2eb221-25e5-486a-b7de-8771d70e40b7?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/be2eb221-25e5-486a-b7de-8771d70e40b7)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:209f1462-efde-4e81-8963-0a70acf1621a -->
   
   
   [](209f1462-efde-4e81-8963-0a70acf1621a)



-- 
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