Skip to content

Commit a8666f7

Browse files
ashishrp-awsopieter-aws
authored andcommitted
feat(chat-client): open use input prompt for agentic chat and new prompt should st… (aws#1081)
feat: open use input prompt for agentic chat and new prompt should stop current response
1 parent 977848c commit a8666f7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

chat-client/src/client/mynahUi.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe('MynahUI', () => {
9898
assert.notCalled(onQuickActionSpy)
9999
assert.calledWith(onChatPromptSpy, { prompt, tabId, context: undefined })
100100
assert.calledWith(addChatItemSpy, tabId, { type: ChatItemType.PROMPT, body: prompt.escapedPrompt })
101-
assert.calledWith(updateStoreSpy, tabId, { loadingChat: true, promptInputDisabledState: true })
101+
assert.calledWith(updateStoreSpy, tabId, { loadingChat: true, promptInputDisabledState: false })
102102
assert.calledWith(addChatItemSpy, tabId, { type: ChatItemType.ANSWER_STREAM })
103103
})
104104

@@ -127,7 +127,7 @@ describe('MynahUI', () => {
127127
tabId,
128128
})
129129
assert.calledOnce(updateStoreSpy)
130-
assert.calledWith(updateStoreSpy, tabId, { loadingChat: true, promptInputDisabledState: true })
130+
assert.calledWith(updateStoreSpy, tabId, { loadingChat: true, promptInputDisabledState: false })
131131
})
132132
})
133133

@@ -282,7 +282,7 @@ describe('MynahUI', () => {
282282

283283
sinon.assert.calledOnceWithMatch(updateStoreSpy, tabId, {
284284
loadingChat: true,
285-
promptInputDisabledState: true,
285+
promptInputDisabledState: false,
286286
})
287287
})
288288
})

chat-client/src/client/mynahUi.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export const handleChatPrompt = (
9090
_eventId?: string
9191
) => {
9292
let userPrompt = prompt.escapedPrompt
93+
messager.onStopChatResponse(tabId)
9394
if (prompt.command) {
9495
// Temporary solution to handle clear quick actions on the client side
9596
if (prompt.command === '/clear') {
@@ -124,7 +125,7 @@ export const handleChatPrompt = (
124125
// Set UI to loading state
125126
mynahUi.updateStore(tabId, {
126127
loadingChat: true,
127-
promptInputDisabledState: true,
128+
promptInputDisabledState: false,
128129
})
129130

130131
// Create initial empty response

0 commit comments

Comments
 (0)