Skip to content

Conversation

@fhennig
Copy link
Contributor

@fhennig fhennig commented Oct 28, 2025

resolves #984, resolves #981

Summary

Adds a new PortalTooltip that 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

  • All necessary documentation has been adapted.
  • The implemented feature is covered by an appropriate test.

@vercel
Copy link

vercel bot commented Oct 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
dashboard-components Ready Ready Preview Comment Oct 29, 2025 11:24am

@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2025

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

  • components: always mount tooltip, but keep invisible when not hovered (bf26296)
  • components: don't init top/left (83887cb)
  • components: simplify (90f1270)
  • components: use digit grouping separators in dropdown filter counts (#1013) (c03206a)

Bug Fixes

  • components: mutations-over-time tooltip overflow without scroll (77704f1)
  • components: react -> preact typo (cd96f91)

@fhennig fhennig self-assigned this Oct 28, 2025
@fhennig fhennig force-pushed the mot-tooltip-portal-2nd-attempt branch from 2eb75d5 to 81872e8 Compare October 28, 2025 11:00
@fhennig fhennig force-pushed the mot-tooltip-portal-2nd-attempt branch from 81872e8 to 727f787 Compare October 28, 2025 11:05
@fhennig fhennig force-pushed the mot-tooltip-portal-2nd-attempt branch from 727f787 to f0598ff Compare October 28, 2025 11:07
@fhennig fhennig force-pushed the mot-tooltip-portal-2nd-attempt branch from f0598ff to 4d933aa Compare October 28, 2025 11:23
@fhennig fhennig force-pushed the mot-tooltip-portal-2nd-attempt branch from 4d933aa to 33a0d8a Compare October 28, 2025 11:31
@fhennig fhennig force-pushed the mot-tooltip-portal-2nd-attempt branch from 33a0d8a to 5995412 Compare October 28, 2025 13:16
@fhennig fhennig force-pushed the mot-tooltip-portal-2nd-attempt branch from 5995412 to 13f205d Compare October 28, 2025 13:28
@fhennig fhennig marked this pull request as ready for review October 28, 2025 13:37
Copy link
Collaborator

@fengelniederhammer fengelniederhammer left a 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?

Copy link
Contributor

Copilot AI left a 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 PortalTooltip component that uses portals and fixed positioning to escape overflow constraints
  • Added tooltipPortalTarget refs in both wastewater and standard mutations-over-time components to specify where tooltips should render
  • Refactored the existing Tooltip component 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.

Copy link
Collaborator

@fengelniederhammer fengelniederhammer left a 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.

@fhennig fhennig merged commit dae6798 into main Oct 30, 2025
7 checks passed
@fhennig fhennig deleted the mot-tooltip-portal-2nd-attempt branch October 30, 2025 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mutations over time: tooltip not shown completely for few rows mutations over time: fix scroll overflow

3 participants