Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the NavItemButton component to prevent tooltips from displaying when a navigation item has children. When the navigation is collapsed and a user hovers over an item with children, the sidebar opens to show those children, making a tooltip redundant.
Changes:
- Modified tooltip display logic to exclude items with children when navigation is collapsed
- Updated package version from 1.23.9 to 1.24.0
- Added release note documenting this enhancement
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/components/NavigationBar/NavItemButton.tsx | Added condition to prevent tooltip display for navigation items with children |
| src/stories/ReleaseNotes.stories.tsx | Added release note entry for version 1.24.0 documenting the tooltip enhancement |
| package.json | Bumped package version to 1.24.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| setIsHovered(true); | ||
| // Only show tooltip if navigation is collapsed (text is not visible) | ||
| if (!isExpanded) { | ||
| if (!isExpanded && !hasChildren ) { |
There was a problem hiding this comment.
There's a spacing issue before the closing parenthesis. Remove the extra space before the closing parenthesis for consistent code formatting.
| @@ -186,7 +186,7 @@ const NavItemButton: React.FC<NavItemButtonProps> = ({ | |||
| const handleMouseEnter = () => { | |||
| setIsHovered(true); | |||
| // Only show tooltip if navigation is collapsed (text is not visible) | |||
There was a problem hiding this comment.
The comment should be updated to reflect the new condition. Consider updating it to "Only show tooltip if navigation is collapsed (text is not visible) and item has no children (since children are shown in sidebar)"
| // Only show tooltip if navigation is collapsed (text is not visible) | |
| // Only show tooltip if navigation is collapsed (text is not visible) and item has no children (since children are shown in sidebar) |
Features/notooltipifchildren