feat: improve VS Code editor chat actions

Targets active editor chat before falling back to sidebar
Adds session open-in-editor action in the VS Code sidebar
Uses attachment badges for VS Code file and selection context
This commit is contained in:
Bohdan Triapitsyn
2026-05-19 15:53:54 +03:00
parent 25037ccab9
commit c81441ecfc
13 changed files with 389 additions and 30 deletions
+31
View File
@@ -199,6 +199,37 @@ export class ChatViewProvider implements vscode.WebviewViewProvider {
}
}
public addContextSelection(selection: { filePath: string; filename: string; text: string }) {
if (!this._view) {
return;
}
this._view.show(true);
this._view.webview.postMessage({
type: 'command',
command: 'addContextSelection',
payload: selection,
});
}
public addFileAttachments(files: Array<{ filePath: string; fileName: string; fileSize: number | null }>) {
if (!this._view) {
return;
}
const cleanedFiles = files.filter((entry) => entry.filePath.trim().length > 0 && entry.fileName.trim().length > 0);
if (cleanedFiles.length === 0) {
return;
}
this._view.show(true);
this._view.webview.postMessage({
type: 'command',
command: 'addFileAttachments',
payload: { files: cleanedFiles },
});
}
public addFileMentions(paths: string[]) {
if (!this._view) {
return;