Skip to content

fix(explore): stop the viz switcher from overflowing the control panel - #42911

Open
verdier wants to merge 1 commit into
apache:masterfrom
verdier:fix/viz-switcher-min-width-overflow
Open

fix(explore): stop the viz switcher from overflowing the control panel#42911
verdier wants to merge 1 commit into
apache:masterfrom
verdier:fix/viz-switcher-min-width-overflow

Conversation

@verdier

@verdier verdier commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

SUMMARY

The wrapper around FastVizSwitcher sets a hard min-width floor of theme.sizeUnit * 72 (288px). That floor does not account for the control panel's own horizontal inset, nor for the gutter taken by its vertical scrollbar — so the panel gains a horizontal scrollbar as soon as it scrolls vertically, which it does on most charts.

Measured on the Explore control panel at its default width:

.ant-tabs-content-holder client width 305px (320px minus the 15px scrollbar gutter)
wrapper min-width 288px, placed 24px from the left edge
total required 312px → 7px of overflow

min() keeps 288px as the preferred floor and gives it up only when the container cannot offer that much. Nothing changes where there is room.

-          min-width: ${theme.sizeUnit * 72}px;
+          min-width: min(${theme.sizeUnit * 72}px, 100%);

TESTING INSTRUCTIONS

  1. Open any chart in Explore and make the control panel tall enough to scroll vertically.
  2. Observe the horizontal scrollbar under the controls, and that the panel can be scrolled ~7px sideways.
  3. With this change, the horizontal scrollbar is gone.

Verified in the browser by measuring the container before and after: overflow 7px → 0px. The wrapper settles at 265px and every tile stays legible — the active tile keeps its label, the others keep their icons.

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

The wrapper around `FastVizSwitcher` sets `min-width: ${theme.sizeUnit * 72}px`
(288px) as a hard floor. That floor ignores the control panel's own horizontal
inset and the gutter taken by its vertical scrollbar, so the panel gains a
horizontal scrollbar as soon as it scrolls vertically — which it does on most
charts.

Measured on the Explore control panel at its default width: the tab content
holder offers 305px of client width (320px minus the 15px scrollbar gutter),
while the wrapper asks for 288px placed 24px from the left edge, i.e. 312px.
Seven pixels of overflow, and a scrollbar under every control.

`min()` keeps 288px as the preferred floor and gives it up only when the
container cannot offer that much. Nothing changes where there is room. Where
there is not, the wrapper settles at 265px and every tile stays legible: the
active tile keeps its label, the others their icons.
@dosubot dosubot Bot added change:frontend Requires changing the frontend explore:design Related to the Explore UI/UX labels Aug 8, 2026
@bito-code-review

bito-code-review Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #bda73b

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: be71b1a..be71b1a
    • superset-frontend/src/explore/components/controls/VizTypeControl/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

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.41%. Comparing base (1da7a7f) to head (be71b1a).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #42911      +/-   ##
==========================================
- Coverage   66.41%   66.41%   -0.01%     
==========================================
  Files        2857     2857              
  Lines      161293   161293              
  Branches    37134    37134              
==========================================
- Hits       107124   107117       -7     
- Misses      52144    52151       +7     
  Partials     2025     2025              
Flag Coverage Δ
javascript 73.24% <ø> (-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.

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:design Related to the Explore UI/UX size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant