33 class =" absolute bottom-2 h-9 bg-lightPrimary dark:bg-darkPrimary
44 hover:opacity-90 rounded-full flex items-center justify-center
55 transition-all duration-300 ease-in-out overflow-hidden"
6- :class =" [isAudioChatMode ? 'w-32 px-2': 'w-9', !agentStore.isAudioChatMode ? 'right-16': 'right-4 ']"
6+ :class =" [isAudioChatMode ? 'w-32 px-2': 'w-9', !agentStore.isAudioChatMode ? 'right-16': 'right-1/2 translate-x-1/2 ']"
77 @click =" toggleChatMode"
88 >
99 <div class =" w-5 h-5 flex items-center justify-center" >
1010 <div v-if =" !showButtonSpinner" class =" flex justify-evenly items-center gap-[0.1rem]" >
1111 <AudioLines :showAnimation =" showAnimation " :isRecording =" isAudioChatMode " />
1212 </div >
13+ <div v-else-if =" showStopGenerationMessage" class =" flex items-center justify-center gap-2 text-white text-sm" >
14+ <span class =" w-3 h-3 bg-white rounded-sm" />
15+ {{ $t('Stop') }}
16+ </div >
1317 <Spinner v-else class="w-4 h-4 text-lightButtonsText dark:text-darkButtonsText fill-lightButtonsBackground dark:fill-darkPrimary " />
1418 </div >
1519
@@ -44,6 +48,7 @@ agentStore.registerOnBeforeChatCloseCallback(async () => {
4448
4549const showAnimation = ref (false );
4650const showButtonSpinner = ref (false );
51+ const showStopGenerationMessage = ref (false );
4752const hideAnimationDebounced = debounce (() => {
4853 showAnimation .value = false ;
4954}, 100 );
@@ -55,9 +60,11 @@ const isAudioChatMode = computed(() => agentStore.isAudioChatMode);
5560
5661watch (isStreamingResponse , (newVal ) => {
5762 if (! newVal ) {
63+ showStopGenerationMessage .value = false ;
5864 showButtonSpinner .value = false ;
5965 } else {
6066 showButtonSpinner .value = true ;
67+ showStopGenerationMessage .value = true ;
6168 }
6269})
6370
@@ -92,6 +99,7 @@ function resetAll() {
9299 stopGenerationAndAudio ();
93100 showAnimation .value = false ;
94101 showButtonSpinner .value = false ;
102+ showStopGenerationMessage .value = false ;
95103 hideAnimationDebounced .cancel ();
96104 sendUserRecordDebounced .cancel ();
97105}
0 commit comments