mirror of
https://github.com/apache/superset.git
synced 2026-05-27 18:55:13 +00:00
Two fixes from @sadpandajoe's review. 1. **Double-fetch.** `fetchAppliedChart` synchronously sets both `value` and `slice` from one API response. The value-change watcher then saw `value` changed and called `fetchSliceData(value.value)` — re-resolving the same chart and overwriting the slice we just set. Fix: gate the watcher's `fetchSliceData` on `!slice`. When `fetchAppliedChart` populated slice in lockstep, the gate skips. When the user selects a different chart from the dropdown (`handleSelectValue`), `slice` is now cleared to null first, so the watcher fires and fetches correctly. 2. **Dead `useCallback`.** `renderChartHeader` (empty deps) only built JSX from its arguments and was called inline as `renderChartHeader(…)` — neither the produced node nor the function identity was observed by a memoized consumer, so the useCallback was overhead with no benefit. Inline as a plain helper named `buildChartHeader`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>