Skip to content

fix(explore): prevent unnecessary scrollbars during chart rendering#39291

Open
massucattoj wants to merge 1 commit intoapache:masterfrom
massucattoj:fix/chart-scrollbars-race-condition
Open

fix(explore): prevent unnecessary scrollbars during chart rendering#39291
massucattoj wants to merge 1 commit intoapache:masterfrom
massucattoj:fix/chart-scrollbars-race-condition

Conversation

@massucattoj
Copy link
Copy Markdown
Contributor

SUMMARY

Charts in the Explore page were occasionally showing unnecessary vertical and horizontal scrollbars on first load, which would disappear after a refresh. This was caused by a race condition in the chart rendering
lifecycle — the ResizeObserver (debounced at 300ms) could report layout dimensions before the container had fully stabilized, causing the chart to momentarily overflow its container.

The chart panel wrapper used overflow: auto, which made these transient dimension mismatches visible as scrollbars. Changing to overflow: hidden prevents this, since charts are always explicitly sized to fit
their container via the width and height props passed to SuperChart.

PS: This fix only applies to the Explore page. The dashboard path was already protected — ChartWrapper in the dashboard grid uses overflow: hidden by default.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Not applicable — this was a race condition that appeared intermittently during chart load. The fix prevents scrollbars from appearing regardless of ResizeObserver timing. Charts should now render without
unnecessary scrollbars on first load.

TESTING INSTRUCTIONS

  1. Navigate to Explore and open any chart (e.g. a line chart)
  2. Observe that no scrollbars appear during initial chart rendering
  3. Resize the browser window while a chart is displayed — confirm no scrollbars flash
  4. Open a dashboard with multiple charts — confirm no scrollbars appear during load
  5. Open the Data Tables pane (Results/Samples) below the chart — confirm it still scrolls correctly

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

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 11, 2026

Code Review Agent Run #a63950

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx - 1
    • Overflow clipping risk · Line 308-308
      Changing overflow to 'hidden' may clip chart content that would otherwise be scrollable with 'auto', potentially hiding parts of visualizations in the explore panel.
      Code suggestion
       @@ -308,1 +308,1 @@
      -          overflow: hidden;
      +          overflow: auto;
Review Details
  • Files reviewed - 1 · Commit Range: 7b2846e..7b2846e
    • superset-frontend/src/explore/components/ExploreChartPanel/index.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

@dosubot dosubot bot added change:frontend Requires changing the frontend explore Namespace | Anything related to Explore labels Apr 11, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.42%. Comparing base (de40b58) to head (7b2846e).

❌ Your project check has failed because the head coverage (99.81%) is below the target coverage (100.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #39291   +/-   ##
=======================================
  Coverage   64.42%   64.42%           
=======================================
  Files        2553     2553           
  Lines      132588   132588           
  Branches    30758    30758           
=======================================
  Hits        85416    85416           
  Misses      45686    45686           
  Partials     1486     1486           
Flag Coverage Δ
javascript 66.11% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Contributor

@jaymasiwal jaymasiwal left a comment

Choose a reason for hiding this comment

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

I pulled this branch locally to test the layout behavior. I specifically kept an eye out for the clipping risk mentioned by the bot above, but everything looks pristine. No content is being clipped since SuperChart handles the explicit sizing, and those annoying transient scrollbars on initial load/resize are completely gone. Great, clean UI fix! 🚀

@msyavuz
Copy link
Copy Markdown
Member

msyavuz commented Apr 15, 2026

Before/after screenshots would be nice

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/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants