rusackas opened a new pull request, #39975: URL: https://github.com/apache/superset/pull/39975
### SUMMARY Refs #39890. Continues the React 18 \`useDeferredValue\` migration started in #39928 (TableExploreTree) and #39970 (DatasourcePanel). Bundles two related swaps in the explore area: 1. **\`useExploreAdditionalActionsMenu\`** — dashboard search filter that powers the \"Add to dashboard\" sub-menu. Was using \`useDebounceValue(dashboardSearchTerm, 300)\`; now uses \`useDeferredValue\`. The input still reads \`dashboardSearchTerm\` directly so typing stays responsive; \`useDashboardsMenuItems\` consumes the deferred value. 2. **\`JSEditorControl\`** — ECharts JS-options parser. The expensive \`safeParseEChartOptions\` call inside \`useMemo\` now reads a deferred value. React schedules the parse as low-priority work and interrupts it on each keystroke, instead of waiting on a fixed debounce window before validating. The companion \`JSEditorControl.test.tsx\` had a passthrough \`useDebounceValue\` mock — no longer needed, since \`useDeferredValue\` returns the value synchronously when there is no concurrent rendering pressure (which is the case in Jest without \`<StrictMode>\` wrapping). Removed. ### Why bundle All three remaining \`useDebounceValue\` consumers in the explore area share the exact UI-filter-or-derived-computation pattern that \`useDeferredValue\` is designed for. The diff is mechanical (8 / 16 lines), the rationale is identical to the prior two PRs, and one review covers the whole template. The remaining \`useDebounceValue\` consumers in the codebase (SQL editor auto-save, SQL validation API call) are debounced *I/O*, not derived UI computation, so they correctly stay on \`useDebounceValue\` and are not part of this migration. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF No visual change. Behaviorally: - The explore overflow menu's dashboard search should feel snappier — typing never lags behind because the filter no longer waits on a 300ms window. - The JS-editor validation error should converge faster after rapid edits — React interrupts in-flight parses on each new keystroke rather than holding onto the previous result for a fixed delay. ### TESTING INSTRUCTIONS 1. Open an explore view, click the chart's overflow menu, choose \"Add to dashboard.\" If the user has more than \`SEARCH_THRESHOLD\` dashboards, type in the search box — input stays responsive, the filtered list converges to the same end state as before. 2. Open a chart that exposes \`JSEditorControl\` (e.g. an ECharts viz with custom options). Type rapidly into the editor — input stays responsive, validation errors update once typing settles. 3. \`npm test -- --testPathPatterns='JSEditorControl|useExploreAdditionalActionsMenu'\` passes locally (20/20). ### 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]
