Skip to content

Commit c490994

Browse files
authored
fix(chat): remove shell command header buttons with status after click run or reject (#27)
1 parent 732aa63 commit c490994

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

packages/core/src/amazonq/webview/ui/apps/cwChatConnector.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,22 @@ export class Connector extends BaseConnector {
345345
}
346346
break
347347
case 'run-shell-command':
348-
if (answer.header) {
349-
answer.header.status = {
348+
if (Object.keys(answer.header!).length === 0) {
349+
answer.header = {
350+
body: '$ shell',
351+
status: {
352+
icon: 'ok' as MynahIconsType,
353+
text: 'Accepted',
354+
status: 'success',
355+
},
356+
}
357+
} else {
358+
answer.header!.status = {
350359
icon: 'ok' as MynahIconsType,
351360
text: 'Accepted',
352361
status: 'success',
353362
}
363+
answer.header!.buttons = []
354364
}
355365
break
356366
case 'reject-shell-command':
@@ -360,6 +370,7 @@ export class Connector extends BaseConnector {
360370
text: 'Rejected',
361371
status: 'error',
362372
}
373+
answer.header.buttons = []
363374
}
364375
break
365376
default:

packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,13 +475,12 @@ export class Messenger {
475475
}
476476

477477
shellCommandHeader = {
478-
icon: 'code-block' as MynahIconsType,
479-
body: 'shell',
478+
body: '$ shell',
480479
buttons: buttons,
481480
}
482481

483482
if (validation.warning) {
484-
message = validation.warning + message
483+
message = validation.warning + message + '\nRun the command to proceed.\n'
485484
}
486485
} else if (toolUse?.name === ToolType.FsWrite) {
487486
const input = toolUse.input as unknown as FsWriteParams

0 commit comments

Comments
 (0)