From 62677071e8b27bb4c0bf21eee9f2cbfd46e15568 Mon Sep 17 00:00:00 2001 From: aheizi Date: Mon, 3 Mar 2025 14:44:56 +0800 Subject: [PATCH] fix: switch mode state --- webview-ui/src/components/chat/ChatView.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index fe0dc7e16..3f1d5fd10 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -973,7 +973,12 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie const allModes = getAllModes(customModes) const currentModeIndex = allModes.findIndex((m) => m.slug === mode) const nextModeIndex = (currentModeIndex + 1) % allModes.length + // Update local state and notify extension to sync mode change setMode(allModes[nextModeIndex].slug) + vscode.postMessage({ + type: "mode", + text: allModes[nextModeIndex].slug, + }) }, [mode, setMode, customModes]) // Add keyboard event handler