Skip to content

feat(explore): add download control to standalone charts#42238

Open
RehanIslam09 wants to merge 3 commits into
apache:masterfrom
RehanIslam09:feat-standalone-chart-download
Open

feat(explore): add download control to standalone charts#42238
RehanIslam09 wants to merge 3 commits into
apache:masterfrom
RehanIslam09:feat-standalone-chart-download

Conversation

@RehanIslam09

Copy link
Copy Markdown
Contributor

SUMMARY

Adds an optional download control for charts rendered through standalone Explore URLs.

Standalone chart embeds currently hide the Explore chart header, which also makes the existing data export actions unavailable. This change introduces a new show_download URL parameter that allows standalone chart embeds to explicitly expose a compact download control without displaying the full Explore interface.

Example:

/explore/p/<permalink-key>/?standalone=1&show_download=1

The download control is opt-in and remains hidden when show_download is absent or disabled, preserving the existing standalone behavior.

The control also respects the existing can_download permission.

When enabled, users can export chart data as:

  • CSV
  • JSON
  • Excel

The existing Explore data export logic has been extracted into a reusable useExploreDataExport hook. Both the standard Explore actions menu and the new standalone download control use this shared implementation, avoiding duplicated export behavior and preserving existing functionality such as streaming CSV exports and export error handling.

BEFORE / AFTER

Before

Standalone charts rendered with standalone=1 do not expose data export controls.

After

Adding show_download=1 displays a compact download button in the top-right corner of the standalone chart.

The download menu provides CSV, JSON, and Excel export options.

image

Exports use the existing chart export functionality.

image

TESTING INSTRUCTIONS

  1. Create or open a chart in Explore.
  2. Generate a permalink for the chart.
  3. Open the standalone permalink without show_download:
    ?standalone=1
    • Verify that the download control is not displayed.
  4. Open the permalink with:
    ?standalone=1&show_download=0
    • Verify that the download control is not displayed.
  5. Open the permalink with:
    ?standalone=1&show_download=1
    • Verify that the download control is displayed for a user with download permissions.
  6. Open the download menu.
  7. Verify that CSV export successfully downloads the chart data.
  8. Verify that JSON export successfully downloads the chart data.
  9. Verify that Excel export successfully downloads the chart data.
  10. Verify that users without download permissions do not see the download control.
  11. Verify that show_download=1 does not add the standalone download control outside standalone mode.

AUTOMATED TESTS

Added coverage for the standalone download control behavior:

  • Download control is hidden when show_download is absent.
  • Download control is hidden when show_download=0.
  • Download control is displayed when show_download=1 and the user has download permission.
  • Download control is hidden when the user does not have download permission.
  • Download control is hidden outside standalone mode.

Relevant test suites:

  • ExploreChartPanel.test.tsx
  • useExploreAdditionalActionsMenu.test.tsx

Results:

  • 2 test suites passed
  • 20 tests passed
  • 0 test failures

Additional validation:

  • Prettier check passed.
  • Oxlint completed with 0 errors.
  • git diff --check passed.
  • CSV, JSON, and Excel exports were manually verified.

Closes #42224

@bito-code-review

bito-code-review Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #09793d

Actionable Suggestions - 0
Review Details
  • Files reviewed - 6 · Commit Range: 83e3883..83e3883
    • superset-frontend/src/constants.ts
    • superset-frontend/src/explore/components/ExploreChartPanel/ExploreChartPanel.test.tsx
    • superset-frontend/src/explore/components/ExploreChartPanel/StandaloneDownloadControl.tsx
    • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx
    • superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.tsx
    • superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/useExploreDataExport.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 evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added change:frontend Requires changing the frontend explore Namespace | Anything related to Explore labels Jul 20, 2026
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.59574% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.19%. Comparing base (09148d0) to head (31b6b85).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
...ploreAdditionalActionsMenu/useExploreDataExport.ts 73.49% 22 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #42238   +/-   ##
=======================================
  Coverage   65.18%   65.19%           
=======================================
  Files        2768     2770    +2     
  Lines      156099   156113   +14     
  Branches    35727    35730    +3     
=======================================
+ Hits       101758   101779   +21     
+ Misses      52377    52370    -7     
  Partials     1964     1964           
Flag Coverage Δ
javascript 70.83% <76.59%> (+0.01%) ⬆️

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.

@RehanIslam09

RehanIslam09 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

CI note: The only failing check is the experimental Playwright /app/prefix job, specifically embedded/pivot-collapse-state.spec.ts (collapsed rows stay collapsed after a scroll round-trip). I checked the uploaded Playwright artifacts, and the failures appear to be timeouts while waiting for the embedded dashboard/chart to initialize. This test covers embedded Pivot Table collapse state and does not appear related to the standalone Explore download changes in this PR. All other completed checks are passing, and the relevant frontend tests pass locally.

Update: The previously failing experimental Playwright check passed on the subsequent CI run. All checks are now passing.

@netlify

netlify Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 31b6b85
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a5e09fca3522a000811b733
😎 Deploy Preview https://deploy-preview-42238--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

bito-code-review Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #c1890a

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 83e3883..31b6b85
    • superset-frontend/src/explore/components/ExploreChartPanel/StandaloneDownloadControl.test.tsx
    • superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/useExploreDataExport.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 evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@sadpandajoe
sadpandajoe requested a review from yousoph July 20, 2026 17:28
@sadpandajoe

Copy link
Copy Markdown
Member

@yousoph added you to this in case if there are changes we want to make to be more similar to embedded dashboards.

@rusackas
rusackas self-requested a review July 20, 2026 17:49
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 Namespace | Anything related to Explore size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support a dedicated download button for shared standalone chart iframes

2 participants