Skip to content

Comments

feat: Implement single-open behavior for GitHubIssuePreviewTooltip, e…#1038

Open
prath47 wants to merge 2 commits intogeneralaction:mainfrom
prath47:fix-1005
Open

feat: Implement single-open behavior for GitHubIssuePreviewTooltip, e…#1038
prath47 wants to merge 2 commits intogeneralaction:mainfrom
prath47:fix-1005

Conversation

@prath47
Copy link
Contributor

@prath47 prath47 commented Feb 22, 2026

fix: #1005

This PR includes changes as:

  1. fixed handling of tooltip of github issues (it was getting closed ass soon as we remove the cursor from it)

Checks Performed:

  1. format
  2. build

…nsuring only one instance is active at a time with controlled hover-based opening and delayed closing.
@vercel
Copy link

vercel bot commented Feb 22, 2026

@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-apps
Copy link

greptile-apps bot commented Feb 22, 2026

Greptile Summary

Fixed 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.

  • Converted from uncontrolled to controlled Radix Tooltip with manual state management
  • Added 300ms delayed closing via scheduleClose() that can be canceled when mouse re-enters
  • Implemented module-level singleton (activeTooltipForceClose) to force-close other tooltip instances
  • Added onMouseEnter/onMouseLeave handlers to both TooltipTrigger and TooltipContent for hover persistence

Confidence Score: 3/5

  • Safe to merge with one logical issue that could cause memory warnings
  • Implementation correctly fixes the tooltip closing issue, but missing timer cleanup on unmount could cause React warnings about state updates on unmounted components. The singleton pattern works correctly, and the delayed closing logic is sound.
  • src/renderer/components/GitHubIssuePreviewTooltip.tsx needs timer cleanup in useEffect

Important Files Changed

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

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

setOpen(false);
};

const stableForceClose = useRef<() => void>(() => latestClose.current());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stableForceClose.current is assigned once but never updated - should be initialized directly without wrapping in a ref

Suggested change
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);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timer cleanup needed - if component unmounts while closeTimer is active, it will still fire and try to update state

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.

[bug]: Not able to hover over modal of extra info about github issues

1 participant