-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Hold Shift and drag tabs into the input box to add references. #2512
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
|
|
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. |
mrubens
left a comment
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.
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. |
|
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. |
|
By the way, I referred to this Cline's PR cline/cline#2676 |
|
I think I found a simpler way to leverage the drag-and-drop we have from the explorer: #2698 |
Brilliant!!! |
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
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.
getMentionPathsFromUriscase inwebviewMessageHandler.tsto convert URIs to mention paths usinguriToMentionPath().mentionPathsResponseinChatTextArea.tsxto insert mention paths into the text area.GetMentionPathsFromUrisMessageandMentionPathsResponseMessageinterfaces inWebviewMessage.ts.ExtensionMessage.tsto includementionPathsResponsetype.uriToMentionPath()inpathUtils.tsto convert URIs to mention-friendly paths relative to the workspace.ChatTextArea.tsxto handle drag-and-drop of URIs, sendinggetMentionPathsFromUrismessage, and processingmentionPathsResponse.This description was created by
for 99de283. It will automatically update as commits are pushed.