feat: Implement single-open behavior for GitHubIssuePreviewTooltip, e…#1038
feat: Implement single-open behavior for GitHubIssuePreviewTooltip, e…#1038prath47 wants to merge 2 commits intogeneralaction:mainfrom
Conversation
…nsuring only one instance is active at a time with controlled hover-based opening and delayed closing.
|
@prath47 is attempting to deploy a commit to the General Action Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryFixed tooltip closing immediately on mouse leave by implementing controlled state with delayed closing (300ms) and mouse event handlers on both trigger and content. Added singleton pattern to ensure only one GitHub issue tooltip is open at a time.
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| src/renderer/components/GitHubIssuePreviewTooltip.tsx | Adds controlled tooltip state with delayed closing and singleton pattern to prevent multiple tooltips from being open simultaneously |
Last reviewed commit: 028c732
| setOpen(false); | ||
| }; | ||
|
|
||
| const stableForceClose = useRef<() => void>(() => latestClose.current()); |
There was a problem hiding this comment.
stableForceClose.current is assigned once but never updated - should be initialized directly without wrapping in a ref
| const stableForceClose = useRef<() => void>(() => latestClose.current()); | |
| const stableForceClose = useRef<() => void>(() => { | |
| cancelClose(); | |
| setOpen(false); | |
| }); |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
|
||
| export const GitHubIssuePreviewTooltip: React.FC<Props> = ({ issue, children, side = 'top' }) => { | ||
| const [open, setOpen] = useState(false); | ||
| const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null); |
There was a problem hiding this comment.
Timer cleanup needed - if component unmounts while closeTimer is active, it will still fire and try to update state
fix: #1005
This PR includes changes as:
Checks Performed: