microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.97k stars 28.77k forks source link

ChatResponseCommandButtonPart's should have a way to signal they've been 'used' #210765

Open connor4312 opened 5 months ago

connor4312 commented 5 months ago

Because panel chat does not support diffs natively, I have a button to "Apply Changes" that applies the workspace edit when a model has changes to make.

However, after this is done, the button stays there and can be clicked again, which is likely to just lead to confusion since applying edits again will corrupt the file. It would be nice if there was a way in the API to make the button disabled and/or change text after the command it references has been executed.

jrieken commented 5 months ago

Because panel chat does not support diffs natively,

👀 I have something for you

Screenshot 2024-04-19 at 14 21 31

For panel chat, the response stream supports to emit text edits and they get rendered with an embedded text editor

connor4312 commented 5 months ago

Adopted! Will leave this open for you in case you want to take this issue otherwise.

jrieken commented 5 months ago

Lets turn this into "command button" should support enable when-condition, e.g when disabled it renders different and it is then up to extensions to set the context key properly

connor4312 commented 5 months ago

Would that lead to extensions leaking context keys if they have to have a different when-clause key for each response?

connor4312 commented 5 days ago

another request for this: https://github.com/microsoft/vscode-copilot/issues/8574