Skip to content

Commit 5535430

Browse files
committed
msg: working-partially;
- Switched buttons to header and kept undoall button at top level
1 parent dc3f6a2 commit 5535430

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/modified-files-tracker.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export class ModifiedFilesTracker {
5252
console.log('[ModifiedFilesTracker] Render element created:', this.render);
5353

5454
if ((this.props.chatItem?.header?.fileList) != null) {
55-
console.log('[ModifiedFilesTracker] Rendering modified files with fileList:', this.props.chatItem.header.fileList);
56-
this.renderModifiedFiles(this.props.chatItem.header.fileList, this.props.chatItem.messageId);
55+
console.log('[ModifiedFilesTracker] Rendering modified files with fileList:', this.props.chatItem.header?.fileList);
56+
this.renderModifiedFiles(this.props.chatItem.header?.fileList, this.props.chatItem.messageId);
5757
} else {
5858
console.log('[ModifiedFilesTracker] No fileList found, rendering empty state');
5959
this.renderModifiedFiles(null);
@@ -134,12 +134,12 @@ export class ModifiedFilesTracker {
134134
horizontalContainer.appendChild(fileTreeWrapper.render);
135135

136136
// Add buttons for this specific file if they exist
137-
if (this.props.chatItem?.buttons != null && Array.isArray(this.props.chatItem.buttons) && this.props.chatItem.buttons.length > 0) {
137+
if (this.props.chatItem?.header?.buttons != null && Array.isArray(this.props.chatItem.header?.buttons) && this.props.chatItem.header?.buttons.length > 0) {
138138
const buttonsWrapper = new ChatItemButtonsWrapper({
139139
tabId: this.props.tabId,
140140
classNames: [ 'mynah-modified-files-file-buttons' ],
141141
formItems: null,
142-
buttons: this.props.chatItem.buttons,
142+
buttons: this.props.chatItem.header?.buttons,
143143
onActionClick: action => {
144144
MynahUIGlobalEvents.getInstance().dispatch(MynahEventNames.BODY_ACTION_CLICKED, {
145145
tabId: this.props.tabId,
@@ -207,7 +207,7 @@ export class ModifiedFilesTracker {
207207
if (chatItem.header?.fileList != null) {
208208
// Store the current chatItem for button handling
209209
this.props.chatItem = chatItem;
210-
this.renderModifiedFiles(chatItem.header.fileList, chatItem.messageId);
210+
this.renderModifiedFiles(chatItem.header?.fileList, chatItem.messageId);
211211
} else if (chatItem.buttons != null && Array.isArray(chatItem.buttons) && chatItem.buttons.length > 0) {
212212
// Handle case where only buttons (like undo all) are provided without fileList
213213
this.props.chatItem = chatItem;

0 commit comments

Comments
 (0)