@@ -13,6 +13,7 @@ import { TabsStorage, TabType } from '../storages/tabsStorage'
13
13
import { TestMessageType } from '../../../../amazonqTest/chat/views/connector/connector'
14
14
import { ChatPayload } from '../connector'
15
15
import { BaseConnector , BaseConnectorProps } from './baseConnector'
16
+ import { FollowUpTypes } from '../../../commons/types'
16
17
17
18
export interface ConnectorProps extends BaseConnectorProps {
18
19
sendMessageToExtension : ( message : ExtensionMessage ) => void
@@ -35,6 +36,7 @@ export interface MessageData {
35
36
}
36
37
// TODO: Refactor testChatConnector, scanChatConnector and other apps connector files post RIV
37
38
export class Connector extends BaseConnector {
39
+ connector : any
38
40
override getTabType ( ) : TabType {
39
41
return 'testgen'
40
42
}
@@ -107,15 +109,40 @@ export class Connector extends BaseConnector {
107
109
}
108
110
109
111
onFileDiff = ( tabID : string , filePath : string , deleted : boolean , messageId ?: string ) : void => {
110
- // TODO: add this back once we can advance flow from here
111
- // this.sendMessageToExtension({
112
- // command: 'open-diff',
113
- // tabID,
114
- // filePath,
115
- // deleted,
116
- // messageId,
117
- // tabType: 'testgen',
118
- // })
112
+ // Open diff view
113
+ this . sendMessageToExtension ( {
114
+ command : 'open-diff' ,
115
+ tabID,
116
+ filePath,
117
+ deleted,
118
+ messageId,
119
+ tabType : 'testgen' ,
120
+ } )
121
+ this . onChatAnswerReceived ?.(
122
+ tabID ,
123
+ {
124
+ type : ChatItemType . ANSWER ,
125
+ messageId : messageId ,
126
+ followUp : {
127
+ text : ' ' ,
128
+ options : [
129
+ {
130
+ type : FollowUpTypes . AcceptCode ,
131
+ pillText : 'Accept' ,
132
+ status : 'success' ,
133
+ icon : MynahIcons . OK ,
134
+ } ,
135
+ {
136
+ type : FollowUpTypes . RejectCode ,
137
+ pillText : 'Reject' ,
138
+ status : 'error' ,
139
+ icon : MynahIcons . REVERT ,
140
+ } ,
141
+ ] ,
142
+ } ,
143
+ } ,
144
+ { }
145
+ )
119
146
}
120
147
121
148
private processChatMessage = async ( messageData : any ) : Promise < void > => {
0 commit comments