Skip to content

Commit 3156fc1

Browse files
committed
Fixing conflicts
1 parent 26f541b commit 3156fc1

File tree

3 files changed

+21
-27
lines changed

3 files changed

+21
-27
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ export class Connector extends BaseConnector {
303303
type: ChatItemType.ANSWER,
304304
messageId: messageId,
305305
buttons: [],
306-
body: ' ',
306+
body: undefined,
307307
header: currentChatItem?.header ? { ...currentChatItem.header } : {},
308308
}
309309
switch (action.id) {
@@ -315,6 +315,7 @@ export class Connector extends BaseConnector {
315315
status: 'success',
316316
}
317317
answer.header.buttons = []
318+
answer.body = ' '
318319
}
319320
break
320321
case 'reject-code-diff':
@@ -325,6 +326,7 @@ export class Connector extends BaseConnector {
325326
status: 'error',
326327
}
327328
answer.header.buttons = []
329+
answer.body = ' '
328330
}
329331
break
330332
case 'confirm-tool-use':
@@ -342,8 +344,6 @@ export class Connector extends BaseConnector {
342344
default:
343345
break
344346
}
345-
// eslint-disable-next-line aws-toolkits/no-console-log
346-
console.log(`[onCustomFormAction]: ${answer.body}`)
347347

348348
if (currentChatItem && answer.messageId) {
349349
const updatedItem = { ...currentChatItem, ...answer }

packages/core/src/codewhispererChat/view/connector/connector.ts

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,17 @@ export class ContextSelectedMessage extends UiMessage {
206206
}
207207
}
208208

209+
export type ChatItemHeader =
210+
| (ChatItemContent & {
211+
icon?: MynahIcons | MynahIconsType
212+
status?: {
213+
status?: Status
214+
icon?: MynahIcons | MynahIconsType
215+
text?: string
216+
}
217+
})
218+
| null
219+
209220
export interface ChatMessageProps {
210221
readonly message: string | undefined
211222
readonly messageType: ChatMessageType
@@ -222,16 +233,7 @@ export interface ChatMessageProps {
222233
readonly buttons?: ChatItemButton[]
223234
readonly fileList?: ChatItemContent['fileList']
224235
readonly canBeVoted?: boolean
225-
readonly header?:
226-
| (ChatItemContent & {
227-
icon?: MynahIcons | MynahIconsType
228-
status?: {
229-
status?: Status
230-
icon?: MynahIcons | MynahIconsType
231-
text?: string
232-
}
233-
})
234-
| null
236+
readonly header?: ChatItemHeader
235237
readonly fullWidth?: boolean
236238
readonly padding?: boolean
237239
readonly codeBlockActions?: CodeBlockActions | null
@@ -253,16 +255,7 @@ export class ChatMessage extends UiMessage {
253255
readonly title?: string
254256
readonly buttons?: ChatItemButton[]
255257
readonly fileList?: ChatItemContent['fileList']
256-
readonly header?:
257-
| (ChatItemContent & {
258-
icon?: MynahIcons | MynahIconsType
259-
status?: {
260-
status?: Status
261-
icon?: MynahIcons | MynahIconsType
262-
text?: string
263-
}
264-
})
265-
| null
258+
readonly header?: ChatItemHeader
266259
readonly fullWidth?: boolean
267260
readonly padding?: boolean
268261
readonly codeBlockActions?: CodeBlockActions | null

packages/core/src/test/codewhispererChat/tools/toolShared.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,30 +156,31 @@ describe('ToolUtils', function () {
156156
})
157157

158158
describe('queueDescription', function () {
159+
// TODO: Adding "void" to the following tests for the current implementation but in the next followup PR I will fix this issue.
159160
it('delegates to FsRead tool queueDescription method', function () {
160161
const tool: Tool = { type: ToolType.FsRead, tool: mockFsRead as unknown as FsRead }
161-
ToolUtils.queueDescription(tool, mockWritable as unknown as Writable)
162+
void ToolUtils.queueDescription(tool, mockWritable as unknown as Writable)
162163

163164
assert(mockFsRead.queueDescription.calledOnceWith(mockWritable))
164165
})
165166

166167
it('delegates to FsWrite tool queueDescription method', function () {
167168
const tool: Tool = { type: ToolType.FsWrite, tool: mockFsWrite as unknown as FsWrite }
168-
ToolUtils.queueDescription(tool, mockWritable as unknown as Writable)
169+
void ToolUtils.queueDescription(tool, mockWritable as unknown as Writable)
169170

170171
assert(mockFsWrite.queueDescription.calledOnceWith(mockWritable))
171172
})
172173

173174
it('delegates to ExecuteBash tool queueDescription method', function () {
174175
const tool: Tool = { type: ToolType.ExecuteBash, tool: mockExecuteBash as unknown as ExecuteBash }
175-
ToolUtils.queueDescription(tool, mockWritable as unknown as Writable)
176+
void ToolUtils.queueDescription(tool, mockWritable as unknown as Writable)
176177

177178
assert(mockExecuteBash.queueDescription.calledOnceWith(mockWritable))
178179
})
179180

180181
it('delegates to ListDirectory tool queueDescription method', function () {
181182
const tool: Tool = { type: ToolType.ListDirectory, tool: mockListDirectory as unknown as ListDirectory }
182-
ToolUtils.queueDescription(tool, mockWritable as unknown as Writable)
183+
void ToolUtils.queueDescription(tool, mockWritable as unknown as Writable)
183184

184185
assert(mockListDirectory.queueDescription.calledOnceWith(mockWritable))
185186
})

0 commit comments

Comments
 (0)