@@ -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
@@ -107,15 +108,43 @@ export class Connector extends BaseConnector {
107
108
}
108
109
109
110
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
- // })
111
+ if ( this . onChatAnswerReceived === undefined ) {
112
+ return
113
+ }
114
+ // Open diff view
115
+ this . sendMessageToExtension ( {
116
+ command : 'open-diff' ,
117
+ tabID,
118
+ filePath,
119
+ deleted,
120
+ messageId,
121
+ tabType : 'testgen' ,
122
+ } )
123
+ this . onChatAnswerReceived (
124
+ tabID ,
125
+ {
126
+ type : ChatItemType . ANSWER ,
127
+ messageId : messageId ,
128
+ followUp : {
129
+ text : ' ' ,
130
+ options : [
131
+ {
132
+ type : FollowUpTypes . AcceptCode ,
133
+ pillText : 'Accept' ,
134
+ status : 'success' ,
135
+ icon : MynahIcons . OK ,
136
+ } ,
137
+ {
138
+ type : FollowUpTypes . RejectCode ,
139
+ pillText : 'Reject' ,
140
+ status : 'error' ,
141
+ icon : MynahIcons . REVERT ,
142
+ } ,
143
+ ] ,
144
+ } ,
145
+ } ,
146
+ { }
147
+ )
119
148
}
120
149
121
150
private processChatMessage = async ( messageData : any ) : Promise < void > => {
0 commit comments