Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Jun 25, 2025

Description

Addresses feedback from PR #5098 regarding tooltips extending beyond the plugin viewport boundaries when content is too wide.

Changes Made

  • Removed overflow-hidden class from TooltipContent component that was preventing text from wrapping
  • Added text wrapping styles with max-w-[300px] and break-words classes to ensure tooltips wrap properly within a reasonable width
  • Added optional maxWidth prop to StandardTooltip component to allow customization of maximum tooltip width when needed
  • Created comprehensive tests for tooltip behavior including text wrapping, custom widths, and proper rendering

Testing

  • All existing tests pass (494 tests)
  • Added new test suite for tooltip components with 5 test cases
  • Manual testing completed:
    • Verified tooltips now wrap text instead of extending beyond viewport
    • Tested with various content lengths
    • Confirmed custom maxWidth prop works as expected
    • Verified tooltips still appear correctly with short content

Verification of Fix

  • Tooltips no longer extend beyond the plugin viewport edge
  • Long tooltip content now wraps within a 300px maximum width by default
  • Custom maximum widths can be set when needed via the maxWidth prop
  • Existing tooltip functionality (delays, positioning, etc.) remains unchanged

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Comments added for complex logic (prop documentation)
  • No breaking changes
  • Tests added for new functionality
  • All tests passing
  • Linting checks pass
  • Type checking passes

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.

  • Behavior:
    • Removed overflow-hidden class from TooltipContent to allow text wrapping.
    • Added max-w-[300px] and break-words classes for text wrapping.
    • Introduced maxWidth prop in StandardTooltip for customizable tooltip width.
  • Components:
    • Updated StandardTooltip in standard-tooltip.tsx to support maxWidth.
    • Applied StandardTooltip across various components like ChatTextArea, ChatView, and CodebaseSearchResult.
  • Testing:
    • Added tests in tooltip.spec.tsx for tooltip rendering and behavior.
    • Updated test utilities in test-utils.tsx to include TooltipProvider.
    • Modified existing tests to use @/utils/test-utils for consistent tooltip behavior.

This description was created by Ellipsis for fd9211a. You can customize this summary. It will automatically update as commits are pushed.

- 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.
Copilot AI review requested due to automatic review settings June 25, 2025 04:23
@hannesrudolph hannesrudolph requested review from cte, jr and mrubens as code owners June 25, 2025 04:23
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. bug Something isn't working labels Jun 25, 2025
@delve-auditor
Copy link

delve-auditor bot commented Jun 25, 2025

We have finished reviewing your PR. We have found no vulnerabilities.

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

Copy link
Contributor

Copilot AI left a 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-hidden constraint and added wrapping styles (max-w-[300px], break-words) to tooltip content
  • Introduced a StandardTooltip component with an optional maxWidth prop for consistent delays and custom sizing
  • Updated tests to use a custom render wrapper (test-utils.tsx) that includes the TooltipProvider

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 StandardTooltip lack an accessible name for screen readers. Add an aria-label or visually hidden text to the <Button> so that its purpose is clear to all users.
				<StandardTooltip content={t("chat:checkpoint.menu.viewDiff")}>

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 25, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jun 25, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 25, 2025
@hannesrudolph hannesrudolph deleted the fix/tooltip-overflow-issue branch June 25, 2025 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants