Skip to content

fix(dashboard): restore spacing for charts inside Tabs layout#38729

Open
Mayankaggarwal8055 wants to merge 2 commits intoapache:masterfrom
Mayankaggarwal8055:fix/tabs-chart-spacing-clean-2
Open

fix(dashboard): restore spacing for charts inside Tabs layout#38729
Mayankaggarwal8055 wants to merge 2 commits intoapache:masterfrom
Mayankaggarwal8055:fix/tabs-chart-spacing-clean-2

Conversation

@Mayankaggarwal8055
Copy link
Copy Markdown
Contributor

@Mayankaggarwal8055 Mayankaggarwal8055 commented Mar 18, 2026

User description

Charts inside Tabs layout lose spacing due to .dashboard-component-chart-holder
using default content-box sizing with padding, causing overflow and collapsing spacing between charts.

What does this PR do?

Adds box-sizing: border-box to .dashboard-component-chart-holder
so padding is included within the container width.

Why is this needed?

Without this, chart containers overflow their allocated space, leading to
visual overlap and loss of spacing, especially noticeable inside Tabs layout.

Testing

  • Verified charts inside Tabs now maintain proper spacing
  • No regressions observed in Rows and Columns layouts

Related

Closes #38709


CodeAnt-AI Description

Restore chart spacing in tabbed dashboards and keep faded charts outlined

What Changed

  • Chart containers in Tabs now keep their padding inside the available space, preventing charts from overflowing or crowding each other
  • Charts in the faded-out state now keep a subtle outline instead of losing their border styling completely

Impact

✅ Clearer chart spacing in tabbed dashboards
✅ Fewer chart overlap issues in Tabs
✅ More consistent chart states while switching dashboards

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Mar 18, 2026

Code Review Agent Run #4a1d13

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 5896287..5896287
    • superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.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

@codeant-ai-for-open-source codeant-ai-for-open-source bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Mar 18, 2026
@dosubot dosubot bot added the dashboard:component Related to the drag&drop components of the Dashboard label Mar 18, 2026
@codeant-ai-for-open-source
Copy link
Copy Markdown
Contributor

Sequence Diagram

This PR updates the chart holder style in DashboardBuilder so padding is included in width calculations. The change prevents overflow in Tabs layouts and keeps consistent spacing between charts.

sequenceDiagram
    participant User
    participant DashboardUI
    participant ChartHolderStyle
    participant BrowserLayout

    User->>DashboardUI: Open dashboard tab
    DashboardUI->>ChartHolderStyle: Render chart holder with border box sizing
    ChartHolderStyle->>BrowserLayout: Compute width including padding
    BrowserLayout-->>DashboardUI: Return non overflowing chart layout
    DashboardUI-->>User: Show charts with preserved spacing
Loading

Generated by CodeAnt AI

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Restores consistent spacing for dashboard charts placed inside a Tabs layout by ensuring chart-holder padding is included in width calculations (avoiding overflow that collapses inter-chart spacing).

Changes:

  • Add box-sizing: border-box to .dashboard-component-chart-holder styling so width: 100% includes padding.

@codeant-ai-for-open-source codeant-ai-for-open-source bot added size:XS This PR changes 0-9 lines, ignoring generated files and removed size:XS This PR changes 0-9 lines, ignoring generated files labels Mar 26, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 26, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit b9712fc
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69c4f252f771a90008529b10
😎 Deploy Preview https://deploy-preview-38729--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@Mayankaggarwal8055
Copy link
Copy Markdown
Contributor Author

Mayankaggarwal8055 commented Mar 26, 2026

Hi @hainenber @msyavuz @michael-s-molina , I’ve addressed the issue.

I verified the behavior in both cases:

  • With Tabs (before fix): charts appear visually merged and spacing is not clearly distinguishable.
  • After applying the fix: spacing is preserved correctly and charts are clearly separated.

I’ve attached before and after screenshots below for reference to highlight the difference.

Please let me know if any further changes or improvements are needed.

Before:

Screenshot 2026-03-26 115423

after:

Screenshot 2026-03-26 141849

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Mar 26, 2026

Code Review Agent Run #006e9d

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 5896287..b9712fc
    • superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.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

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

Labels

dashboard:component Related to the drag&drop components of the Dashboard size/XS size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Charts withing "Tabs" layout element ignores spacing

2 participants