- 
                Notifications
    
You must be signed in to change notification settings  - Fork 0
 
fix(components): mutations-over-time tooltip overflow without scroll #1020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| 
           The latest updates on your projects. Learn more about Vercel for GitHub. 
  | 
    
| 
           This is a preview of the changelog of the next release. If this branch is not up-to-date with the current main branch, the changelog may not be accurate. Rebase your branch on the main branch to get the most accurate changelog. Note that this might contain changes that are on main, but not yet released. Changelog: 1.9.0 (2025-10-29)Features
 Bug Fixes | 
    
2eb75d5    to
    81872e8      
    Compare
  
    81872e8    to
    727f787      
    Compare
  
    727f787    to
    f0598ff      
    Compare
  
    f0598ff    to
    4d933aa      
    Compare
  
    4d933aa    to
    33a0d8a      
    Compare
  
    33a0d8a    to
    5995412      
    Compare
  
    5995412    to
    13f205d      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general 👍
Did you try how it looks on the dashboards?
        
          
                components/src/preact/mutationsOverTime/mutations-over-time-grid.tsx
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                components/src/preact/mutationsOverTime/mutations-over-time.tsx
              
                Outdated
          
            Show resolved
            Hide resolved
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes tooltip overflow issues in the mutations-over-time component by introducing a new PortalTooltip component that renders tooltips outside their parent containers using React portals. This prevents tooltips from being clipped by containers with overflow constraints while maintaining shadow DOM encapsulation.
Key changes:
- Created a new 
PortalTooltipcomponent that uses portals and fixed positioning to escape overflow constraints - Added 
tooltipPortalTargetrefs in both wastewater and standard mutations-over-time components to specify where tooltips should render - Refactored the existing 
Tooltipcomponent to extract shared base styles and added documentation distinguishing the two tooltip implementations 
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description | 
|---|---|
| wastewater-mutations-over-time.tsx | Added tooltipPortalTargetRef and wrapped component in a div to serve as the portal target | 
| mutations-over-time.tsx | Added tooltipPortalTargetRef and wrapped component in a div to serve as the portal target | 
| mutations-over-time-grid.tsx | Updated to use PortalTooltip instead of Tooltip and pass through the portal target prop | 
| tooltip.tsx | Extracted TOOLTIP_BASE_STYLES constant and added documentation explaining when to use PortalTooltip instead | 
| portal-tooltip.tsx | New component implementing portal-based tooltips with dynamic positioning and hover state management | 
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5d0e538    to
    12a9e3d      
    Compare
  
    12a9e3d    to
    53919ac      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try it 👍
I asked some AIs about the ref handling, they didn't have a much better approach either. One suggested to use floating UI instead of manually positioning the tooltips. That might be a little more convenient and we already use floating UI already, but I don't think there is a real need to migrate the tooltips to floating UI now.
resolves #984, resolves #981
Summary
Adds a new
PortalTooltipthat uses a portal internally to position the tooltip. In the mutations-over-time component and the grid, we're passing through an outer div ref where we can render the tooltip to.This fixes the issues, because the tooltip is no longer inside the tab, so it doesn't cause the overflow and scroll bars anymore. The portal is also still inside the shadow DOM, so it doesn't break out of the shadow DOM.
Screenshot
Screen.Recording.2025-10-28.at.11.33.27.mov
PR Checklist
The implemented feature is covered by an appropriate test.