Commit Graph

19928 Commits

Author SHA1 Message Date
Claude
e8f20a67e4 fix(AnnotationLayer): stop double-fetching chart on hydration + drop dead useCallback
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>
2026-05-12 14:31:29 -07:00
Claude
62808305f8 fix(TextAreaControl): restore <ControlHeader> as modal title
Master's class version passed the full <ControlHeader> as modalTitle via
`as any` to bypass ModalTrigger's `modalTitle?: string` typing. The FC
conversion narrowed that to `String(label || '')`, which dropped the
description tooltip, validation badges, and warning icons from the
"Edit X in modal" header.

- Widen `ModalTrigger.modalTitle` to `ReactNode` (the inner `Modal`'s
  `title` already accepts ReactNode; only `name` needs to stay a string
  for data-test/telemetry, so we pass `name` only when modalTitle is a
  string).
- Replace TextAreaControl's 12-prop destructure-and-cast of restProps
  with `<ControlHeader name={name} {...restProps} />`, matching the
  spread pattern used by ViewportControl elsewhere in this PR.
- Pass `controlHeader` (now equivalent to master's behavior) back to
  ModalTrigger.

Also: restore the SupersetClient.get spy in DatasourceControl.test.tsx's
afterAll so the module-scope spy doesn't leak into other test files in
the same Jest worker (per the Copilot bot suggestion).

Per @sadpandajoe's two review comments on TextAreaControl and the
Copilot bot's mock-restoration note on DatasourceControl.test.tsx.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:28:55 -07:00
Claude
f021cf2060 fix(CopyToClipboard): keyboard activation for non-element copyNode wrapper
When copyNode is not a valid React element, CopyToClipboard wraps it in a
span with role="button" but the previous implementation had no onKeyDown
handler and tabIndex was undefined (so the span wasn't even focusable).
Non-mouse users couldn't trigger the copy.

- Add onKeyDown that triggers onClick on Enter or Space (with
  preventDefault to suppress space-scroll).
- Default tabIndex to 0 when enabled so the span is in tab order.
- Add a regression test that focuses the wrapper and asserts Enter
  triggers onCopyEnd.

Per the Copilot bot suggestion on the FC conversion PR.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:26:57 -07:00
Claude
62d70a113b perf(explore-controls): re-add memo() to FC-converted PureComponents
Each of these was a class extending PureComponent before the FC
conversion in this PR; without an explicit memo() the components no
longer skip re-render on shallow-equal props. They're rendered many
times across the explore control panel, so the regression matters.

- SelectControl
- AnnotationLayerControl (wrapped inside the connect HOC)
- AdhocFilterPopoverTrigger
- FixedOrMetricControl
- MetricsControl

Per @sadpandajoe's review comment on this PR.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:25:46 -07:00
Claude
be1dbac02e test(SaveModal,CopyToClipboard): drop placeholder asserts; add string/number copyNode guard
Two changes in response to review feedback on the FC conversion:

1. Drop three `expect(true).toBe(true)` placeholder tests in
   `SaveModal.test.tsx` (`dispatches removeChartState ... - placeholder`,
   `onDashboardChange triggers tabs load ... - placeholder`,
   `onTabChange correctly updates selectedTab - placeholder`). They were
   left behind from the class-component version and assert nothing —
   net-negative as regression guards. They'll be re-added in a follow-up
   once the FC-shaped versions are wired up.

2. Add a regression test in `CopyToClipboard.test.tsx` that renders the
   component with a string `copyNode` and with a number `copyNode`,
   covering the `cloneElement`-on-non-element crash that prompted the
   `isValidElement` guard in `src/components/CopyToClipboard/index.tsx`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:21:27 -07:00
Claude
f8f04a427e revert(CollectionControl): drop stale FC conversion; master already converted
CollectionControl was converted to a function component in #38563 (React 18)
and further refined in #39862 (stable keyless-item ids via WeakMap). This
PR's own conversion predated both and, if kept, would re-introduce the
removed react-sortable-hoc dependency and lose the keyless-item id fix.

Restore master's version so the React 18 + #39862 work is preserved.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:21:27 -07:00
Claude
a15d3c53a7 fix(SaveModal): widen onDashboardChange param to antd SelectValue
The function-component SaveModal typed onDashboardChange as taking
`{ label; value } | null`, which TS2322-rejected against AsyncSelect's
onChange signature — the antd callback supplies the broader
`SelectValue` (which includes `undefined`).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:21:27 -07:00
Evan Rusackas
8f6cd0bc05 test(DatasourceControl): await userEvent.click to deflake Edit dataset test
userEvent.click is asynchronous in @testing-library/user-event v14+;
unawaited calls left the downstream getByTestId assertion to race the
modal render. Awaits both clicks in the Edit-dataset test so the modal
is guaranteed open before the assertion runs.

Addresses codeant-ai review on PR #39461.
2026-05-12 14:21:27 -07:00
Evan Rusackas
288d15ebdb fix(AdhocFilterControl): reset partitionColumn on datasource change
partitionColumn was only set when table metadata returned exactly one
partition key, but never reset when switching to a datasource with zero
or 2+ partition keys. Stale state leaked across datasource changes and
the 'latest partition' operator appeared incorrectly. Reset to null at
the top of the effect so only single-partition-key datasources end up
with a value.

Addresses codeant-ai review on PR #39461.
2026-05-12 14:21:26 -07:00
Evan Rusackas
f827f05c63 fix(SaveModal): guard cleared dashboard selection and strip OUT_OF_TAB hash
Two codeant-ai findings on the function-component SaveModal:

1. onDashboardChange was typed as receiving a non-null option, but the
   Select allows clearing. Clearing sent null and crashed on
   newDashboard.value access. Widens the type to `... | null`, sets
   dashboard to undefined on clear, and guards the numeric-value branch.

2. The redirect-to-dashboard URL appended `#${selectedTab.value}` for
   any truthy value, including the synthetic OUT_OF_TAB sentinel used to
   represent "no tab". Skip appending the hash for OUT_OF_TAB, matching
   the existing guard used when building selectedTabId.

Addresses codeant-ai review on PR #39461.
2026-05-12 14:21:26 -07:00
Evan Rusackas
26fcd6bcbb fix(SqlLab): retry fetchQueryResults when resultsKey changes
Replaces the one-shot hasRunInitialEffect mount guard in TabbedSqlEditors
with a fetchedResultsKeyRef that records the last persisted resultsKey
fetched. The old guard permanently blocked the effect once it ran, so when
activeQueryEditor was unavailable on first render (common when tabHistory
hydrates asynchronously), persisted results were never fetched. Tracking
resultsKey lets the effect retry when it resolves and dedupes repeats.

Addresses codeant-ai review on PR #39461.
2026-05-12 14:21:26 -07:00
Evan Rusackas
37538a81a4 fix(CopyToClipboard): guard cloneElement for non-element copyNode
copyNode is typed ReactNode but was passed unconditionally to
cloneElement. Non-element values (strings, numbers) would crash at
runtime. Guard with isValidElement and wrap non-elements in a styled
span.
2026-05-12 14:21:26 -07:00
Evan Rusackas
e598a05c58 fix(SaveModal): restore saveAction history state dropped in function component conversion
The class component passed { saveAction: this.state.action } as the
second arg to history.replace after save. The function component
conversion dropped that argument. ExploreViewContainer reads
history.location.state.saveAction to trigger chart reload, which
puts the chart in 'loading' status and disables query-save-button.

Restores the argument to fix the `Cross-referenced dashboards` cypress
test which asserts the button becomes disabled after save.
2026-05-12 14:21:26 -07:00
Evan Rusackas
60945d708f fix(imports): rewrite stale @apache-superset/core bare and api/core imports to correct subpaths 2026-05-12 14:21:26 -07:00
Evan Rusackas
af86993d0f style: apply prettier formatting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:21:26 -07:00
Evan Rusackas
e57edc7e95 fix(imports): rewrite stale @apache-superset/core/ui to current subpaths
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:21:26 -07:00
Evan Rusackas
82b224395a chore(lint): convert explore controls, SqlLab, and misc components to function components
Converts explore control components (AnnotationLayer, CheckboxControl,
CollectionControl, DatasourceControl, AdhocFilter*, FixedOrMetricControl,
AdhocMetric*, SelectControl, SpatialControl, TextAreaControl, TextControl,
TimeSeriesColumnControl, ViewportControl, SaveModal), SqlLab (App,
TabbedSqlEditors), Datasource (CollectionTable, DatasourceEditor),
and misc (CopyToClipboard, ErrorBoundary, RightMenu, ChartCreation)
from class to function components.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:21:24 -07:00
Varun Chawla
a77fec68d4 fix(drill-detail): make page-size selector functionally adjustable (#37975)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Evan Rusackas <evan@preset.io>
2026-05-12 13:39:41 -07:00
Abdul Rehman
e94465208f fix(bar-chart): cap bar width so a single data point doesn't stretch across the chart (#39588)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-12 13:24:46 -07:00
Abdul Rehman
f2eee4ef46 fix(frontend): prevent LanguagePicker crash when locale is missing from LANGUAGES config (#39585)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-12 13:22:36 -07:00
yeaight
7445105735 fix(explore): explain disabled chart overwrite option (#39796) 2026-05-12 12:53:59 -07:00
innovark
2392c8e624 fix(Select): fix Russian translations for Select (#35751)
Co-authored-by: Evan Rusackas <evan@preset.io>
Co-authored-by: Sam Firke <sfirke@users.noreply.github.com>
2026-05-12 13:48:42 -04:00
Arpit Jain
39ad6b200f docs(update): fix typos in UPDATING.md (#40068) 2026-05-12 23:40:22 +07:00
Igor Khrol
3363b48180 fix(spark): register Spark SQLAlchemy dialect so spark:// URIs resolve to SparkEngineSpec (#38299)
Co-authored-by: Joe Li <joe@preset.io>
2026-05-12 12:33:17 -04:00
dependabot[bot]
c9fb1bc10f chore(deps-dev): bump @typescript-eslint/parser from 8.59.2 to 8.59.3 in /superset-frontend (#40057)
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hainenber <dotronghai96@gmail.com>
2026-05-12 22:27:58 +07:00
Evan Rusackas
658907a0a6 fix(gha): use sound condition gating for latest-tag step (#40035)
Co-authored-by: Superset Dev <dev@superset.apache.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 22:27:26 +07:00
Đỗ Trọng Hải
4a79896bb2 chore(build): replace replaceable jest-mock-console with native Jest spies (#38643)
Signed-off-by: hainenber <dotronghai96@gmail.com>
2026-05-12 21:32:08 +07:00
Đỗ Trọng Hải
b0c5b061c5 fix(sqllab): display horizontal scrollbar in data preview modal (#39799)
Signed-off-by: hainenber <dotronghai96@gmail.com>
2026-05-12 21:30:54 +07:00
Kasia
c394405fc1 fix(explore): restore spacing between tabs and content in control popovers (#40023) 2026-05-12 14:30:41 +02:00
Kasia
d2ae5fb275 fix(ux): remove CSS-forced uppercase from button labels (#40049) 2026-05-12 14:28:39 +02:00
Amin Ghadersohi
460992d89b fix(mcp): improve not-found errors to suggest corresponding list_* tools (#39919)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-12 02:38:10 -04:00
Amin Ghadersohi
85935b0b88 fix(mcp): handle SSL connection drop during pre-call session teardown (#39917) 2026-05-12 02:32:14 -04:00
innovark
fa168fcc8a fix(Label): use correct color for label component (#38707) 2026-05-11 21:40:31 -07:00
Andy
a6ad0bf169 fix(re-encrypt-secrets): use db.Model.metadata to discover encrypted … (#39390)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 21:16:41 -07:00
Abdul Rehman
fed29b3017 fix(deploy): prevent double-prefix of logo URL in subdirectory deployments (#39472)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-11 21:13:26 -07:00
Nitish Agarwal
24d76b4249 fix(sunburst): remove label text outline in dark theme (#39774) 2026-05-11 20:24:25 -07:00
Evan Rusackas
5ab8583cd0 chore(gha): pin github/codeql-action to a SHA (#40043)
Co-authored-by: Superset Dev <dev@superset.apache.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 20:18:55 -07:00
Evan Rusackas
e66fbc91c2 chore(gha): pass commenter login through env in claude.yml (#40042)
Co-authored-by: Superset Dev <dev@superset.apache.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 20:00:27 -07:00
Mafi
187bb416e7 fix(plugin-chart-ag-grid-table): use display text for filter and sort on HTML cells (#39885)
Co-authored-by: Richard Fogaca Nienkotter <63572350+richardfogaca@users.noreply.github.com>
2026-05-11 20:29:16 -03:00
Evan Rusackas
cfb704dbeb test(sqllab): stabilize SaveDatasetModal overwrite-flow test helper (#40036)
Co-authored-by: Superset Dev <dev@superset.apache.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 15:48:10 -07:00
Evan Rusackas
e77f6ece92 fix(ci): serialize Docs Deployment runs to avoid push races (#40030)
Co-authored-by: Claude Code <noreply@anthropic.com>
2026-05-11 11:25:31 -07:00
Evan Rusackas
785a08c7d5 chore(frontend): export typed useAppDispatch / useAppSelector hooks (#40027)
Co-authored-by: Claude Code <noreply@anthropic.com>
2026-05-11 11:01:57 -07:00
Maxime Beauchemin
d90d3a2dea fix(importexport): honor overwrite flag on /api/v1/assets/import (#39502)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-11 10:24:42 -07:00
Maxime Beauchemin
6ee4d694bc fix(sqllab): include template_params when overwriting a dataset (#39501)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-11 10:24:15 -07:00
Evan Rusackas
006a1800be chore(lint): convert react-pivottable components to function components (#39453)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 10:19:05 -07:00
Evan Rusackas
2fe6269c22 chore(lint): convert ChartDataProvider and StatefulChart to function components (#39456)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 09:55:27 -07:00
Evan Rusackas
26ef4b7ed3 fix(sqla): pass catalog and schema to get_sqla_engine in values_for_column (#38681)
Co-authored-by: Superset Dev <dev@superset.apache.org>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Claude <claude@anthropic.com>
2026-05-11 09:54:48 -07:00
Evan Rusackas
a7aa854968 fix(big-number): guard against null colorPicker in transformProps (#39110)
Co-authored-by: Amin Ghadersohi <amin.ghadersohi@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 09:54:08 -07:00
Evan Rusackas
db0c5b32da chore(lint): convert SuperChart and SuperChartCore to function components (#39457)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 09:51:52 -07:00
Evan Rusackas
96ad20318d chore(superset-core): forward-compat fixes for TypeScript 6.0 - Phase C (#39537)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 09:50:07 -07:00