Skip to content

fix(explore): hide inactive result tables in mixed chart view as table - #37777

Merged
rusackas merged 4 commits into
apache:masterfrom
KH-Coder865:fix/mixed-chart-view-as-table-tab-visibility
Jun 29, 2026
Merged

rusackas merged 4 commits into
apache:masterfrom
KH-Coder865:fix/mixed-chart-view-as-table-tab-visibility

Conversation

@KH-Coder865

Copy link
Copy Markdown
Contributor

SUMMARY

This PR fixes a frontend issue in the Mixed chart “View as table” modal where multiple result tables remain visible when switching between tabs.

For mixed charts, multiple result panes (Results, Results 2, etc.) are rendered, but inactive panes were not being unmounted when the active tab changed. This caused previously rendered tables to remain visible and overlap in the UI.

The fix conditionally renders each tab’s content based on the active tab key, ensuring that only the selected tab’s table is visible at any time.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: Switching between result tabs causes multiple tables to remain visible simultaneously.
After: Only the active tab’s table is rendered and visible.

TESTING INSTRUCTIONS

  1. Create or open a Mixed chart with multiple queries.
  2. Run the chart.
  3. Click View as table.
  4. Switch between Results, Results 2, and Samples tabs.
  5. Verify that only the currently selected tab’s table is visible.
  6. Confirm there are no layout or scrolling issues when switching tabs.

FIXES

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

LABELS

  • viz:charts:table

@dosubot dosubot Bot added the viz:charts:table Related to the Table chart label Feb 7, 2026

@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 #1ba5c9

Actionable Suggestions - 1
  • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx - 1
Review Details
  • Files reviewed - 1 · Commit Range: b74cf7e..39caa8d
    • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.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 evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review

bito-code-review Bot commented Feb 7, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #78c2c7

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: b74cf7e..39caa8d
    • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.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 evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review

bito-code-review Bot commented Feb 8, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #0c0895

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 39caa8d..ed6103c
    • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/types.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

@SBIN2010

SBIN2010 commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

Superset uses Git pre-commit hooks courtesy of pre-commit. To install run the following:

pip3 install -r requirements/development.txt
pre-commit install
A series of checks will now run when you make a git commit.

Alternatively it is possible to run pre-commit by running pre-commit manually:

pre-commit run --all-files

@rusackas
rusackas requested a review from SBIN2010 February 9, 2026 07:50
@netlify

netlify Bot commented Feb 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

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

@KH-Coder865

Copy link
Copy Markdown
Contributor Author

Superset uses Git pre-commit hooks courtesy of pre-commit. To install run the following:

pip3 install -r requirements/development.txt pre-commit install A series of checks will now run when you make a git commit.

Alternatively it is possible to run pre-commit by running pre-commit manually:

pre-commit run --all-files

Done, I think everything will work now.
Requesting a review @SBIN2010

@bito-code-review

bito-code-review Bot commented Feb 9, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #2c15d3

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: ed6103c..95c24a8
    • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/types.ts
  • 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 evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@KH-Coder865

Copy link
Copy Markdown
Contributor Author

@SBIN2010 is this PR ready to be merged ?

@SBIN2010

Copy link
Copy Markdown
Contributor

Unfortunately, the tests did not pass.
❌ Pre-commit check failed (exit code: 1).
🔍 Modified files:
superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx
🚒 To prevent/address this CI issue, please install/use pre-commit locally.

@SBIN2010 SBIN2010 added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Feb 27, 2026
@github-actions github-actions Bot added 🎪 95c24a8 🚦 building 🎪 ⌛ 48h Environment expires after 48 hours (default) and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Feb 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for 95c24a8

@rusackas

Copy link
Copy Markdown
Member

@KH-Coder865 pre-commit is failing - looks like the indentation in the .map callback in DataTablesPane.tsx (and a trailing-whitespace blank line) is tripping prettier. Can you run pre-commit run --all-files locally and push the fix?

Also @SBIN2010 tested this on the ephemeral env and it didn't seem to actually hide the first table - did rendering null for inactive tabs do the trick for you locally? A short before/after clip would help.

Converting this to draft for now, while it awaits touchups.

@rusackas
rusackas marked this pull request as draft June 18, 2026 01:21
Conditionally render Results tab content so inactive panes unmount, and
make ResultsPane `isVisible` optional (visibility is managed by the parent
tab container). Rebased on current master and reformatted to satisfy prettier.

Closes apache#37772

Co-authored-by: Evan Rusackas <evan@rusackas.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@rusackas
rusackas force-pushed the fix/mixed-chart-view-as-table-tab-visibility branch from 95c24a8 to e60fbb8 Compare June 27, 2026 09:26
@rusackas
rusackas marked this pull request as ready for review June 27, 2026 09:26
@rusackas

Copy link
Copy Markdown
Member

I went ahead and adopted this to get it over the line, @KH-Coder865 (thanks for the original fix!). Rebased on current master and cleaned up the prettier indentation that was failing pre-commit, then flipped it back to ready for review.

On the bot threads: the CodeAnt "actions is undefined" flag doesn't apply to the current diff (the props we actually drop from the useResultsPane call are setForceQuery and isVisible, not actions). The Bito note about state loss on tab switch is the real one worth a look: rendering inactive panes as null does unmount them, so something like the filter text in a result pane resets when you switch tabs. That's inherent to the hide-inactive approach here, and I think it's an acceptable tradeoff for not rendering all the result tables at once, but happy to hear if anyone feels we should preserve that state instead.

Running CI now 🤞

@dosubot dosubot Bot added explore:design Related to the Explore UI/UX viz:charts:mixed labels Jun 27, 2026
@codecov

codecov Bot commented Jun 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 63.96%. Comparing base (0a18779) to head (defb8ba).
⚠️ Report is 26 commits behind head on master.

Files with missing lines Patch % Lines
...plore/components/DataTablesPane/DataTablesPane.tsx 93.33% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #37777   +/-   ##
=======================================
  Coverage   63.95%   63.96%           
=======================================
  Files        2664     2664           
  Lines      146217   146230   +13     
  Branches    33731    33738    +7     
=======================================
+ Hits        93512    93529   +17     
+ Misses      50988    50986    -2     
+ Partials     1717     1715    -2     
Flag Coverage Δ
javascript 68.97% <93.75%> (+<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.

@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 #1be105

Actionable Suggestions - 2
  • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx - 1
    • Missing setForceQuery prop causes functional regression · Line 191-191
  • superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx - 1
Additional Suggestions - 2
  • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx - 1
    • Inconsistent isVisible prop handling between Results and Samples panes · Line 192-192
      The `isVisible` prop was removed from ResultsPane but not from SamplesPane. While the hook defaults to `true` (isVisible ?? true), this changes behavior - ResultsPane content will now render even for inactive tabs rather than being hidden until tab activation. The SamplesPane keeps its explicit visibility check at line 216.
  • superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx - 1
    • Missing test coverage for prop · Line 184-184
      Tests for `useResultsPane` do not verify `isVisible` prop handling. Per rule 6262, tests should assert actual behavior rather than just rendering. Add assertions that confirm the fallback value and visibility state are correctly propagated to `SingleQueryResultPane`.
Review Details
  • Files reviewed - 3 · Commit Range: e60fbb8..e60fbb8
    • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/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 evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

The tab-visibility fix dropped setForceQuery from the useResultsPane
call. The hook calls setForceQuery?.(false) after a forced query
resolves, so without it the chart stays stuck in force-refresh mode.
Restore the prop while keeping the conditional tab rendering that
hides inactive result tables.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rusackas

Copy link
Copy Markdown
Member

@KH-Coder865 thanks for the fix! I pushed a small follow-up: the original change dropped setForceQuery from the useResultsPane call, and the hook needs it to reset force-refresh after a query resolves, so I wired that back up. The conditional tab rendering is otherwise untouched. Running CI 🤞

@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.

LGTM, though I touched it so I'd love a second opinion! The conditional rendering plus the restored setForceQuery seems right to me. Thanks @KH-Coder865, and please weigh in if you have feelings about anything I'm doing here as I try to get this one settled/merged :)

@rusackas rusackas added merge-if-green If approved and tests are green, please go ahead and merge it for me and removed review:draft labels Jun 28, 2026
A mixed chart can be reconfigured to return fewer result panes than
before. If a now-removed results tab (e.g. "Results 2") was active, the
data panel rendered blank with a stale active key until the user manually
reselected a valid tab. Reset the active key to the first results tab in
that case.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pull-request-size pull-request-size Bot added size/M and removed size/S labels Jun 29, 2026
@bito-code-review

bito-code-review Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #994a9d

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx - 1
    • Missing test coverage for fallback · Line 204-218
      The new useEffect at lines 204-218 implements a critical fallback when mixed charts return fewer result panes, but this behavior is not covered by any existing tests. Without a regression test, future changes could silently break this fix and cause the data panel to render blank with a stale active key.
Review Details
  • Files reviewed - 1 · Commit Range: 9dc473f..807e35b
    • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.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 evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@apache apache deleted a comment from bito-code-review Bot Jun 29, 2026
Extract the stale-tab reset condition into getStaleResultsTabFallback and
unit-test it. A full render test can't exercise this path because antd
builds an invalid id-based selector for the space-containing 'results 2'
tab key under jsdom when that tab is activated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rusackas
rusackas merged commit 9dba4d0 into apache:master Jun 29, 2026
66 checks passed
@github-actions github-actions Bot removed the 🎪 ⌛ 48h Environment expires after 48 hours (default) label Jun 29, 2026
@bito-code-review

Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped – PR Already Merged

Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.
No action is needed if you didn't intend to review it. To get a review, you can type /review in a comment and save it

@KH-Coder865

Copy link
Copy Markdown
Contributor Author

LGTM, though I touched it so I'd love a second opinion! The conditional rendering plus the restored setForceQuery seems right to me. Thanks @KH-Coder865, and please weigh in if you have feelings about anything I'm doing here as I try to get this one settled/merged :)

Thank you. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

explore:design Related to the Explore UI/UX merge-if-green If approved and tests are green, please go ahead and merge it for me size/M viz:charts:mixed viz:charts:table Related to the Table chart

Projects

None yet

Development

Successfully merging this pull request may close these issues.

View as table in mixed chart

3 participants