Skip to content

Commit

Permalink
Merge master into feature/emr
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-toolkit-automation authored Jan 17, 2025
2 parents 4ee658a + d7bfb5d commit 529f20e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "`/test`: view diffs by clicking files in the file tree, aligning the behavior with the 'View Diff' button."
}
47 changes: 38 additions & 9 deletions packages/core/src/amazonq/webview/ui/apps/testChatConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { TabsStorage, TabType } from '../storages/tabsStorage'
import { TestMessageType } from '../../../../amazonqTest/chat/views/connector/connector'
import { ChatPayload } from '../connector'
import { BaseConnector, BaseConnectorProps } from './baseConnector'
import { FollowUpTypes } from '../../../commons/types'

export interface ConnectorProps extends BaseConnectorProps {
sendMessageToExtension: (message: ExtensionMessage) => void
Expand Down Expand Up @@ -107,15 +108,43 @@ export class Connector extends BaseConnector {
}

onFileDiff = (tabID: string, filePath: string, deleted: boolean, messageId?: string): void => {
// TODO: add this back once we can advance flow from here
// this.sendMessageToExtension({
// command: 'open-diff',
// tabID,
// filePath,
// deleted,
// messageId,
// tabType: 'testgen',
// })
if (this.onChatAnswerReceived === undefined) {
return
}
// Open diff view
this.sendMessageToExtension({
command: 'open-diff',
tabID,
filePath,
deleted,
messageId,
tabType: 'testgen',
})
this.onChatAnswerReceived(
tabID,
{
type: ChatItemType.ANSWER,
messageId: messageId,
followUp: {
text: ' ',
options: [
{
type: FollowUpTypes.AcceptCode,
pillText: 'Accept',
status: 'success',
icon: MynahIcons.OK,
},
{
type: FollowUpTypes.RejectCode,
pillText: 'Reject',
status: 'error',
icon: MynahIcons.REVERT,
},
],
},
},
{}
)
}

private processChatMessage = async (messageData: any): Promise<void> => {
Expand Down

0 comments on commit 529f20e

Please sign in to comment.