Skip to content
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
28 changes: 28 additions & 0 deletions packages/core/src/amazonq/webview/ui/apps/testChatConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export class Connector extends BaseConnector {

onCustomFormAction(
tabId: string,
messageId: string,
action: {
id: string
text?: string | undefined
Expand All @@ -105,6 +106,33 @@ export class Connector extends BaseConnector {
tabID: tabId,
description: action.description,
})

if (this.onChatAnswerUpdated === undefined) {
return
}
const answer: ChatItem = {
type: ChatItemType.ANSWER,
messageId: messageId,
buttons: [],
}
// TODO: Add more cases for Accept/Reject/viewDiff.
switch (action.id) {
case 'Provide-Feedback':
answer.buttons = [
{
keepCardAfterClick: true,
text: 'Thanks for providing feedback.',
id: 'utg_provided_feedback',
status: 'success',
position: 'outside',
disabled: true,
},
]
break
default:
break
}
this.onChatAnswerUpdated(tabId, answer)
}

onFileDiff = (tabID: string, filePath: string, deleted: boolean, messageId?: string): void => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/amazonq/webview/ui/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ export class Connector {
this.gumbyChatConnector.onCustomFormAction(tabId, action)
break
case 'testgen':
this.testChatConnector.onCustomFormAction(tabId, action)
this.testChatConnector.onCustomFormAction(tabId, messageId ?? '', action)
break
case 'review':
this.scanChatConnector.onCustomFormAction(tabId, action)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,6 @@ export class TestController {
getFeedbackCommentData = `Q Test Generation: RequestId: ${this.sessionStorage.getSession().startTestGenerationRequestId}, TestGenerationJobId: ${this.sessionStorage.getSession().testGenerationJob?.testGenerationJobId}`
void submitFeedback(placeholder, 'Amazon Q', getFeedbackCommentData)
telemetry.ui_click.emit({ elementId: 'unitTestGeneration_provideFeedback' })
this.messenger.sendMessage(
'Unit test generation completed. Thanks for providing feedback.',
data.tabID,
'answer'
)
break
}
}
Expand Down Expand Up @@ -435,7 +430,7 @@ export class TestController {
const buttons: ChatItemButton[] = []
if (Auth.instance.isInternalAmazonUser()) {
buttons.push({
keepCardAfterClick: false,
keepCardAfterClick: true,
text: 'How can we make /test better?',
id: ButtonActions.PROVIDE_FEEDBACK,
disabled: false, // allow button to be re-clicked
Expand Down
Loading