diff --git a/extensions/vscode/src/extension/VsCodeMessenger.ts b/extensions/vscode/src/extension/VsCodeMessenger.ts index 23669305a3..9f26535c9f 100644 --- a/extensions/vscode/src/extension/VsCodeMessenger.ts +++ b/extensions/vscode/src/extension/VsCodeMessenger.ts @@ -317,6 +317,33 @@ export class VsCodeMessenger { editDecorationManager.clear(); }); + this.onWebview("switchMode", async (msg) => { + const { mode } = msg.data; + if (mode === "agent") { + // Handle agent mode activation + // Reset current window with user confirmation + const userConfirmed = await vscode.window.showInformationMessage( + "Switching to agent mode will reset the current window and cancel the current response generation process. Do you want to continue?", + "Yes", + "No", + ); + + if (userConfirmed !== "Yes") { + return; + } + + // Cancel current response generation process + // Implement the logic to cancel the current response generation process here + + // Apply changes directly to files in agent mode + // Display a progress bar in the chat window with a file name being edited and percentage of edits applied + // Implement the logic to apply changes directly to files and display the progress bar here + } else if (mode === "chat") { + // Handle chat mode activation + // Implement the logic to switch back to chat mode here + } + }); + /** PASS THROUGH FROM WEBVIEW TO CORE AND BACK **/ WEBVIEW_TO_CORE_PASS_THROUGH.forEach((messageType) => { this.onWebview(messageType, async (msg) => { diff --git a/gui/src/components/Footer.tsx b/gui/src/components/Footer.tsx index b2efd221c9..7de5c76f8b 100644 --- a/gui/src/components/Footer.tsx +++ b/gui/src/components/Footer.tsx @@ -1,3 +1,4 @@ +import { useState } from "react"; import { useAppSelector } from "../redux/hooks"; import { selectDefaultModel } from "../redux/slices/configSlice"; import { FREE_TRIAL_LIMIT_REQUESTS } from "../util/freeTrial"; @@ -6,18 +7,105 @@ import FreeTrialProgressBar from "./loaders/FreeTrialProgressBar"; function Footer() { const defaultModel = useAppSelector(selectDefaultModel); + const [mode, setMode] = useState("chat"); + const [editedFiles, setEditedFiles] = useState([]); - if (defaultModel?.provider === "free-trial") { - return ( - + ); } export default Footer;