Skip to content

Commit dc3f6a2

Browse files
committed
msg: working-completely;
- removed previous unnecesary edits - removed example for now
1 parent cd411f2 commit dc3f6a2

File tree

9 files changed

+23
-232
lines changed

9 files changed

+23
-232
lines changed

example/src/commands.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,5 @@ export enum Commands {
2828
CLEAR_CONTEXT_ITEMS = '/clear-context-items',
2929
CLEAR_LOGS = '/clear-logs',
3030
SHOW_CUSTOM_FORM = '/show-custom-form',
31-
VOTE = '/vote',
32-
MODIFIED_FILES_DEMO = '/modified-files-demo'
31+
VOTE = '/vote'
3332
}

example/src/config.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,6 @@ export const QuickActionCommands: QuickActionCommandGroup[] = [
283283
icon: MynahIcons.FLASH,
284284
description: 'Test streaming animation with different speeds. Use tab bar buttons to switch modes.',
285285
},
286-
{
287-
command: Commands.MODIFIED_FILES_DEMO,
288-
icon: MynahIcons.FILE,
289-
description: 'Demo the modified files tracker component above the chat interface.',
290-
},
291286
],
292287
},
293288
];

example/src/main.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,17 +1259,6 @@ here to see if it gets cut off properly as expected, with an ellipsis through cs
12591259
`);
12601260
},
12611261
onChatPrompt: (tabId: string, prompt: ChatPrompt) => {
1262-
// Clear modified files tracker only for commands that modify files
1263-
const fileModifyingCommands = [
1264-
Commands.MODIFIED_FILES_DEMO,
1265-
'/dev',
1266-
'/transform',
1267-
'/generate'
1268-
];
1269-
1270-
if (prompt.command && fileModifyingCommands.includes(prompt.command)) {
1271-
mynahUI.clearModifiedFiles(tabId);
1272-
}
12731262

12741263
Log(`New prompt on tab: <b>${tabId}</b><br/>
12751264
prompt: <b>${prompt.prompt !== undefined && prompt.prompt !== '' ? prompt.prompt : '{command only}'}</b><br/>
@@ -1587,9 +1576,6 @@ here to see if it gets cut off properly as expected, with an ellipsis through cs
15871576
onMessageDismiss: (tabId, messageId) => {
15881577
Log(`Card dismissed: tabId: <b>${tabId}</b>, messageId: <b>${messageId}</b>`);
15891578
},
1590-
onModifiedFileClick: (tabId, filePath) => {
1591-
Log(`Modified file clicked on tab <b>${tabId}</b>: <b>${filePath}</b>`);
1592-
},
15931579
});
15941580

15951581
setTimeout(() => {
@@ -1636,23 +1622,6 @@ here to see if it gets cut off properly as expected, with an ellipsis through cs
16361622
case Commands.VOTE:
16371623
mynahUI.addChatItem(tabId, exampleVoteChatItem);
16381624
mynahUI.addChatItem(tabId, defaultFollowUps);
1639-
break;
1640-
case Commands.MODIFIED_FILES_DEMO:
1641-
// Demo the modified files tracker
1642-
mynahUI.addChatItem(tabId, {
1643-
type: ChatItemType.ANSWER,
1644-
messageId: generateUID(),
1645-
body: 'Demonstrating the modified files tracker. Watch the component above the chat!',
1646-
});
1647-
1648-
// Demo will be handled through chatItem approach now
1649-
mynahUI.addChatItem(tabId, {
1650-
type: ChatItemType.ANSWER,
1651-
messageId: generateUID(),
1652-
body: 'Modified files tracker demo is now handled through chatItem.header.fileList approach.',
1653-
});
1654-
1655-
16561625
break;
16571626
case Commands.CARD_WITH_MARKDOWN_LIST:
16581627
getGenerativeAIAnswer(tabId, sampleMarkdownList);

example/src/samples/sample-data.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -681,10 +681,6 @@ export const defaultFollowUps: ChatItem = {
681681
pillText: 'Some auto reply',
682682
prompt: 'Some random auto reply here.',
683683
},
684-
{
685-
command: Commands.MODIFIED_FILES_DEMO,
686-
pillText: 'Modified files demo',
687-
},
688684
],
689685
},
690686
};
@@ -2185,7 +2181,7 @@ export const mcpToolRunSampleCardInit:ChatItem = // Summary Card
21852181
filePaths: ['Running'],
21862182
details: {
21872183
'Running': {
2188-
description: 'Work in progress...',
2184+
description: 'Work in progress!',
21892185
icon: null,
21902186
labelIcon: 'progress',
21912187
labelIconForegroundStatus: 'info',

src/__test__/components/feedback-form/feedback-form-integration.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ describe('FeedbackForm Integration Tests', () => {
358358
describe('Error Handling', () => {
359359
it('should handle missing tab data gracefully', () => {
360360
// Override the mock for this specific test
361-
(mockTabsStore.getTabDataStore as jest.Mock).mockReturnValueOnce(undefined as any);
361+
mockTabsStore.getTabDataStore.mockReturnValueOnce(undefined as any);
362362

363363
feedbackForm = new FeedbackForm();
364364

src/components/__test__/chat-item/chat-item-card-content.spec.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,28 @@ describe('ChatItemCardContent Animation Speed', () => {
1919
beforeEach(() => {
2020
jest.clearAllMocks();
2121

22-
(mockGetInstance as jest.Mock).mockReturnValue({
22+
mockGetInstance.mockReturnValue({
23+
// @ts-expect-error
2324
config: {
2425
typewriterStackTime: 100,
2526
typewriterMaxWordTime: 20,
2627
disableTypewriterAnimation: false,
2728
}
28-
} as any);
29+
});
2930

3031
document.body.innerHTML = '<div id="test-container"></div>';
3132
});
3233

3334
describe('Animation Configuration', () => {
3435
it('should use fast animation settings', () => {
35-
(mockGetInstance as jest.Mock).mockReturnValue({
36+
mockGetInstance.mockReturnValue({
37+
// @ts-expect-error
3638
config: {
3739
typewriterStackTime: 100,
3840
typewriterMaxWordTime: 20,
3941
disableTypewriterAnimation: false,
4042
}
41-
} as any);
43+
});
4244

4345
const props: ChatItemCardContentProps = {
4446
body: 'Test content',
@@ -51,11 +53,12 @@ describe('ChatItemCardContent Animation Speed', () => {
5153
});
5254

5355
it('should disable animation when configured', () => {
54-
(mockGetInstance as jest.Mock).mockReturnValue({
56+
mockGetInstance.mockReturnValue({
57+
// @ts-expect-error
5558
config: {
5659
disableTypewriterAnimation: true,
5760
}
58-
} as any);
61+
});
5962

6063
const props: ChatItemCardContentProps = {
6164
body: 'Test content',
@@ -86,9 +89,10 @@ describe('ChatItemCardContent Animation Speed', () => {
8689

8790
describe('Default Values', () => {
8891
it('should use defaults when config is empty', () => {
89-
(mockGetInstance as jest.Mock).mockReturnValue({
92+
mockGetInstance.mockReturnValue({
93+
// @ts-expect-error
9094
config: {}
91-
} as any);
95+
});
9296

9397
const props: ChatItemCardContentProps = {
9498
body: 'Test content',

src/components/chat-item/chat-item-card.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -320,19 +320,11 @@ export class ChatItemCard {
320320
if (header.fileList?.details?.[filePath]?.clickable === false) {
321321
return;
322322
}
323-
console.log('[ChatItemCard] File pill clicked:', {
324-
tabId: this.props.tabId,
325-
messageId: this.props.chatItem.messageId,
326-
filePath,
327-
deleted: isDeleted,
328-
fileDetails: header.fileList?.details?.[filePath]
329-
});
330323
MynahUIGlobalEvents.getInstance().dispatch(MynahEventNames.FILE_CLICK, {
331324
tabId: this.props.tabId,
332325
messageId: this.props.chatItem.messageId,
333326
filePath,
334-
deleted: isDeleted,
335-
fileDetails: header.fileList?.details?.[filePath]
327+
deleted: isDeleted
336328
});
337329
},
338330
...(description !== undefined
@@ -813,13 +805,6 @@ export class ChatItemCard {
813805
formItems: this.chatFormItems,
814806
buttons: [],
815807
onActionClick: action => {
816-
console.log('[ChatItemCard] Button clicked:', {
817-
tabId: this.props.tabId,
818-
messageId: this.props.chatItem.messageId,
819-
actionId: action.id,
820-
actionText: action.text,
821-
formItemValues: this.chatFormItems !== null ? this.chatFormItems.getAllValues() : {}
822-
});
823808
MynahUIGlobalEvents.getInstance().dispatch(MynahEventNames.BODY_ACTION_CLICKED, {
824809
tabId: this.props.tabId,
825810
messageId: this.props.chatItem.messageId,

src/components/chat-item/chat-item-tree-file.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,9 @@ export class ChatItemTreeFile {
4242
click: () => {
4343
this.hideTooltip();
4444
if (this.props.details?.clickable !== false) {
45-
const fileMessageId = this.props.details?.data?.messageId ?? this.props.messageId;
46-
console.log('[ChatItemTreeFile] File clicked - originalFilePath:', this.props.originalFilePath);
47-
console.log('[ChatItemTreeFile] File clicked - details.data.fullPath:', this.props.details?.data?.fullPath);
48-
console.log('[ChatItemTreeFile] File clicked - details.description:', this.props.details?.description);
49-
console.log('[ChatItemTreeFile] File clicked - using messageId:', fileMessageId);
5045
MynahUIGlobalEvents.getInstance().dispatch(MynahEventNames.FILE_CLICK, {
5146
tabId: this.props.tabId,
52-
messageId: fileMessageId,
47+
messageId: this.props.messageId,
5348
filePath: this.props.originalFilePath,
5449
deleted: this.props.deleted,
5550
fileDetails: this.props.details
@@ -144,17 +139,9 @@ export class ChatItemTreeFile {
144139
onClick: (e) => {
145140
cancelEvent(e);
146141
this.hideTooltip();
147-
const fileMessageId = this.props.details?.data?.messageId ?? this.props.messageId;
148-
console.log('[ChatItemTreeFile] File action clicked:', {
149-
tabId: this.props.tabId,
150-
messageId: fileMessageId,
151-
filePath: this.props.originalFilePath,
152-
actionName: action.name,
153-
actionDetails: action
154-
});
155142
MynahUIGlobalEvents.getInstance().dispatch(MynahEventNames.FILE_ACTION_CLICK, {
156143
tabId: this.props.tabId,
157-
messageId: fileMessageId,
144+
messageId: this.props.messageId,
158145
filePath: this.props.originalFilePath,
159146
actionName: action.name,
160147
});

0 commit comments

Comments
 (0)