Skip to content

Commit 4a4e8f4

Browse files
committed
fixed statements
removed commented imports updated example app
1 parent 062445a commit 4a4e8f4

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

example/src/main.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,11 @@ export const createMynahUI = (initialData?: MynahUIDataModel): MynahUI => {
198198
case 'reject-change':
199199
mynahUI.updateChatAnswerWithMessageId(tabId, messageId, exampleFileListChatItemForUpdate);
200200
break;
201+
case 'show-diff':
202+
mynahUI.updateChatAnswerWithMessageId(tabId, messageId, {
203+
body: exampleCodeDiff
204+
});
205+
break;
201206
case 'revert-rejection':
202207
mynahUI.updateChatAnswerWithMessageId(tabId, messageId, {fileList: exampleFileListChatItem.fileList});
203208
break;

example/src/samples/sample-data.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ export const exampleFileListChatItem: ChatItem = {
201201
name: 'reject-change',
202202
description: 'Reject Change',
203203
},
204+
{
205+
icon: MynahIcons.CODE_BLOCK,
206+
name: 'show-diff',
207+
description: 'Show Diff',
208+
},
204209
],
205210
},
206211
details: {

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class ChatItemTreeFile {
116116
}
117117

118118
private readonly showTooltip = (content: string, vDir?: OverlayVerticalDirection, hDir?: OverlayHorizontalDirection): void => {
119-
if (content.trim() !== undefined) {
119+
if (content.trim() !== '') {
120120
clearTimeout(this.fileTooltipTimeout);
121121
this.fileTooltipTimeout = setTimeout(() => {
122122
this.fileTooltip = new Overlay({
@@ -143,8 +143,10 @@ export class ChatItemTreeFile {
143143
};
144144

145145
public readonly hideTooltip = (): void => {
146-
clearTimeout(this.fileTooltipTimeout);
147-
if (this.fileTooltip !== null) {
146+
if (this.fileTooltipTimeout != null) {
147+
clearTimeout(this.fileTooltipTimeout);
148+
}
149+
if (this.fileTooltip != null) {
148150
this.fileTooltip?.close();
149151
this.fileTooltip = null;
150152
}

src/components/syntax-highlighter.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import 'prismjs/components/prism-less.min';
3232
import 'prismjs/plugins/line-numbers/prism-line-numbers.js';
3333
import 'prismjs/plugins/keep-markup/prism-keep-markup.js';
3434
import 'prismjs/plugins/diff-highlight/prism-diff-highlight.min';
35-
// import 'prismjs/plugins/diff-highlight/prism-diff-highlight.min.css';
3635

3736
import {
3837
CodeSelectionType,

0 commit comments

Comments
 (0)