You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "bsovran (via GitHub)" <gi...@apache.org> on 2025/11/04 17:10:15 UTC

[PR] fix(dashboard): fix dashboard header overflow issue [superset]

bsovran opened a new pull request, #35989:
URL: https://github.com/apache/superset/pull/35989

   ### 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
   
   https://github.com/user-attachments/assets/52395930-99a5-4279-8200-6eb98c8110fe
   
   **After:** Dashboard header content properly constrains within available viewport width, accounting for filter bar space
   
   https://github.com/user-attachments/assets/c1a2c5df-d30d-464e-84c8-2f3fdc232576
   
   
   
   ### 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
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [X] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(dashboard): fix dashboard header overflow issue [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #35989:
URL: https://github.com/apache/superset/pull/35989#issuecomment-3487120477

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(dashboard): fix dashboard header overflow issue [superset]

Posted by "bsovran (via GitHub)" <gi...@apache.org>.
bsovran commented on PR #35989:
URL: https://github.com/apache/superset/pull/35989#issuecomment-3487571789

   Closing as a duplicate 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(dashboard): fix dashboard header overflow issue [superset]

Posted by "LevisNgigi (via GitHub)" <gi...@apache.org>.
LevisNgigi commented on PR #35989:
URL: https://github.com/apache/superset/pull/35989#issuecomment-3487546154

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(dashboard): fix dashboard header overflow issue [superset]

Posted by "bsovran (via GitHub)" <gi...@apache.org>.
bsovran commented on PR #35989:
URL: https://github.com/apache/superset/pull/35989#issuecomment-3487531676

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(dashboard): fix dashboard header overflow issue [superset]

Posted by "korbit-ai[bot] (via GitHub)" <gi...@apache.org>.
korbit-ai[bot] commented on code in PR #35989:
URL: https://github.com/apache/superset/pull/35989#discussion_r2491382409


##########
superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx:
##########
@@ -561,6 +566,15 @@ const DashboardBuilder = () => {
     ? theme.sizeUnit * 4
     : theme.sizeUnit * 8;
 
+  // Calculate filter bar width for header max-width
+  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;

Review Comment:
   ### Unnecessary recalculation of filter bar width <sub>![category Performance](https://img.shields.io/badge/Performance-4f46e5)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### 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:
   
   ```typescript
   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](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/6a89a7a5-7f8e-435a-8b7e-9239003dd2d7/upvote) [![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/6a89a7a5-7f8e-435a-8b7e-9239003dd2d7?what_not_true=true)  [![Not in Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/6a89a7a5-7f8e-435a-8b7e-9239003dd2d7?what_out_of_scope=true) [![Not in coding standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/6a89a7a5-7f8e-435a-8b7e-9239003dd2d7?what_not_in_standard=true) [![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/6a89a7a5-7f8e-435a-8b7e-9239003dd2d7)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:ddf73927-25e6-4e28-abe1-fbcde74c8170 -->
   
   
   [](ddf73927-25e6-4e28-abe1-fbcde74c8170)



##########
superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx:
##########
@@ -561,6 +566,15 @@ const DashboardBuilder = () => {
     ? theme.sizeUnit * 4
     : theme.sizeUnit * 8;
 
+  // Calculate filter bar width for header max-width
+  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;

Review Comment:
   ### Header uses fixed width instead of actual resized filter bar width <sub>![category Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### 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](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/16c864b3-ca33-46ed-b771-d2bfc060759c/upvote) [![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/16c864b3-ca33-46ed-b771-d2bfc060759c?what_not_true=true)  [![Not in Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/16c864b3-ca33-46ed-b771-d2bfc060759c?what_out_of_scope=true) [![Not in coding standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/16c864b3-ca33-46ed-b771-d2bfc060759c?what_not_in_standard=true) [![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/16c864b3-ca33-46ed-b771-d2bfc060759c)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:dc5d08ce-f981-4f43-b4e0-738916437f8e -->
   
   
   [](dc5d08ce-f981-4f43-b4e0-738916437f8e)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(dashboard): fix dashboard header overflow issue [superset]

Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on PR #35989:
URL: https://github.com/apache/superset/pull/35989#issuecomment-3487499962

   @bsovran @LevisNgigi is this the same PR as https://github.com/apache/superset/pull/35984?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(dashboard): fix dashboard header overflow issue [superset]

Posted by "bsovran (via GitHub)" <gi...@apache.org>.
bsovran closed pull request #35989: fix(dashboard): fix dashboard header overflow issue
URL: https://github.com/apache/superset/pull/35989


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(dashboard): fix dashboard header overflow issue [superset]

Posted by "LevisNgigi (via GitHub)" <gi...@apache.org>.
LevisNgigi commented on PR #35989:
URL: https://github.com/apache/superset/pull/35989#issuecomment-3487519157

   > @bsovran @LevisNgigi is this the same PR as #35984?
   
   Yes @sadpandajoe it is similar to #35984 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org