Skip to content

fix(dashboard): stretch Chart Data modal results grid to fill available height - #43454

Open
EnxDev wants to merge 1 commit into
masterfrom
enxdev/fix/explore-chart-data
Open

fix(dashboard): stretch Chart Data modal results grid to fill available height#43454
EnxDev wants to merge 1 commit into
masterfrom
enxdev/fix/explore-chart-data

Conversation

@EnxDev

@EnxDev EnxDev commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

SUMMARY

The "View as table" (Chart Data) modal on a dashboard chart could render with its results grid collapsed to a thin sliver, with the "Edit chart"/ "Close" buttons sitting on top of or immediately below it instead of below a properly filled grid.

Root cause: ResultsPaneOnDashboard's <Tabs> didn't pass fullHeight (unlike its sibling usages in TabsRenderer/DashboardContainer), so .ant-tabs-content never received height: 100% and collapsed to its
intrinsic size.
Because the collapsed container reports a height of 0 to the ResizeObserver in useGridHeight, and that hook only updates
its state if (h > 0), the results grid silently fell back to a hardcoded 400px height that's disconnected from the modal's real available space. In a large default-sized modal this just wasted blank space; once the modal is smaller than 400px of available body height (e.g. resized down), the grid overflows and visually collides with the footer buttons.

Fix: pass fullHeight to the <Tabs> in ResultsPaneOnDashboard,restoring the height chain so the grid's container always reports its real size and the grid tracks it correctly at any modal size.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

before_after_resize_comparison.mp4

TESTING INSTRUCTIONS

  1. Build a Table chart on a single metric (no groupby) and add it to a
    dashboard.
  2. On the dashboard, open the chart's context menu and choose
    "View as table" (Chart Data).
  3. Resize the modal smaller using its bottom-right drag handle.
  4. Confirm the results grid always fills the modal body without
    overflowing into the footer buttons, at both default and resized
    modal heights.

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

@dosubot dosubot Bot added the dashboard:design Related to the Dashboard UI/UX label Aug 24, 2026
@bito-code-review

bito-code-review Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #de4f11

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

Documentation & Help

AI Code Review powered by Bito Logo

Comment on lines +91 to +95
<Tabs
fullHeight
activeKey={activeTabKey}
onChange={setActiveTabKey}
items={items}

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.

Suggestion: When the number of panes decreases, activeTabKey can still reference a removed tab such as results 2. Since this component now passes that stale key to Tabs, no item is active and the dashboard results area renders blank. Reconcile the active key with resultsPanes and fall back to ResultTypes.Results, as the sibling DataTablesPane does. [incorrect condition logic]

Severity Level: Major ⚠️
- ❌ Chart Data modal can render blank after result panes shrink.
- ⚠️ Mixed and dynamic-query charts can lose remaining results.

Use CodeAnt Skill

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx
**Line:** 91:95
**Comment:**
	*Incorrect Condition Logic: When the number of panes decreases, `activeTabKey` can still reference a removed tab such as `results 2`. Since this component now passes that stale key to `Tabs`, no item is active and the dashboard results area renders blank. Reconcile the active key with `resultsPanes` and fall back to `ResultTypes.Results`, as the sibling `DataTablesPane` does.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@bito-code-review

Copy link
Copy Markdown
Contributor

The flagged issue is correct. When the number of result panes decreases, the activeTabKey can point to a key that no longer exists in the items array, causing the Tabs component to render blank. To resolve this, you should validate that activeTabKey exists in the current items and fall back to a default key (e.g., ResultTypes.Results) if it does not.

Here is a suggested fix:

  const activeKeyExists = items.some(item => item.key === activeTabKey);
  const safeActiveKey = activeKeyExists ? activeTabKey : ResultTypes.Results;

  return (
    <Wrapper>
      <Tabs
        fullHeight
        activeKey={safeActiveKey}
        onChange={setActiveTabKey}
        items={items}
      />
    </Wrapper>
  );

There are no other comments on this PR to address. Would you like me to perform any other analysis?

superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx

const activeKeyExists = items.some(item => item.key === activeTabKey);
  const safeActiveKey = activeKeyExists ? activeTabKey : ResultTypes.Results;

  return (
    <Wrapper>
      <Tabs
        fullHeight
        activeKey={safeActiveKey}
        onChange={setActiveTabKey}
        items={items}
      />
    </Wrapper>
  );

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.86%. Comparing base (c3ed8b3) to head (fd07663).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #43454   +/-   ##
=======================================
  Coverage   78.86%   78.86%           
=======================================
  Files        2876     2876           
  Lines      164601   164601           
  Branches    38015    38015           
=======================================
  Hits       129806   129806           
  Misses      32348    32348           
  Partials     2447     2447           
Flag Coverage Δ
javascript 74.21% <ø> (ø)

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.

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

Height chain resolves after this change, and the Explore pane is unaffected since SouthPane already sets .ant-tabs-content.

<Wrapper>
<Tabs activeKey={activeTabKey} onChange={setActiveTabKey} items={items} />
<Tabs
fullHeight

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.

fullHeight already emits height: 100% on .ant-tabs and .ant-tabs-body, which Wrapper also hardcodes at L31-37 — drop those two rules? .ant-tabs-content was the only missing link.

activeKey={activeTabKey}
onChange={setActiveTabKey}
items={items}
/>

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.

Worth a toHaveStyleRule('height', '100%', { target: '.ant-tabs-content' }) here so removing fullHeight fails loudly? The fix is one prop with no jsdom-observable behavior.

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

Labels

dashboard:design Related to the Dashboard UI/UX size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants