-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Tooltip collision fix #1098
base: main
Are you sure you want to change the base?
Tooltip collision fix #1098
Conversation
Summary by CodeRabbit
WalkthroughThis pull request updates the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
frontend/src/components/ContributorAvatar.tsx (1)
43-43
: Good fix, but consider further improvements for ID formatting.The change appropriately enhances the tooltip ID's uniqueness by incorporating the repository information, which should effectively prevent collisions as mentioned in the PR description. The tooltip can now distinguish between contributors with the same login but from different repositories.
However, note that the
repositoryInfo
variable (defined on lines 36-39) includes spaces and potentially special characters (e.g.,in Project Name
). While this works, consider using a more ID-friendly format for better HTML practices:- id={`avatar-tooltip-${login}-${uniqueKey}-${repositoryInfo}`} + id={`avatar-tooltip-${login}-${uniqueKey}${repositoryInfo ? `-${(contributor as TopContributorsTypeGraphql).projectName?.replace(/\s+/g, '-')}` : ''}`}This would format project names by replacing spaces with hyphens for cleaner IDs.
Resolves #1065
The previous implementation was working but in certain cases it has the possibility of having a collision. Thus added one more variable that is the repo info to make it prone to the collisions!