Skip to content

Comments

fix(dashboard): fix dashboard header overflow issue#35989

Closed
bsovran wants to merge 1 commit intoapache:masterfrom
bsovran:fix/fix-dashboard-header-overflow
Closed

fix(dashboard): fix dashboard header overflow issue#35989
bsovran wants to merge 1 commit intoapache:masterfrom
bsovran:fix/fix-dashboard-header-overflow

Conversation

@bsovran
Copy link
Contributor

@bsovran bsovran commented Nov 4, 2025

SUMMARY

Fixed horizontal overflow issue in dashboard headers when the vertical native filter bar is open or closed. Previously, the dashboard header used a fixed max-width: 100vw which didn't account for the filter bar width, causing tab content and other header elements to extend beyond the viewport and create horizontal scrollbars.

Key Changes:

  • Updated StyledHeader component to dynamically calculate max-width based on filter bar state
  • Uses existing constants (OPEN_FILTER_BAR_WIDTH: 260px, CLOSED_FILTER_BAR_WIDTH: 32px) for consistency

Behavior:

  • Vertical filter bar open: max-width: calc(100vw - 260px)
  • Vertical filter bar closed: max-width: calc(100vw - 32px)
  • Horizontal filter bar or no filters: max-width: 100vw (unchanged)

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: Dashboard header tabs overflow horizontally when vertical filter bar is present, creating unwanted scrollbars

Screen.Recording.2025-11-04.at.12.08.20.PM.mov

After: Dashboard header content properly constrains within available viewport width, accounting for filter bar space

Screen.Recording.2025-11-04.at.12.05.29.PM.mov

TESTING INSTRUCTIONS

  1. Setup: Navigate to a dashboard with native filters enabled
  2. Test vertical filter bar closed:
    • Ensure vertical filter bar is in collapsed state (32px width)
    • Verify dashboard header/tabs don't overflow horizontally
    • Check that long tab names wrap or truncate appropriately
  3. Test vertical filter bar open:
    • Expand the vertical filter bar (260px width)
    • Verify header content adjusts and stays within viewport bounds
    • Toggle filter bar open/closed and confirm smooth layout transitions
  4. Test horizontal filter bar:
    • Switch to horizontal filter bar orientation
    • Verify max-width: 100vw behavior is preserved (no regression)
  5. Test responsive behavior:
    • Test at various screen sizes (mobile, tablet, desktop)
    • Ensure layout remains stable across different viewport widths
  6. Test edge cases:
    • Dashboards with many long tab names
    • Dashboards with no native filters (should be unchanged)
    • Edit mode with builder panel open

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
Contributor

bito-code-review bot commented Nov 4, 2025

Code Review Agent Run #c9d969

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: e29dc49..e29dc49
    • 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 Default Agent 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 the change:frontend Requires changing the frontend label Nov 4, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Functionality Header uses fixed width instead of actual resized filter bar width ▹ view
Performance Unnecessary recalculation of filter bar width ▹ view
Files scanned
File Path Reviewed
superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Comment on lines +572 to +576
const headerFilterBarWidth = showVerticalFilterBar
? dashboardFiltersOpen
? OPEN_FILTER_BAR_WIDTH // Use default open width for header calculation
: CLOSED_FILTER_BAR_WIDTH
: 0;
Copy link

Choose a reason for hiding this comment

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

Header uses fixed width instead of actual resized filter bar width category Functionality

Tell me more
What is the issue?

The header max-width calculation uses a fixed OPEN_FILTER_BAR_WIDTH instead of the actual dynamic width when the filter bar is resizable.

Why this matters

When users resize the vertical filter bar, the header will still use the default width for its max-width calculation, potentially causing layout issues or incorrect spacing. The header should respond to the actual resized width, not just the default width.

Suggested change ∙ Feature Preview

The header should use the same dynamic width calculation as the filter bar itself. Consider passing the actual adjustedWidth from the ResizableSidebar to the header calculation, or use a shared state/ref to track the current filter bar width that both components can access.

Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

Comment on lines +570 to +576
const showVerticalFilterBar =
showFilterBar && filterBarOrientation === FilterBarOrientation.Vertical;
const headerFilterBarWidth = showVerticalFilterBar
? dashboardFiltersOpen
? OPEN_FILTER_BAR_WIDTH // Use default open width for header calculation
: CLOSED_FILTER_BAR_WIDTH
: 0;
Copy link

Choose a reason for hiding this comment

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

Unnecessary recalculation of filter bar width category Performance

Tell me more
What is the issue?

The filter bar width calculation is performed on every render, even when the dependencies haven't changed.

Why this matters

This causes unnecessary computations on each render cycle, potentially impacting performance in components that re-render frequently, especially when dealing with complex dashboard layouts.

Suggested change ∙ Feature Preview

Wrap the filter bar width calculations in useMemo to memoize the results based on their dependencies:

const { showVerticalFilterBar, headerFilterBarWidth } = useMemo(() => {
  const showVertical = showFilterBar && filterBarOrientation === FilterBarOrientation.Vertical;
  const width = showVertical
    ? dashboardFiltersOpen
      ? OPEN_FILTER_BAR_WIDTH
      : CLOSED_FILTER_BAR_WIDTH
    : 0;
  return { showVerticalFilterBar: showVertical, headerFilterBarWidth: width };
}, [showFilterBar, filterBarOrientation, dashboardFiltersOpen]);
Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

@sadpandajoe
Copy link
Member

@bsovran @LevisNgigi is this the same PR as #35984?

@sadpandajoe sadpandajoe added the review:checkpoint Last PR reviewed during the daily review standup label Nov 4, 2025
@LevisNgigi
Copy link
Contributor

@bsovran @LevisNgigi is this the same PR as #35984?

Yes @sadpandajoe it is similar to #35984

@bsovran
Copy link
Contributor Author

bsovran commented Nov 4, 2025

@bsovran @LevisNgigi is this the same PR as #35984?

This seems to be targeting the same issue. Since the results appear to be the same I am happy to go with the pr opened already.

@LevisNgigi
Copy link
Contributor

@bsovran @LevisNgigi is this the same PR as #35984?

This seems to be targeting the same issue. Since the results appear to be the same I am happy to go with the pr opened already.

Thank you @bsovran

@bsovran
Copy link
Contributor Author

bsovran commented Nov 4, 2025

Closing as a duplicate

@bsovran bsovran closed this Nov 4, 2025
@sadpandajoe sadpandajoe removed the review:checkpoint Last PR reviewed during the daily review standup label Nov 5, 2025
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 size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants