Skip to content

Commit 8046848

Browse files
committed
Fix for stop button for disappearing for subsequent conversations
1 parent 5dac164 commit 8046848

File tree

8 files changed

+9
-14
lines changed

8 files changed

+9
-14
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@
525525
"@aws-sdk/s3-request-presigner": "<3.731.0",
526526
"@aws-sdk/smithy-client": "<3.731.0",
527527
"@aws-sdk/util-arn-parser": "<3.731.0",
528-
"@aws/mynah-ui": "^4.31.0-beta.2",
528+
"@aws/mynah-ui": "^4.31.0-beta.3",
529529
"@gerhobbelt/gitignore-parser": "^0.2.0-9",
530530
"@iarna/toml": "^2.2.5",
531531
"@smithy/fetch-http-handler": "^5.0.1",

packages/core/src/amazonq/webview/ui/followUps/handler.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export class FollowUpInteractionHandler {
4747
if (followUp.prompt !== undefined) {
4848
this.mynahUI.updateStore(tabID, {
4949
loadingChat: true,
50-
cancelButtonWhenLoading: false,
5150
promptInputDisabledState: true,
5251
})
5352
this.mynahUI.addChatItem(tabID, {

packages/core/src/amazonq/webview/ui/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,6 @@ export const createMynahUI = (
471471
) {
472472
mynahUI.updateStore(tabID, {
473473
loadingChat: true,
474-
cancelButtonWhenLoading: false,
475474
promptInputDisabledState: true,
476475
})
477476

packages/core/src/amazonq/webview/ui/messages/controller.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ export class MessageController {
8888

8989
this.mynahUI.updateStore(selectedTab.id, {
9090
loadingChat: true,
91-
cancelButtonWhenLoading: false,
9291
promptInputDisabledState: true,
9392
})
9493
this.mynahUI.addChatItem(selectedTab.id, message)
@@ -120,7 +119,7 @@ export class MessageController {
120119

121120
this.mynahUI.updateStore(newTabID, {
122121
loadingChat: true,
123-
cancelButtonWhenLoading: false,
122+
// cancelButtonWhenLoading: false,
124123
promptInputDisabledState: true,
125124
})
126125

packages/core/src/amazonq/webview/ui/messages/handler.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export class TextMessageHandler {
3636

3737
this.mynahUI.updateStore(tabID, {
3838
loadingChat: true,
39-
cancelButtonWhenLoading: false,
4039
promptInputDisabledState: true,
4140
})
4241

packages/core/src/amazonq/webview/ui/quickActions/handler.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ export class QuickActionHandler {
272272

273273
this.mynahUI.updateStore(affectedTabId, {
274274
loadingChat: true,
275-
cancelButtonWhenLoading: false,
276275
promptInputDisabledState: true,
277276
})
278277

@@ -310,7 +309,6 @@ export class QuickActionHandler {
310309
if (currentTabType !== 'unknown' && currentTabType !== 'welcome') {
311310
affectedTabId = this.mynahUI.updateStore('', {
312311
loadingChat: true,
313-
cancelButtonWhenLoading: false,
314312
})
315313
}
316314

@@ -335,7 +333,6 @@ export class QuickActionHandler {
335333
// disable chat prompt
336334
this.mynahUI.updateStore(affectedTabId, {
337335
loadingChat: true,
338-
cancelButtonWhenLoading: false,
339336
})
340337

341338
this.connector.transform(affectedTabId)

packages/core/src/shared/db/chatDb/chatDb.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,9 @@ export class Database {
483483
}
484484

485485
// Make sure the last stored message is from the assistant (type === 'answer'), else drop
486-
if (messages.length > 0 && messages[messages.length - 1].type === ('prompt' as ChatItemType)) {
486+
if (messages.length > 0 && messages[messages.length - 1].userInputMessageContext) {
487+
// eslint-disable-next-line aws-toolkits/no-console-log
488+
console.log('found the last message to be userInputMessage')
487489
messages.pop()
488490
this.logger.debug('Dropped trailing user message')
489491
}

0 commit comments

Comments
 (0)