@@ -13,6 +13,7 @@ import { TabsStorage, TabType } from '../storages/tabsStorage'
1313import { TestMessageType } from '../../../../amazonqTest/chat/views/connector/connector'
1414import { ChatPayload } from '../connector'
1515import { BaseConnector , BaseConnectorProps } from './baseConnector'
16+ import { FollowUpTypes } from '../../../commons/types'
1617
1718export interface ConnectorProps extends BaseConnectorProps {
1819 sendMessageToExtension : ( message : ExtensionMessage ) => void
@@ -107,15 +108,43 @@ export class Connector extends BaseConnector {
107108 }
108109
109110 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+ )
119148 }
120149
121150 private processChatMessage = async ( messageData : any ) : Promise < void > => {
0 commit comments