-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: resolve tooltip overflow issue by enabling text wrapping #5101
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
Conversation
- Created StandardTooltip component with consistent 300ms delay - Replaced all native HTML title attributes with StandardTooltip - Updated 40+ component files across the webview - Fixed all test files to work with StandardTooltip - Ensures consistent tooltip behavior throughout the application Note: VSCode activity bar tooltips cannot be customized due to platform limitations
- Set asChild={true} for StandardTooltip components in progress bar sections
- This prevents extra wrapper divs that were breaking the flex layout
- Progress bar now displays correctly with proper width calculations
- Add aria-label to IconButton for accessibility - Extract STANDARD_TOOLTIP_DELAY as a constant - Move TooltipProvider to app level for better performance - Enhance StandardTooltip documentation with examples - Update all test files to use custom test utils with TooltipProvider
- Add collisionPadding and avoidCollisions props to TooltipContent - This ensures tooltips automatically reposition when they would overflow the container
- Move collisionPadding and avoidCollisions to base TooltipContent component - This ensures all tooltips in the app respect viewport boundaries - Remove duplicate props from StandardTooltip
- Remove overflow-hidden class from TooltipContent that prevented wrapping - Add max-w-[300px] and break-words classes for proper text wrapping - Add optional maxWidth prop to StandardTooltip for customization - Add comprehensive tests for tooltip behavior Addresses feedback from PR #5098 where tooltips were extending beyond the plugin viewport boundaries when content was too wide.
|
We have finished reviewing your PR. We have found no vulnerabilities. Reply to this PR with |
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.
Pull Request Overview
This PR fixes tooltip overflow by enabling text wrapping and providing a customizable tooltip API.
- Removed the
overflow-hiddenconstraint and added wrapping styles (max-w-[300px],break-words) to tooltip content - Introduced a
StandardTooltipcomponent with an optionalmaxWidthprop for consistent delays and custom sizing - Updated tests to use a custom render wrapper (
test-utils.tsx) that includes theTooltipProvider
Reviewed Changes
Copilot reviewed 85 out of 85 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| webview-ui/src/utils/test-utils.tsx | Added customRender wrapper with TooltipProvider for tests |
| webview-ui/src/components/ui/tooltip.tsx | Removed overflow-hidden, added collision handling and wrapping |
| webview-ui/src/components/ui/standard-tooltip.tsx | Created StandardTooltip with maxWidth prop and default delay |
| webview-ui/src/components/ui/select-dropdown.tsx | Wrapped dropdown trigger in StandardTooltip when title is set |
Comments suppressed due to low confidence (2)
webview-ui/src/components/chat/CodebaseSearchResult.tsx:27
- Wrapping a non-interactive in a tooltip makes it unreachable for keyboard and screen reader users. Consider making the element focusable (e.g., convert to a or add tabIndex and aria-describedby) so assistive technologies can trigger and announce the tooltip.
<StandardTooltip content={`Score: ${score.toFixed(2)}`}>
webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx:51
- Icon-only buttons wrapped in
StandardTooltiplack an accessible name for screen readers. Add anaria-labelor visually hidden text to the<Button>so that its purpose is clear to all users.
<StandardTooltip content={t("chat:checkpoint.menu.viewDiff")}>
Description
Addresses feedback from PR #5098 regarding tooltips extending beyond the plugin viewport boundaries when content is too wide.
Changes Made
overflow-hiddenclass fromTooltipContentcomponent that was preventing text from wrappingmax-w-[300px]andbreak-wordsclasses to ensure tooltips wrap properly within a reasonable widthmaxWidthprop toStandardTooltipcomponent to allow customization of maximum tooltip width when neededTesting
Verification of Fix
maxWidthpropChecklist
Screenshots/Demo
Before: Tooltips with long content would extend beyond the plugin viewport edge
After: Tooltips now wrap text within a maximum width of 300px (or custom width if specified)
Important
Fixes tooltip overflow by enabling text wrapping and adds customizable width with comprehensive tests.
overflow-hiddenclass fromTooltipContentto allow text wrapping.max-w-[300px]andbreak-wordsclasses for text wrapping.maxWidthprop inStandardTooltipfor customizable tooltip width.StandardTooltipinstandard-tooltip.tsxto supportmaxWidth.StandardTooltipacross various components likeChatTextArea,ChatView, andCodebaseSearchResult.tooltip.spec.tsxfor tooltip rendering and behavior.test-utils.tsxto includeTooltipProvider.@/utils/test-utilsfor consistent tooltip behavior.This description was created by
for fd9211a. You can customize this summary. It will automatically update as commits are pushed.