@@ -54,12 +54,13 @@ export class ChatWrapper {
5454 private lastStreamingChatItemCard : ChatItemCard | null ;
5555 private lastStreamingChatItemMessageId : string | null ;
5656 private allRenderedChatItems : Record < string , ChatItemCard > = { } ;
57+ private allRenderedModifiedFileChatItems : Record < string , ChatItem > = { } ;
5758 render : ExtendedHTMLElement ;
5859 private readonly dragOverlayContent : HTMLElement ;
5960 private readonly dragBlurOverlay : HTMLElement ;
6061 private dragOverlayVisibility : boolean = true ;
6162 private imageContextFeatureEnabled : boolean = false ;
62- private readonly modifiedFilesTracker : ModifiedFilesTracker ;
63+ private modifiedFilesTracker : ModifiedFilesTracker ;
6364
6465 constructor ( props : ChatWrapperProps ) {
6566 StyleLoader . getInstance ( ) . load ( 'components/chat/_chat-wrapper.scss' ) ;
@@ -392,6 +393,18 @@ export class ChatWrapper {
392393 // Check if messageId contains "modified-files-" prefix
393394 if ( chatItem . messageId != null && chatItem . messageId !== '' && chatItem . messageId . includes ( 'modified-files-' ) ) {
394395 // Forward only to ModifiedFilesTracker, skip normal flow
396+ if ( chatItem . fileList !== null ) {
397+ this . allRenderedModifiedFileChatItems [ chatItem . messageId ] = chatItem ;
398+ const size = Object . keys ( this . allRenderedModifiedFileChatItems ) . length ;
399+ chatItem . title = size === 1 ? '1 file modified!' : `${ size } files modified!` ;
400+ } else if ( chatItem . fileList === null || chatItem . fileList === undefined ) {
401+ // This will mean that it is reset signal i.e. new chat;
402+ // Ideally should be sent through controller
403+ chatItem . title = 'working ...' ;
404+ // remove all items from allRenderedModifiedFileChatItems
405+ this . allRenderedModifiedFileChatItems = { } ;
406+ this . modifiedFilesTracker = new ModifiedFilesTracker ( { tabId : this . props . tabId } ) ;
407+ }
395408 this . modifiedFilesTracker . addChatItem ( chatItem ) ;
396409 return ;
397410 }
0 commit comments