Merge pull request #1332 from aheizi/fix_switch_mode

fix: switch mode state
This commit is contained in:
Matt Rubens 2025-03-03 01:55:35 -05:00 committed by GitHub
commit 9faed0e0dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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