Skip to content

feat(folders): drag and drop visible elements (columns/metrics) of folders in explore view - #42483

Merged
rusackas merged 14 commits into
apache:masterfrom
greggailly:gailly/dnd_folders
Sep 9, 2026
Merged

rusackas merged 14 commits into
apache:masterfrom
greggailly:gailly/dnd_folders

Conversation

@greggailly

@greggailly greggailly commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

feat(folders): drag and drop visible elements (columns/metrics) of folders in explore view

SUMMARY

Allow to drag and drop all visible columns of a single folder (including subfolders) onto dnd fields (group by, metrics etc...) in explore view. If columns are currently filtered only filtered columns are added.
Folder can be grabbed by the header.
A small overlay showing the number of columns dragged shows up when dragging.
Already added columns are not added.
If dropped on metrics the "SUM" aggregation is applied by default for numeric values and count distinct for other values .

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Columns with a subfolder:
Screen Recording 2026-07-27 at 16 51 14

Metrics just a single subfolder:
Screen Recording 2026-07-27 at 16 52 07

TESTING INSTRUCTIONS

  • Create folders on a dataset
  • Create a new chart in explore mode
  • Drag and drop folders onto dimensions, groupbys or metrics fields

ADDITIONAL INFORMATION

  • Changes UI

@bito-code-review

bito-code-review Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #20b69e

Actionable Suggestions - 0
Review Details
  • Files reviewed - 12 · Commit Range: 1f13c20..1223433
    • superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx
    • superset-frontend/src/explore/components/DatasourcePanel/folderDrag.test.ts
    • superset-frontend/src/explore/components/DatasourcePanel/folderDrag.ts
    • superset-frontend/src/explore/components/DatasourcePanel/types.ts
    • superset-frontend/src/explore/components/DndItemType.ts
    • superset-frontend/src/explore/components/ExploreContainer/ExploreDndContext.test.tsx
    • superset-frontend/src/explore/components/ExploreContainer/ExploreDndContext.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnMetricSelect.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/createAdhocMetricFromColumn.test.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added change:frontend Requires changing the frontend explore:drag&drop Related to drag&drop in Explore labels Jul 27, 2026
@netlify

netlify Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 213e416
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a9a83db5c19c10008d9bce6
😎 Deploy Preview https://deploy-preview-42483--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@bito-code-review

Copy link
Copy Markdown
Contributor

The flagged issue is correct. The current implementation of canDrop in DndSelectLabel.tsx performs a type check against acceptTypes before evaluating the folder's contents, causing folder drops to be rejected if the drop zone does not explicitly accept the Folder type.

To resolve this, the logic should be updated to evaluate the folder's child items when the active item type is Folder, allowing the drop if at least one child item is valid for the drop zone. The provided diff already includes this fix, which correctly checks activeData.items and validates them against acceptTypes and dropValidator.

superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx

if (activeData.type === DndItemType.Folder) {
      const items = Array.isArray(activeData.items) ? activeData.items : [];
      return items.some(
        item =>
          acceptTypes.includes(item.type as DndItemType) && dropValidator(item),
      );
    }

@codecov

codecov Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.98795% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.45%. Comparing base (8d0637e) to head (213e416).

Files with missing lines Patch % Lines
...components/DatasourcePanel/DatasourcePanelItem.tsx 92.85% 2 Missing ⚠️
...s/DndColumnSelectControl/DndColumnMetricSelect.tsx 93.75% 1 Missing ⚠️
...ontrols/DndColumnSelectControl/DndColumnSelect.tsx 94.11% 1 Missing ⚠️
...ontrols/DndColumnSelectControl/DndMetricSelect.tsx 97.22% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #42483      +/-   ##
==========================================
+ Coverage   79.42%   79.45%   +0.02%     
==========================================
  Files        2895     2897       +2     
  Lines      167997   168123     +126     
  Branches    38903    38952      +49     
==========================================
+ Hits       133437   133587     +150     
+ Misses      32061    32037      -24     
  Partials     2499     2499              
Flag Coverage Δ
javascript 75.00% <96.98%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bito-code-review

bito-code-review Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #c563d8

Actionable Suggestions - 0
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset-frontend/src/explore/components/ExploreContainer/ExploreDndContext.tsx - 1
Review Details
  • Files reviewed - 9 · Commit Range: 1f13c20..36a8b3d
    • superset-frontend/src/explore/components/ExploreContainer/ExploreDndContext.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnMetricSelect.tsx
    • superset-frontend/src/explore/components/ExploreContainer/ExploreDndContext.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnMetricSelect.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/dndTestUtils.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas

Copy link
Copy Markdown
Member

@greggailly nice feature, and the regression tests for the single-value folder-drop bug are a good touch. Codeant's thread on DndMetricSelect.tsx is still open though: createAdhocMetricFromColumn leaves aggregate unset for columns outside Numeric/String/Boolean/Temporal, so a folder drop can create an incomplete metric. Mind landing a fix before this merges? Let me know if you need any help with these.

@greggailly
greggailly force-pushed the gailly/dnd_folders branch 2 times, most recently from 65d7635 to 9dd953d Compare July 31, 2026 09:06
@greggailly

greggailly commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor Author

@rusackas @EnxDev both threads are resolved, thanks for the reviews !

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #e7ae6f

Actionable Suggestions - 1
  • superset-frontend/src/explore/components/DatasourcePanel/types.ts - 1
    • Dead code: unused exported interface · Line 36-40
Additional Suggestions - 4
  • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx - 1
    • Missing component integration test · Line 129-136
      While resolveCanDrop has unit tests for the pure logic (lines 106-216 of test file), the component-level integration that connects canDrop state to UI feedback is not covered. Tests should verify the ghost button state during folder drags.
  • superset-frontend/src/explore/components/DndItemType.ts - 1
    • Missing unit test for new enum · Line 41-42
      Per adaptive rule [11730], new enum values introduced to support feature functionality should have explicit unit test coverage. While `DndItemType.Folder` is referenced in 19+ locations and tested indirectly via `DndSelectLabel.test.tsx`, there is no dedicated test verifying the `Folder` enum member itself.
  • superset-frontend/src/explore/components/DatasourcePanel/types.ts - 1
    • Misleading JSDoc on unused interface · Line 30-35
      The JSDoc comment on `FolderDndItem` is misleading. It claims drop targets can "reuse their per-item `canDrop`/`onDrop` logic" via the `items` array, but `DndSelectLabel.tsx:81` shows the actual API is `onDropFolder?: (items: DatasourcePanelDndItem[]) => void` — items are passed directly, not wrapped in a `FolderDndItem`. The comment describes functionality that does not exist in the codebase.
  • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx - 1
    • Missing folder drop tests · Line 100-121
      The `onDropFolder` handler (lines 100-121) is consistent with the `resolveDragEnd` pattern in ExploreDndContext (lines 207-228) and mirrors `DndMetricSelect.tsx` (line 421). No bugs found. However, `DndColumnSelect.test.tsx` lacks coverage for folder drops — add tests similar to the existing `ExploreDndContext.test.tsx` folder-drop cases to verify: (1) folder drop adds accepted columns to multi-select, (2) single-select replaces existing value, (3) empty columnNames is a no-op.
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset-frontend/src/explore/components/DatasourcePanel/folderDrag.test.ts - 1
Review Details
  • Files reviewed - 17 · Commit Range: 5b39872..96054b6
    • superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx
    • superset-frontend/src/explore/components/DatasourcePanel/folderDrag.test.ts
    • superset-frontend/src/explore/components/DatasourcePanel/folderDrag.ts
    • superset-frontend/src/explore/components/DatasourcePanel/types.ts
    • superset-frontend/src/explore/components/DndItemType.ts
    • superset-frontend/src/explore/components/ExploreContainer/ExploreDndContext.test.tsx
    • superset-frontend/src/explore/components/ExploreContainer/ExploreDndContext.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnMetricSelect.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnMetricSelect.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/createAdhocMetricFromColumn.test.ts
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/dndTestUtils.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review

bito-code-review Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #e802ee

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 96054b6..b65c1c8
    • superset-frontend/src/explore/components/DatasourcePanel/types.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas

Copy link
Copy Markdown
Member

@greggailly this is showing conflicts with master now, needs a rebase. Also, @sadpandajoe's comments above (the folder-drag accessibility gap and the semantic-layer/search-filter gating questions) are still open, worth a look before this is ready to merge. Holler if you ant a hand with any of it.

@greggailly
greggailly force-pushed the gailly/dnd_folders branch 2 times, most recently from 3d50ec7 to 0b0b44e Compare August 10, 2026 15:30
@greggailly

greggailly commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor Author

@greggailly this is showing conflicts with master now, needs a rebase. Also, @sadpandajoe's comments above (the folder-drag accessibility gap and the semantic-layer/search-filter gating questions) are still open, worth a look before this is ready to merge. Holler if you ant a hand with any of it.

@rusackas something seems off with master (might be on my side but can't see dataset columns anymore in the explore view) so hard to rebase for the moment. I will try to nuke my setup when possible just in case.
Conflict is simply on an import statement so will be quick once this has been tackled.

Screenshot 2026-08-10 at 18 52 35

@bito-code-review

bito-code-review Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #b51e8d

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: d097af9..60804f6
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review

bito-code-review Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #4ec878

Actionable Suggestions - 0
Additional Suggestions - 2
  • superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx - 1
    • Missing button type attribute · Line 274-274
      The `SectionHeaderButton` is a styled `` element used as a collapse/expand toggle, but it's missing the explicit `type="button"` attribute. Without it, the button defaults to `type="submit"`, which can cause unintended form submissions when clicked within a form context. The codebase precedent in `ClearAllButton` (ListView.tsx:533) shows this attribute is used consistently when styled buttons serve non-submit purposes.
  • superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/DatasourcePanelDragOption.test.tsx - 1
    • Incomplete test assertion · Line 52-52
      The test name claims to verify "is faded and not draggable" but only asserts the cursor style. The component also applies `opacity: 0.35` (line 122 in index.tsx) when `isCompatible` is false. Add a corresponding opacity assertion to fully validate the visual "faded" state.
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.test.tsx - 1
Review Details
  • Files reviewed - 21 · Commit Range: 3452187..3a79d1f
    • superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/DatasourcePanelDragOption.test.tsx
    • superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/index.tsx
    • superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.test.tsx
    • superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx
    • superset-frontend/src/explore/components/DatasourcePanel/compatibility.test.ts
    • superset-frontend/src/explore/components/DatasourcePanel/compatibility.ts
    • superset-frontend/src/explore/components/DatasourcePanel/folderDrag.test.ts
    • superset-frontend/src/explore/components/DatasourcePanel/folderDrag.ts
    • superset-frontend/src/explore/components/DndItemType.ts
    • superset-frontend/src/explore/components/ExploreContainer/ExploreDndContext.test.tsx
    • superset-frontend/src/explore/components/ExploreContainer/ExploreDndContext.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnMetricSelect.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnMetricSelect.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/createAdhocMetricFromColumn.test.ts
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/dndTestUtils.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers an incremental AI Review.

  • /review full - Manually triggers a full AI Review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@EnxDev

EnxDev commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

EnxDev's Review Agent — #42483 · HEAD 3a79d1f

comment — solid feature, well tested; two reviewer threads are still genuinely open and worth a decision before merge

Context

Adds folder-level drag-and-drop in Explore (drag a whole folder's columns/metrics onto a dnd field). Classified as feature work (correctness first). CI is green, patch coverage 96%. Several bot reviewers (CodeAnt, Bito) raised issues earlier — I re-verified each against the current diff:

  • resolveCanDrop/resolveDragEnd folder-type-gating claims ("folder drops always rejected", "onDropFolder never wired") — not reproducible: every control wiring onDropFolder also lists DndItemType.Folder in its accept/DND_ACCEPTED_TYPES, and resolveCanDrop has an explicit folder branch that evaluates child items. These were false positives, correctly pushed back on by the author.
  • Single-value control silently keeping the stale value on folder drop — fixed (DndColumnMetricSelect.tsx now sends additions[0], covered by a regression test).
  • Column+same-named-metric duplicate entries on folder drop — fixed (Set-based dedup, covered by tests).
  • Missing aggregate fallback for non-numeric/string/boolean/temporal columns — fixed (createAdhocMetricFromColumn now defaults everything non-numeric to COUNT_DISTINCT).
  • Folder drag payload ignoring compatibleDimensions/compatibleMetrics gating — fixed, refactored into shared compatibility.ts used by both the per-item and folder-header drag sources.
  • Folder-header keyboard/drag-vs-toggle collision — fixed with a dedicated drag handle (separate element, own aria-label, own draggable id).

🟡 Should-fix

  • superset-frontend/src/explore/components/DatasourcePanel/folderDrag.ts:49 (open reviewer thread, sadpandajoe) — when datasource search is active, the folder header's drag payload is built from the filtered items, so dragging picks up only the visible matches, not "the entire folder" the PR description promises. Author acknowledged this is a deliberate choice ("I prefer only dragging in the visible fields") but the thread is still unresolved and the behavior contradicts the PR description — worth an explicit decision (and a description update either way) before merge.
  • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx:69 (open reviewer thread, sadpandajoe) — createAdhocMetricFromColumn's COUNT_DISTINCT fallback now also covers MultiValue/unknown-type columns, which previously got no default and required the popover. Folder drops bypass the popover entirely, so these columns are now silently committed with an aggregation nobody chose. No reply from the author on this thread since it was raised — confirm COUNT_DISTINCT is an acceptable default for these types, or gate them out of folder-drop the way disallow_adhoc_metrics already does.

🙌 Praise

  • DndSelectLabel.test.tsx, ExploreDndContext.test.tsx — the resolveCanDrop/resolveDragEnd/renderDragOverlayContent extraction into pure, directly-testable functions is a good pattern given jsdom can't simulate real @dnd-kit pointer drags; it's how the false-positive bot findings above could be verified with confidence.

Reviewed by EnxDev's Review Agent — @EnxDev · HEAD 3a79d1f.

@greggailly greggailly changed the title feat(folders): drag and drop entire folders in explore view feat(folders): drag and drop visible elements (columns/metrics) of folders in explore view Aug 31, 2026
@greggailly

Copy link
Copy Markdown
Contributor Author

Thanks @EnxDev !
Closed the first thread by changing the PR description.
For the second thread, I guess COUNT_DISTINCT is an acceptable default as it won't create query errors but if you believe it is best to gate the metrics out of the drop I'm happy to make the change.

@bito-code-review

bito-code-review Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #a1da95

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx - 1
    • Duplicated type predicate · Line 63-69
      The supported-type predicate is encoded twice: `isColumnSupportedForMetricAggregation` (63-69) and the aggregate branches in `createAdhocMetricFromColumn` (85-93) both re-implement `Numeric || COUNT_DISTINCT_ELIGIBLE_TYPES`. If a type is added to one, the folder-drop filter and the metric builder can silently diverge. Consider having `createAdhocMetricFromColumn` call `isColumnSupportedForMetricAggregation`.
Review Details
  • Files reviewed - 3 · Commit Range: 3a79d1f..2932904
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/createAdhocMetricFromColumn.test.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers an incremental AI Review.

  • /review full - Manually triggers a full AI Review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review

bito-code-review Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #6dcb20

Actionable Suggestions - 0
Additional Suggestions - 5
  • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx - 1
    • Folder drop duplicate metrics · Line 452-462
      `onDropFolder` has no within-batch dedup, unlike the sibling `DndColumnMetricSelect.onDropFolder` (which tracks a `seen` set). `resolveDragEnd` evaluates `canDrop` per-item against the current `value`, so a folder containing a column and a same-named metric (or duplicate columns) both pass and produce duplicate metrics. Seed a `seen` set from `value` and skip already-present names.
  • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx - 1
    • Duplicate type definition · Line 40-40
      Rather than redeclaring `ActiveDragData` here, import the canonical interface directly from `ExploreDndContext.tsx` (e.g. ```ts import { ActiveDragData } from '../ExploreContainer/ExploreDndContext'; ``` or rename this local alias (e.g., `ResolveCanDropData`) to avoid collision and ensure the definitions stay in sync.
  • superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/DatasourcePanelDragOption.test.tsx - 1
    • Assert faded opacity in test · Line 38-53
      The test name claims the item is 'faded and not draggable', but only the cursor style is asserted. `DatasourcePanelDragOption` also sets `opacity: 0.35` when `isCompatible` is false (index.tsx:122). Add `expect(option).toHaveStyle({ opacity: '0.35' })` so the faded behavior is actually verified.
  • superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx - 1
    • Misleading drag comment · Line 205-208
      The comment says "dragging the label picks up every column/metric," but the drag listeners are attached to the separate `FolderDragHandle`, not the `SectionHeaderButton` label. This mismatch can mislead future maintainers about where drag is wired. Clarify the comment or wire the label if that was intended.
  • superset-frontend/src/explore/components/DatasourcePanel/compatibility.ts - 1
    • Type import inconsistency · Line 20-20
      `DndItemValue` is `ColumnMeta | Metric` where `Metric` comes from `@superset-ui/chart-controls` (types.ts:19), but here `Metric` is imported from `@superset-ui/core`. The cast `(value as Metric)` then relies on structural overlap between two distinct type sources. Align both imports to the same module to avoid divergence.
Review Details
  • Files reviewed - 21 · Commit Range: 916f176..213e416
    • superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/DatasourcePanelDragOption.test.tsx
    • superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/index.tsx
    • superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.test.tsx
    • superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx
    • superset-frontend/src/explore/components/DatasourcePanel/compatibility.test.ts
    • superset-frontend/src/explore/components/DatasourcePanel/compatibility.ts
    • superset-frontend/src/explore/components/DatasourcePanel/folderDrag.test.ts
    • superset-frontend/src/explore/components/DatasourcePanel/folderDrag.ts
    • superset-frontend/src/explore/components/DndItemType.ts
    • superset-frontend/src/explore/components/ExploreContainer/ExploreDndContext.test.tsx
    • superset-frontend/src/explore/components/ExploreContainer/ExploreDndContext.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnMetricSelect.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnMetricSelect.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.test.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/createAdhocMetricFromColumn.test.ts
    • superset-frontend/src/explore/components/controls/DndColumnSelectControl/dndTestUtils.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers an incremental AI Review.

  • /review full - Manually triggers a full AI Review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya @greggailly, this has been through a lot of review rounds now - threads are all resolved and CI's green. Code LGTM, approving!

@rusackas
rusackas merged commit c9965c7 into apache:master Sep 9, 2026
80 checks passed
@greggailly
greggailly deleted the gailly/dnd_folders branch September 9, 2026 10:44
mikebridge pushed a commit to mikebridge/superset that referenced this pull request Sep 15, 2026
Three independent collisions, resolved as follows.

1. Compatibility state. Master carries two designs for the same feature: the
   flat explore.compatibleMetrics/compatibleDimensions fields (apache#37815) and
   useDatasourceCompatibility, extracted from them in apache#42483 for folder drag
   sources. This branch replaces the flat fields with a discriminated
   CompatibilityResult, so after the merge nothing writes them and the hook
   would read undefined forever -- silently disabling folder-level filtering
   in DatasourcePanelItem, which this branch never touches. The hook is
   therefore re-sourced from this branch's selectors with its signature
   unchanged, so its callers need no edit, and the two DatasourcePanelItem
   tests that seeded the flat shape are migrated to the new one.

2. Portal timing. Master's antd renders the Select option list into a portal
   on a later tick, so this branch's synchronous
   document.querySelector('.ant-select-dropdown-list') reads race it and find
   null. Reads now go through an awaited getDropdown() accessor, and the
   post-save onChange assertions are wrapped in waitFor for the same reason.

3. Test files. DndColumnSelect, DndColumnMetricSelect and
   AdhocFilterEditPopoverSimpleTabContent are both-sides-append conflicts,
   resolved as the union of both sets. DatasourcePanelDragOption keeps this
   branch's two tests: master's single test asserts against the flat field
   that no longer exists.

AdhocFilterEditPopoverSimpleTabContent still has 12 failures, but the same 12
fail on untouched master; the merge adds none.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01EA4MGEkUcDpyLReqjQBhPy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend explore:drag&drop Related to drag&drop in Explore size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants