Conversation
A tooltip that flipped up out of the diff panel toolbar landed inside the titlebar strip, where the OS composites the minimize/maximize/close buttons above every DOM layer. No z-index can win that, so reserve the strip as collision padding and let the tooltip flip down instead.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Warning Your free Security trial is over. An organization admin can activate Security or dismiss this notice. Comment |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a localized desktop tooltip-positioning fix that preserves existing browser behavior while reserving the Electron native titlebar area. The implementation is small, self-contained, and has no schema, security, billing, data, or deployment impact. You can add or adjust custom eligibility rules. Learn more. |
|
Note: GPT-6 on behalf of shivam (@shivamhwp). This conflicts with current main in |
Hovering the line-wrapping toggle in the diff panel toolbar showed its tooltip inside the titlebar strip, where the OS composites the minimize, maximize, and close buttons above every DOM layer. Raising
z-indexcannot win that, because the controls are not part of the page.The tooltip positioner now reserves the window-controls-overlay height as collision padding, so a tooltip that would land in that strip flips below its trigger instead. The height comes from
navigator.windowControlsOverlay.getTitlebarAreaRect()and tracksgeometrychange, so it is 0 in the browser and follows the real strip in Electron. Fixing it in the sharedTooltipPopupcovers every tooltip near the top of the window, not just the one in the report.Fixes #8882
Before / After
Linux, Electron dev build, diff panel open, hovering "Disable line wrapping".
Validation
vp fmt apps/web/src/components/ui/tooltip.tsx apps/web/src/lib/windowControlsOverlay.ts --checkvp lint apps/web/src/components/ui/tooltip.tsx apps/web/src/lib/windowControlsOverlay.ts --report-unused-disable-directivesvp run --filter @t3tools/web typecheckside="top"at y 9.5, inside the strip; after it reportsside="bottom"at y 71.5.Built with Claude Opus 5 in T3 Code.
Note
Low Risk
Localized UI positioning change for tooltips with a safe SSR/default of zero height; no auth, data, or security impact.
Overview
Tooltips near the top of the Electron window no longer render under the OS titlebar controls by treating that strip as a collision boundary on the shared
TooltipPopuppositioner.TooltipPopupnow passes explicitcollisionPaddingto Base UI’s positioner, with extra top padding equal to the window-controls overlay height (on top of the default 5px). When a tooltip would flip above a trigger into that strip, it flips below instead.A new
useWindowControlsOverlayHeighthook inwindowControlsOverlay.tsreadsnavigator.windowControlsOverlay.getTitlebarAreaRect().heightwhen the overlay is visible, subscribes togeometrychange, and returns 0 on the server or when the API is absent—so browser builds are unchanged.Reviewed by Cursor Bugbot for commit 1f5afaa. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Keep tooltips clear of native window controls via overlay-aware collision padding
useWindowControlsOverlayHeighthook in windowControlsOverlay.ts usinguseSyncExternalStoreto track the Window Controls Overlay titlebar height reactively (0 on server or when unavailable)TooltipPopupin tooltip.tsx to pass acollisionPaddingobject whosetopequals a baseCOLLISION_PADDING(5) plus the overlay height, so tooltips flip away from the native titlebar areaMacroscope summarized 1f5afaa.