Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/providers/chatSidebarProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,26 @@ export class ChatSidebarProvider implements vscode.WebviewViewProvider {
case 'changeProvider':
await this.handleChangeProvider(message.model, webviewView.webview);
break;
case 'addContext':
const options: vscode.OpenDialogOptions = {
canSelectMany: false,
openLabel: 'Select File',
canSelectFiles: true,
canSelectFolders: false
};

vscode.window.showOpenDialog(options).then(fileUri => {
if (fileUri && fileUri[0]) {
webviewView.webview.postMessage({
command: 'contextFromCanvas',
data: {
fileName: fileUri[0].fsPath,
type: 'file'
}
});
}
});
break;
}
}
);
Expand Down
5 changes: 3 additions & 2 deletions src/webview/components/Chat/ChatInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,9 @@ const ChatInterface: React.FC<ChatInterfaceProps> = ({ layout, vscode }) => {
}, [inputMessage]);

const handleAddContext = () => {
// TODO: Implement context addition functionality
console.log('Add Context clicked');
vscode.postMessage({
command: 'addContext'
});
};

const handleNewConversation = () => {
Expand Down