Skip to content

Commit 6267707

Browse files
author
aheizi
committed
fix: switch mode state
1 parent bf77f46 commit 6267707

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,12 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
973973
const allModes = getAllModes(customModes)
974974
const currentModeIndex = allModes.findIndex((m) => m.slug === mode)
975975
const nextModeIndex = (currentModeIndex + 1) % allModes.length
976+
// Update local state and notify extension to sync mode change
976977
setMode(allModes[nextModeIndex].slug)
978+
vscode.postMessage({
979+
type: "mode",
980+
text: allModes[nextModeIndex].slug,
981+
})
977982
}, [mode, setMode, customModes])
978983

979984
// Add keyboard event handler

0 commit comments

Comments
 (0)