Skip to content

Conversation

@NyxJae
Copy link
Contributor

@NyxJae NyxJae commented Apr 12, 2025

PixPin_2025-04-12_10-34-09.mp4

Context

Implementation

The front-end ChatTextArea.tsx captures the drag-and-drop event to obtain the file URI, then uses useEffect and the pendingInsertions state to trigger sending a getMentionPathsFromUris message to the back-end. The back-end webviewMessageHandler.ts calls uriToMentionPath from pathUtils.ts to convert the URI into Markdown mention format and returns the result to the front-end via the mentionPathsResponse message. Upon receiving the response, the front-end updates the text area and uses requestAnimationFrame to ensure accurate cursor positioning. Communication relies on the VSCode PostMessage API.

Screenshots

before after

How to Test

Get in Touch


Important

Adds URI to mention path conversion and handling in chat text area with new message types and utilities.

  • Behavior:
    • Adds getMentionPathsFromUris case in webviewMessageHandler.ts to convert URIs to mention paths using uriToMentionPath().
    • Handles mentionPathsResponse in ChatTextArea.tsx to insert mention paths into the text area.
  • Messages:
    • Adds GetMentionPathsFromUrisMessage and MentionPathsResponseMessage interfaces in WebviewMessage.ts.
    • Updates ExtensionMessage.ts to include mentionPathsResponse type.
  • Utilities:
    • Adds uriToMentionPath() in pathUtils.ts to convert URIs to mention-friendly paths relative to the workspace.
  • UI:
    • Updates ChatTextArea.tsx to handle drag-and-drop of URIs, sending getMentionPathsFromUris message, and processing mentionPathsResponse.

This description was created by Ellipsis for 99de283. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Apr 12, 2025

⚠️ No Changeset found

Latest commit: 163972b

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 the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 12, 2025
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Apr 12, 2025

After reviewing the changes in this pull request, it appears that all modifications are related to enhancing the handling of URIs and mentions within the application. The changes across different files contribute to a cohesive feature enhancement, focusing on improving messaging and URI conversion. Therefore, it seems appropriate to keep these changes within a single pull request, as they are interconnected and contribute to a unified improvement.

@dosubot dosubot bot added the enhancement New feature or request label Apr 12, 2025
Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome that you got this working! I don't 100% follow all of the changes though. Do you mind giving an overview of how this fits together? Thank you!

@NyxJae
Copy link
Contributor Author

NyxJae commented Apr 12, 2025

Awesome that you got this working! I don't 100% follow all of the changes though. Do you mind giving an overview of how this fits together? Thank you!

The front-end ChatTextArea.tsx captures the drag-and-drop event to obtain the file URI, then uses useEffect and the pendingInsertions state to trigger sending a getMentionPathsFromUris message to the back-end. The back-end webviewMessageHandler.ts calls uriToMentionPath from pathUtils.ts to convert the URI into Markdown mention format and returns the result to the front-end via the mentionPathsResponse message. Upon receiving the response, the front-end updates the text area and uses requestAnimationFrame to ensure accurate cursor positioning. Communication relies on the VSCode PostMessage API.

Sorry, I submitted the PR remotely through my phone to control the computer, so the information was not detailed enough.

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap Apr 14, 2025
@cte
Copy link
Collaborator

cte commented Apr 14, 2025

Very cool @NyxJae - do you mind taking a look at the failing test(s) and the conflicts? I'd love to get this in to the next release.

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Apr 15, 2025
@NyxJae
Copy link
Contributor Author

NyxJae commented Apr 15, 2025

Very cool @NyxJae - do you mind taking a look at the failing test(s) and the conflicts? I'd love to get this in to the next release.

Thank you for your review. Of course, I'm working on fixing it.

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Apr 15, 2025
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Apr 15, 2025
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Apr 15, 2025
@NyxJae
Copy link
Contributor Author

NyxJae commented Apr 15, 2025

By the way, I referred to this Cline's PR cline/cline#2676

@mrubens
Copy link
Collaborator

mrubens commented Apr 17, 2025

I think I found a simpler way to leverage the drag-and-drop we have from the explorer: #2698

@NyxJae
Copy link
Contributor Author

NyxJae commented Apr 17, 2025

I think I found a simpler way to leverage the drag-and-drop we have from the explorer: #2698

Brilliant!!!

@mrubens mrubens closed this Apr 17, 2025
@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap Apr 17, 2025
@NyxJae NyxJae deleted the drag-tab branch April 18, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants