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 <[email protected]> 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 <[email protected]> --- 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) {
