Skip to content

fix image rendering, use paste provider#229779

Merged
justschen merged 17 commits intomicrosoft:mainfrom
justschen:justin/ninetails
Oct 7, 2024
Merged

fix image rendering, use paste provider#229779
justschen merged 17 commits intomicrosoft:mainfrom
justschen:justin/ninetails

Conversation

@justschen
Copy link
Copy Markdown
Collaborator

@justschen justschen commented Sep 25, 2024

this moves chatImagePaste content into chatPasteProvider which is invoked on paste.

fixes #229625 and https://github.com/microsoft/vscode-copilot/issues/8637

cc. @benibenj

paste:

Screen.Recording.2024-09-25.at.4.21.11.PM.mov

dnd:

secondone.mov

Copy link
Copy Markdown
Contributor

@benibenj benibenj left a comment

Choose a reason for hiding this comment

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

FYI, in this case you can use the ChatContextAttachments contribution which also takes care of duplicates. We are not able to use it for chat dnd sadly.

Comment thread src/vs/workbench/contrib/chat/browser/chatPasteProviders.ts Outdated
@justschen justschen marked this pull request as ready for review September 30, 2024 18:35
@vs-code-engineering vs-code-engineering bot added this to the October 2024 milestone Sep 30, 2024
Comment thread src/vs/workbench/contrib/chat/browser/chatPasteProviders.ts Outdated
}

const attachContribution = widget.getContrib<ChatContextAttachments>(ChatContextAttachments.ID);
attachContribution?.setContext(false, imageContext);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

provideDocumentPasteEdits should not have any side effects. Maybe ok as a temporary workaround for now but let's look into allowing workspace edits to add attachments to chat. That way undo/redo will work nicely too

Comment thread src/vs/workbench/contrib/chat/browser/chatInputPart.ts
Comment thread src/vs/workbench/contrib/chat/browser/chatPasteProviders.ts Outdated
Comment thread src/vs/workbench/contrib/chat/browser/chatPasteProviders.ts
mjbvz
mjbvz previously approved these changes Oct 7, 2024
Copy link
Copy Markdown
Collaborator

@mjbvz mjbvz left a comment

Choose a reason for hiding this comment

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

Approving for continued iteration but please make sure to follow up about using workspace edits

@justschen justschen enabled auto-merge (squash) October 7, 2024 21:30
@justschen justschen merged commit 74b40c2 into microsoft:main Oct 7, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Nov 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delay when pasting in large image.

4 participants