fix(components): correct Tooltip and Popover arrow alignment (DS-5146) - #446
Conversation
|
Warning Review limit reached
Next review available in: 52 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe change adds shared overlay-arrow positioning utilities. Popover and Tooltip use the utilities with locale direction, target references, placement, and boundary offsets. Tests cover geometry, RTL behavior, disabled states, style merging, and component integration. ChangesOverlay arrow alignment
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant PopoverOrTooltip
participant useOverlayArrowStyle
participant DOMGeometry
participant Arrow
PopoverOrTooltip->>useOverlayArrowStyle: pass placement, direction, boundary offset, and refs
useOverlayArrowStyle->>DOMGeometry: measure overlay and target bounds
DOMGeometry-->>useOverlayArrowStyle: return element rectangles
useOverlayArrowStyle-->>PopoverOrTooltip: return positional style
PopoverOrTooltip->>Arrow: render merged arrow style
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Visit the preview URL for this PR (updated for commit 832678f): https://react-koobiq-next--prs-446-ox254izi.web.app (expires Tue, 11 Aug 2026 10:34:19 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: fc29847d4a9e5cb1adf458c76a9b681c76e2eeff |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Pull request overview
Fixes Tooltip/Popover arrow alignment for compound placements by introducing a shared hook that conditionally overrides React Aria’s computed arrow position based on overlay/target geometry and locale direction.
Changes:
- Added
useOverlayArrowStyle(+ unit tests) to compute a stable left/top override for compound placements (including RTL). - Integrated the new hook into
TooltipandPopoverInner, and expanded component tests to validate compound-placement alignment and custom offsets. - Corrected Popover’s documented default
arrowBoundaryOffsetto20and updated the Tooltip public API snapshot accordingly.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/public_api_guard/components/Tooltip.api.md | Updates generated public API snapshot for Tooltip typings. |
| packages/components/src/hooks/useOverlayArrowStyle/useOverlayArrowStyle.ts | New hook + helper to compute/merge arrow positional overrides. |
| packages/components/src/hooks/useOverlayArrowStyle/useOverlayArrowStyle.test.ts | Unit coverage for placement/flip/RTL/offset behavior and merge semantics. |
| packages/components/src/hooks/useOverlayArrowStyle/index.ts | Barrel export for the new hook. |
| packages/components/src/components/Tooltip/Tooltip.tsx | Uses locale direction + new hook to override arrow style when enabled. |
| packages/components/src/components/Tooltip/Tooltip.test.tsx | Adds integration test ensuring compound placement arrow alignment and custom offsets. |
| packages/components/src/components/Popover/types.ts | Documentation fix: default arrowBoundaryOffset is 20. |
| packages/components/src/components/Popover/PopoverInner.tsx | Uses locale direction + new hook; ensures slot arrow style retains highest priority. |
| packages/components/src/components/Popover/Popover.test.tsx | Adds integration tests for compound placement alignment, custom offsets, and slot style priority. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary by CodeRabbit
Enhancements
Documentation