Skip to content

Commit 170113f

Browse files
authored
fix: permission check ux changes (#1290)
* fix: permission ux * fix: minor edits
1 parent 49bd9c9 commit 170113f

File tree

2 files changed

+14
-22
lines changed

2 files changed

+14
-22
lines changed

chat-client/src/client/mynahUi.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,8 @@ export const createMynahUi = (
899899
const contentHorizontalAlignment: ChatItem['contentHorizontalAlignment'] =
900900
message.type === 'directive' && message.messageId?.startsWith('stopped') ? 'center' : undefined
901901

902-
const shouldMute = message.header?.status?.text === 'Stopped' || message.header?.status?.text === 'Rejected'
902+
// If message.header?.status?.text is Stopped or Rejected or Ignored or Completed etc.. card should be in disabled state.
903+
const shouldMute = message.header?.status?.text !== undefined
903904

904905
return {
905906
body: message.body,

server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,43 +1154,34 @@ export class AgenticChatController implements ChatHandlers {
11541154

11551155
// For file operations and other tools, create appropriate confirmation UI
11561156
let header: {
1157-
body: string
1157+
body: string | undefined
11581158
status: { status: 'info' | 'success' | 'warning' | 'error'; icon: string; text: string }
11591159
}
1160-
let body: string
1160+
let body: string | undefined
11611161

11621162
switch (toolName) {
11631163
case 'fsWrite':
1164-
const writeFilePath = (toolUse.input as unknown as FsWriteParams).path
11651164
header = {
1166-
body: 'File Write',
1165+
body: undefined,
11671166
status: {
1168-
status: isAccept ? 'success' : 'error',
1169-
icon: isAccept ? 'ok' : 'cancel',
1170-
text: isAccept ? 'Allowed' : 'Rejected',
1167+
status: 'success',
1168+
icon: 'ok',
1169+
text: 'Allowed',
11711170
},
11721171
}
1173-
body = isAccept
1174-
? `File modification allowed: \`${writeFilePath}\``
1175-
: `File modification rejected: \`${writeFilePath}\``
11761172
break
11771173

11781174
case 'fsRead':
11791175
case 'listDirectory':
11801176
// Common handling for read operations
1181-
const path = (toolUse.input as unknown as FsReadParams | ListDirectoryParams).path
1182-
const isDirectory = toolName === 'listDirectory'
11831177
header = {
1184-
body: isDirectory ? 'Directory Listing' : 'File Read',
1178+
body: undefined,
11851179
status: {
1186-
status: isAccept ? 'success' : 'error',
1187-
icon: isAccept ? 'ok' : 'cancel',
1188-
text: isAccept ? 'Allowed' : 'Rejected',
1180+
status: 'success',
1181+
icon: 'ok',
1182+
text: 'Allowed',
11891183
},
11901184
}
1191-
body = isAccept
1192-
? `${isDirectory ? 'Directory listing' : 'File read'} allowed: \`${path}\``
1193-
: `${isDirectory ? 'Directory listing' : 'File read'} rejected: \`${path}\``
11941185
break
11951186

11961187
case 'fileSearch':
@@ -1341,8 +1332,8 @@ export class AgenticChatController implements ChatHandlers {
13411332
},
13421333
]
13431334
header = {
1344-
icon: 'warning',
1345-
iconForegroundStatus: 'warning',
1335+
icon: 'tools',
1336+
iconForegroundStatus: 'tools',
13461337
body: '#### Allow read-only tools outside your workspace',
13471338
buttons,
13481339
}

0 commit comments

Comments
 (0)