Replace react-tooltip with AppTooltip in PullRequestItem#17613
Replace react-tooltip with AppTooltip in PullRequestItem#17613bohdansolovie wants to merge 2 commits intotwentyhq:mainfrom
Conversation
- Remove react-tooltip import and unused StyledTooltip component - Use AppTooltip from twenty-ui/display for consistency - Addresses TODO comment in PullRequestItem.tsx
Welcome!
Hello there, congrats on your first PR! We're excited to have you contributing to this project. TODOs/FIXMEs:
|
Greptile OverviewGreptile SummaryThis PR updates The change centralizes tooltip styling/theming via twenty-ui, but the tooltip anchor is still selected via a DOM id derived only from Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant PRList as PullRequests (list)
participant Item as PullRequestItem
participant Anchor as span#date-<key>
participant Tooltip as AppTooltip
PRList->>Item: render(props: {id,url,createdAt,mergedAt,...})
Item->>Item: prNumber = last segment of url
Item->>Anchor: render id="date-${prNumber}" with relative date
Item->>Tooltip: render AppTooltip(anchorSelect="#date-${prNumber}")
Tooltip->>Anchor: querySelector(anchorSelect)
Tooltip-->>PRList: tooltip anchored to matched element
|
|
Hello, @charlesBochet Thanks |
|
@bohdansolovie Have you tried it?
Closing... |
|
Hi, @charlesBochet |
|
Ok, please add a screenshot in this case :) |
| <span id={`date-${prNumber}`}> | ||
| {formatIntoRelativeDate(mergedAt ? mergedAt : createdAt)} | ||
| </span> | ||
| <StyledTooltip | ||
| <AppTooltip | ||
| anchorSelect={`#date-${prNumber}`} |
There was a problem hiding this comment.
Tooltip anchor id collision
id={date-${prNumber}} is only derived from the PR number, so if this component is ever rendered with duplicate prNumber values on the same page, the HTML id will be duplicated and anchorSelect={#date-${prNumber}} will bind to the first matching element (wrong tooltip target). Consider including a guaranteed-unique value (e.g. id prop) in both the id and anchorSelect.

Summary
Replaces
react-tooltipwithAppTooltipfromtwenty-ui/displayin thePullRequestItemcomponent.Changes
react-tooltipimportStyledTooltipstyled componentAppTooltipimport fromtwenty-ui/displayAppTooltipMotivation
This addresses the TODO comment in the file and ensures consistency by using the shared UI component from
twenty-uiinstead of directly importing fromreact-tooltip.AppTooltipis a styled wrapper aroundreact-tooltipthat provides consistent theming and styling across the application.