Skip to content

Conversation

@heyseth
Copy link

@heyseth heyseth commented Oct 23, 2025

Related GitHub Issue

Closes: #8278

Description

This PR fixes the filename truncation issue in file editing/reading notices by adding tooltips that display the full file path on hover.

Implementation details:

  • Added StandardTooltip components wrapping file path displays in three locations:
    • CodeAccordian.tsx - General file path headers and custom headers
    • ChatRow.tsx - Single file read/edit operations
    • BatchFilePermission.tsx - Batch file permission requests
  • Configured tooltips with className="text-wrap max-w-[min(300px,100vw)]" to:
    • Override the default text-balance CSS (which was causing excessive whitespace)
    • Use responsive max-width that adapts to panel size (300px max on wide panels, 100vw on narrow)
    • Leverage existing break-words CSS for natural line breaking at path separators

Key design choices:

  • Chose to use text-wrap instead of text-balance to minimize whitespace while maintaining readability
  • Used max-w-[min(300px,100vw)] instead of a fixed width to prevent tooltip cutoff in narrow panels while maintaining a reasonable max width

Reviewers should note:

  • The tooltip styling is consistent with other tooltips in the extension (using the existing TooltipProvider and StandardTooltip components)

Test Procedure

Manual testing steps:

  1. Test truncated paths show tooltips:

    • Open Roo Code and start a chat session
    • Ask Roo to read or edit a file with a long path (e.g., src/components/chat/file/with/deeply/nested/structure.tsx)
    • Narrow the chat panel until the filename truncates (shows ellipsis)
    • Hover over the truncated filename in the notice
    • ✅ Verify: Tooltip appears showing the full file path
    • ✅ Verify: Tooltip wraps text to multiple lines without being cut off
  2. Test all tooltip locations:

    • Test tooltips on:
      • Single file read operations
      • Single file edit operations
      • Batch file read operations
      • Batch file edit operations
      • Directory listing operations (listFilesTopLevel, listFilesRecursive tools)
      • Search operations (searchFiles, listCodeDefinitionNames tools)
      • ✅ Verify: All locations show tooltips with consistent behavior

Testing environment:

  • Tested on narrow panel widths (200px - 400px)
  • Tested on standard panel widths (400px - 800px)
  • Tested with various file path lengths

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Before: Filename truncated, no tooltip on hover.

before

After: Tooltip on hover.

after

Documentation Updates

  • No documentation updates are required.

Get in Touch

Discord: @ocean.smith


Important

Adds tooltips to display full file paths on truncated filenames in CodeAccordian.tsx, ChatRow.tsx, and BatchFilePermission.tsx, ensuring responsive and consistent styling.

  • Behavior:
    • Adds StandardTooltip to display full file paths on hover for truncated filenames in CodeAccordian.tsx, ChatRow.tsx, and BatchFilePermission.tsx.
    • Tooltips are styled with text-wrap and max-w-[min(300px,100vw)] for responsive width and minimal whitespace.
  • Design:
    • Uses text-wrap instead of text-balance to reduce whitespace.
    • Ensures tooltip width adapts to panel size, preventing cutoff in narrow panels.
  • Consistency:
    • Tooltip styling aligns with existing tooltips using TooltipProvider and StandardTooltip.

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

…tview

Add tooltips that show the complete file path when hovering over truncated
file names in file editing/reading notices throughout the chat interface.

Changes:
- Add StandardTooltip components to file path displays in CodeAccordian,
ChatRow, and BatchFilePermission components
- Override default tooltip styles with `text-wrap` to prevent excessive
whitespace from text-balance behavior
- Use responsive max-width `max-w-[min(300px,100vw)]` to ensure tooltips
adapt to narrow panel widths and prevent content cutoff
- Leverage existing `break-words` CSS to allow natural line breaking at
path separators

The added tooltips:
- Display full file paths even when truncated in the UI
- Wrap text naturally at path separators without excessive whitespace
- Adapt responsively to panel width (max 300px on wide panels, 100vw on narrow)
- Maintain consistent behavior with other tooltips in the extension

Files modified:
- webview-ui/src/components/common/CodeAccordian.tsx
- webview-ui/src/components/chat/ChatRow.tsx
- webview-ui/src/components/chat/BatchFilePermission.tsx
@heyseth heyseth requested review from cte, jr and mrubens as code owners October 23, 2025 23:18
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. UI/UX UI/UX related or focused labels Oct 23, 2025
@roomote
Copy link

roomote bot commented Oct 23, 2025

Issues Found

All previously identified issues have been resolved:

  • BatchFilePermission.tsx line 39: Tooltip only shows file.path but displayed text includes both path and file.lineSnippet (when present)
  • ChatRow.tsx line 604: Tooltip only shows tool.path but displayed text includes both path and tool.reason (when present)

Follow Along on Roo Code Cloud

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 23, 2025
Update StandardTooltip content in BatchFilePermission, ChatRow, and CodeAccordian
to use removeLeadingNonAlphanumeric() and include the same formatting as the
visible text, ensuring tooltips display consistently with what users see.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:M This PR changes 30-99 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] Filename truncated in notice when chat is narrow

2 participants