@@ -125,6 +125,7 @@ export const handleChatPrompt = (
125
125
// Set UI to loading state
126
126
mynahUi . updateStore ( tabId , {
127
127
loadingChat : true ,
128
+ cancelButtonWhenLoading : true ,
128
129
promptInputDisabledState : false ,
129
130
} )
130
131
@@ -202,8 +203,8 @@ export const createMynahUi = (
202
203
messager . onUiReady ( )
203
204
messager . onTabAdd ( initialTabId )
204
205
} ,
205
- onFileClick : ( tabId , filePath , deleted , messageId , eventId ) => {
206
- messager . onFileClick ( { tabId, filePath, messageId } )
206
+ onFileClick : ( tabId , filePath , deleted , messageId , eventId , fileDetails ) => {
207
+ messager . onFileClick ( { tabId, filePath, messageId, fullPath : fileDetails ?. data ?. [ 'fullPath' ] } )
207
208
} ,
208
209
onTabAdd : ( tabId : string ) => {
209
210
const defaultTabBarData = tabFactory . getDefaultTabData ( )
@@ -428,6 +429,13 @@ export const createMynahUi = (
428
429
}
429
430
} ,
430
431
onStopChatResponse : tabId => {
432
+ const store = mynahUi . getTabData ( tabId ) ?. getStore ( ) || { }
433
+ const chatItems = store . chatItems || [ ]
434
+ const updatedItems = chatItems . map ( item => ( {
435
+ ...item ,
436
+ type : item . type === ChatItemType . ANSWER_STREAM ? ChatItemType . ANSWER : item . type ,
437
+ } ) )
438
+ mynahUi . updateStore ( tabId , { loadingChat : false , cancelButtonWhenLoading : true , chatItems : updatedItems } )
431
439
messager . onStopChatResponse ( tabId )
432
440
} ,
433
441
}
@@ -513,6 +521,9 @@ export const createMynahUi = (
513
521
. join ( ', ' ) || '' ,
514
522
description : filePath ,
515
523
clickable : true ,
524
+ data : {
525
+ fullPath : fileDetails . fullPath || '' ,
526
+ } ,
516
527
} ,
517
528
] )
518
529
) ,
@@ -535,6 +546,7 @@ export const createMynahUi = (
535
546
if ( chatResult . additionalMessages ?. length ) {
536
547
mynahUi . updateStore ( tabId , {
537
548
loadingChat : true ,
549
+ cancelButtonWhenLoading : true ,
538
550
} )
539
551
chatResult . additionalMessages . forEach ( am => {
540
552
const chatItem : ChatItem = {
@@ -621,6 +633,7 @@ export const createMynahUi = (
621
633
622
634
mynahUi . updateStore ( tabId , {
623
635
loadingChat : false ,
636
+ cancelButtonWhenLoading : true ,
624
637
promptInputDisabledState : false ,
625
638
} )
626
639
}
@@ -629,6 +642,7 @@ export const createMynahUi = (
629
642
const isChatLoading = params . state ?. inProgress
630
643
mynahUi . updateStore ( params . tabId , {
631
644
loadingChat : isChatLoading ,
645
+ cancelButtonWhenLoading : true ,
632
646
} )
633
647
if ( params . data ?. messages . length ) {
634
648
const { tabId } = params
@@ -735,6 +749,7 @@ ${params.message}`,
735
749
736
750
mynahUi . updateStore ( tabId , {
737
751
loadingChat : false ,
752
+ cancelButtonWhenLoading : true ,
738
753
promptInputDisabledState : false ,
739
754
} )
740
755
@@ -885,7 +900,7 @@ const uiComponentsTexts = {
885
900
save : 'Save' ,
886
901
cancel : 'Cancel' ,
887
902
submit : 'Submit' ,
888
- stopGenerating : 'Stop generating ' ,
903
+ stopGenerating : 'Stop' ,
889
904
copyToClipboard : 'Copied to clipboard' ,
890
905
noMoreTabsTooltip : 'You can only open ten conversation tabs at a time.' ,
891
906
codeSuggestionWithReferenceTitle : 'Some suggestions contain code with references.' ,
0 commit comments