Skip to content

Commit bcdd9a2

Browse files
authored
fix(chat-client): fix bug where pair programmer mode option update was not stored properly (#1400)
`OnPromptInputOptionChange` event when the agentic mode button is toggled on and off, the mynahUI store was not updated properly to store the updated value. This resulted in "insert to cursor" option being disabled/hidden in a codeblock shown in an agentic mode OFF response. Solution With this change, on prompt option change event, the MynahUi store is now updated to preserve the latest value of "pair-programmer-mode" option. I verified the insert to cursor option now appears on toggle
1 parent 6bf21e5 commit bcdd9a2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

chat-client/src/client/mynahUi.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,18 @@ export const handlePromptInputChange = (mynahUi: MynahUI, tabId: string, options
9191

9292
if (promptTypeValue != null) {
9393
mynahUi.addChatItem(tabId, promptTypeValue === 'true' ? pairProgrammingModeOn : pairProgrammingModeOff)
94+
const options = [...(mynahUi.getTabData(tabId)?.getStore()?.promptInputOptions || [])]
95+
const optionIndex = options.findIndex(opt => opt.id === 'pair-programmer-mode')
96+
97+
if (optionIndex >= 0) {
98+
options[optionIndex].value = promptTypeValue
99+
} else {
100+
options.push({
101+
id: 'pair-programmer-mode',
102+
value: promptTypeValue,
103+
} as any)
104+
}
105+
mynahUi.updateStore(tabId, { promptInputOptions: options as any })
94106
}
95107
}
96108

0 commit comments

Comments
 (0)