8000 Improve file read truncation UX with tooltips and consistent line range notifications by cannuri · Pull Request #3633 · RooCodeInc/Roo-Code · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improve file read truncation UX with tooltips and consistent line range notifications #3633

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cannuri
Copy link
@cannuri cannuri commented May 15, 2025

Description

This PR addresses several issues related to file reading functionality and improves the user experience when working with large files and line range notifications:

Closes #3351

  1. Added tooltips for truncation messages:

    • Before: When a file was truncated due to size limits, there was no tooltip on the truncation message to guide users on how to adjust this setting.
    • Fix: Added an informative tooltip to the info icon next to the truncation message, explaining how to adjust the file read auto-truncate threshold in settings.
    • Implementation: Created the necessary translation infrastructure by adding the missing tools.json files to the webview-ui directory for all supported languages, ensuring consistent translations across both components of the application.
  2. Enhanced readFileTool with improved auto-truncate handling:

    • Before: The wasAutoTruncated flag was not being set correctly, leading to inconsistent UI behavior when files were truncated.
    • Fix: Improved the logic for setting the wasAutoTruncated flag to ensure it's only set when a file is actually truncated due to the maxReadFileLine setting, not when the user explicitly requests a range of lines.
  3. Improved line range notifications:

    • Before: Line range notifications were only displayed in certain conditions based on the maxReadFileLine setting, leading to inconsistent UI feedback.
    • Fix: Modified the readFileTool to always display line range notifications regardless of the maxReadFileLine setting, making the UI more consistent and informative.
  4. Hidden truncation messages for explicit line range reads:

    • Before: Truncation messages were shown even for explicit line range reads, which was confusing since the user had intentionally specified the range.
    • Fix: When users explicitly specify line ranges, the truncation message is now hidden since it's not relevant in those cases.
  5. UI improvements:

    • Enhancement: Added a clear visual indicator (info icon) that additional information is available about file truncation.
    • Enhancement: The tooltip uses variables to reference other translations (settings, context, and threshold), ensuring consistency across the UI and all supported languages.

These changes collectively improve the user experience when working with file content in Roo, making the behavior more intuitive and the UI more informative, especially when dealing with large files or specific line ranges.

Test Procedure

Testing was performed by:

  1. Verifying tooltips display correctly with proper variable substitution in all supported languages
  2. Testing file reading with various configurations:
    • Large files that trigger auto-truncation
    • Files with explicit line range requests (start_line/end_line)
    • Files with different maxReadFileLine settings (0, positive values, -1 for full read)
  3. Confirming line range notifications appear correctly in all scenarios
  4. Running the translation verification script (node scripts/find-missing-translations.js) to ensure all translations are complete
  5. Manual testing in different language settings to verify correct text display

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • ♻️ Refactor Changes
  • 💅 Cosmetic Changes
  • 📚 Documentation update
  • 🏃 Workflow Changes

Pre-flight Checklist

  • Changes are limited to a single feature, bugfix or chore (split larger changes into separate PRs)
  • Tests are passing (npm test) and code is formatted and linted (npm run format && npm run lint)
  • I have created a changeset using npm run changeset (required for user-facing changes)
  • I have reviewed contributor guidelines

Screenshots

BEFORE:
Screenshot 2025-05-15 at 19 21 17

AFTER:
Screenshot 2025-05-15 at 19 22 23

Additional Notes

This PR highlights the importance of maintaining consistent translation namespaces across both the extension and webview components. For future development, we should consider adding an automated check to ensure translation namespaces remain synchronized between the two components to prevent similar issues.

The improvements to line range notifications and truncation handling make the file reading experience more intuitive and consistent for users, especially when working with large files or specific line ranges.


Important

Enhance file read UX with tooltips, consistent line range notifications, and updated translations.

  • Behavior:
    • Added tooltips to truncation messages in ChatRow.tsx to guide users on adjusting file read settings.
    • Improved wasAutoTruncated flag logic in readFileTool() in readFileTool.ts to ensure correct UI behavior.
    • Modified readFileTool() to always display line range notifications.
    • Hidden truncation messages for explicit line range reads in readFileTool.ts.
  • Translations:
    • Added tools.json for all supported languages in webview-ui/src/i18n/locales/ to support new tooltips and messages.
  • Misc:
    • Updated ClineSayTool in ExtensionMessage.ts to include wasAutoTruncated property.

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

Copy link
changeset-bot bot commented May 15, 2025

⚠️ No Changeset found

Latest commit: b93412b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. bug Something isn't working enhancement New feature or request labels May 15, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 16, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from PR [Needs Review] to TEMP in Roo Code Roadmap May 26, 2025
@daniel-lxs daniel-lxs moved this from TEMP to PR [Needs Review] in Roo Code Roadmap May 27, 2025
@hannesrudolph hannesrudolph added Followup Needs followup from support or code team and removed Followup Needs followup from support or code team labels May 27, 2025
@daniel-lxs
Copy link
Collaborator

Hey @cannuri, It seems like something happened when you generated the roo-code.d.ts causing it to remove a lot of types, this should be easy to fix by simply regenerating the file.

Other than that this looks good to me.

@daniel-lxs daniel-lxs moved this from PR [Needs Preliminary Review] to PR [Needs Review] in Roo Code Roadmap May 27, 2025
@daniel-lxs daniel-lxs added PR - Changes Requested and removed Followup Needs followup from support or code team PR - Needs Review labels May 27, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Review] to PR [Changes Requested] in Roo Code Roadmap May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request PR - Changes Requested size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
Status: PR [Changes Requested]
Development

Successfully merging this pull request may close these issues.

Improve UX for file read truncation message
3 participants
0