Skip to content

feat(chat-client): open use input prompt for agentic chat and new prompt should st… #1081

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions chat-client/src/client/mynahUi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe('MynahUI', () => {
assert.notCalled(onQuickActionSpy)
assert.calledWith(onChatPromptSpy, { prompt, tabId, context: undefined })
assert.calledWith(addChatItemSpy, tabId, { type: ChatItemType.PROMPT, body: prompt.escapedPrompt })
assert.calledWith(updateStoreSpy, tabId, { loadingChat: true, promptInputDisabledState: true })
assert.calledWith(updateStoreSpy, tabId, { loadingChat: true, promptInputDisabledState: false })
assert.calledWith(addChatItemSpy, tabId, { type: ChatItemType.ANSWER_STREAM })
})

Expand Down Expand Up @@ -127,7 +127,7 @@ describe('MynahUI', () => {
tabId,
})
assert.calledOnce(updateStoreSpy)
assert.calledWith(updateStoreSpy, tabId, { loadingChat: true, promptInputDisabledState: true })
assert.calledWith(updateStoreSpy, tabId, { loadingChat: true, promptInputDisabledState: false })
})
})

Expand Down Expand Up @@ -282,7 +282,7 @@ describe('MynahUI', () => {

sinon.assert.calledOnceWithMatch(updateStoreSpy, tabId, {
loadingChat: true,
promptInputDisabledState: true,
promptInputDisabledState: false,
})
})
})
Expand Down
3 changes: 2 additions & 1 deletion chat-client/src/client/mynahUi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const handleChatPrompt = (
_eventId?: string
) => {
let userPrompt = prompt.escapedPrompt
messager.onStopChatResponse(tabId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this affect regular chat too? maybe that's ok

Copy link
Contributor Author

@ashishrp-aws ashishrp-aws Apr 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not affect user experience in anyway and any token cancellation is fine. but yeah added here, so the new user prompt kickstarts stop UI changes.

if (prompt.command) {
// Temporary solution to handle clear quick actions on the client side
if (prompt.command === '/clear') {
Expand Down Expand Up @@ -124,7 +125,7 @@ export const handleChatPrompt = (
// Set UI to loading state
mynahUi.updateStore(tabId, {
loadingChat: true,
promptInputDisabledState: true,
promptInputDisabledState: false,
})

// Create initial empty response
Expand Down
Loading