You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/05/08 16:15:32 UTC

(superset) branch perf/use-deferred-value-datasource-panel created (now 7bd6b301925)

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a change to branch perf/use-deferred-value-datasource-panel
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 7bd6b301925 perf(explore): use useDeferredValue for datasource panel search

This branch includes the following new commits:

     new 7bd6b301925 perf(explore): use useDeferredValue for datasource panel search

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(superset) 01/01: perf(explore): use useDeferredValue for datasource panel search

Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch perf/use-deferred-value-datasource-panel
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 7bd6b30192579791e3c644afebcbd9e4eeedaf56
Author: Claude Code <no...@anthropic.com>
AuthorDate: Fri May 8 09:14:45 2026 -0700

    perf(explore): use useDeferredValue for datasource panel search
    
    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 <no...@anthropic.com>
---
 superset-frontend/src/explore/components/DatasourcePanel/index.tsx | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/superset-frontend/src/explore/components/DatasourcePanel/index.tsx b/superset-frontend/src/explore/components/DatasourcePanel/index.tsx
index 3394791e618..7e9d5244130 100644
--- a/superset-frontend/src/explore/components/DatasourcePanel/index.tsx
+++ b/superset-frontend/src/explore/components/DatasourcePanel/index.tsx
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { useContext, useMemo, useState } from 'react';
+import { useContext, useDeferredValue, useMemo, useState } from 'react';
 import { t } from '@apache-superset/core/translation';
 import { DatasourceType, Metric, QueryFormData } from '@superset-ui/core';
 import { Alert } from '@apache-superset/core/components';
@@ -26,12 +26,11 @@ import { ControlConfig } from '@superset-ui/chart-controls';
 import AutoSizer from 'react-virtualized-auto-sizer';
 
 import { matchSorter, rankings } from 'match-sorter';
-import { Constants, Input } from '@superset-ui/core/components';
+import { Input } from '@superset-ui/core/components';
 import { SaveDatasetModal } from 'src/SqlLab/components/SaveDatasetModal';
 import { getDatasourceAsSaveableDataset } from 'src/utils/datasourceUtils';
 import { ExploreActions } from 'src/explore/actions/exploreActions';
 import Control from 'src/explore/components/Control';
-import { useDebounceValue } from 'src/hooks/useDebounceValue';
 import { DndItemType } from '../DndItemType';
 import { DatasourceFolder, DatasourcePanelColumn, DndItemValue } from './types';
 import { DropzoneContext } from '../ExploreContainer';
@@ -160,7 +159,7 @@ export default function DataSourcePanel({
 
   const [showSaveDatasetModal, setShowSaveDatasetModal] = useState(false);
   const [inputValue, setInputValue] = useState('');
-  const searchKeyword = useDebounceValue(inputValue, Constants.FAST_DEBOUNCE);
+  const searchKeyword = useDeferredValue(inputValue);
 
   const filteredColumns = useMemo(() => {
     if (!searchKeyword) {