Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tooltip performances #9930

Merged
merged 1 commit into from
Jan 30, 2025
Merged

Fix tooltip performances #9930

merged 1 commit into from
Jan 30, 2025

Conversation

charlesBochet
Copy link
Member

@charlesBochet charlesBochet commented Jan 30, 2025

Rendering the Tooltip is creating performance issues on the whole app.

In this PR we only render the tooltip on hover

Copy link
Contributor

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

PR Summary

This PR optimizes tooltip performance by improving DOM rendering and visibility control in the tooltip components.

  • Added shouldRenderTooltip state in /packages/twenty-ui/src/display/tooltip/OverflowingTextWithTooltip.tsx to conditionally render tooltip portal only when needed
  • Added isOpen prop in /packages/twenty-ui/src/display/tooltip/AppTooltip.tsx for better visibility control
  • Removed unnecessary DOM elements by unmounting tooltip when not in use instead of just hiding it
  • Improved performance by preventing constant re-renders of hidden tooltip elements

2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

<AppTooltip
anchorSelect={`#${textElementId}`}
offset={5}
hidden={!isTitleOverflowing || hideTooltip}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: The hidden prop is redundant since we're already conditionally rendering the portal. Consider removing it.

@charlesBochet charlesBochet merged commit ae4bf8d into main Jan 30, 2025
29 checks passed
@charlesBochet charlesBochet deleted the fix-tooltip-perfs branch January 30, 2025 11:37
eliezer-rodrigues037 pushed a commit to mind-developer/kvoip-v2 that referenced this pull request Jan 30, 2025
Rendering the Tooltip is creating performance issues on the whole app.

In this PR we only render the tooltip on hover
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.

1 participant