@@ -24,7 +24,7 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle
24
24
import { WorkbenchObjectTree } from 'vs/platform/list/browser/listService' ;
25
25
import { IViewsService } from 'vs/workbench/common/views' ;
26
26
import { clearChatSession } from 'vs/workbench/contrib/chat/browser/actions/chatClear' ;
27
- import { ChatTreeItem , IChatCodeBlockInfo , IChatWidget , IChatWidgetService , IChatWidgetViewContext } from 'vs/workbench/contrib/chat/browser/chat' ;
27
+ import { ChatTreeItem , IChatAccessibilityService , IChatCodeBlockInfo , IChatWidget , IChatWidgetService , IChatWidgetViewContext } from 'vs/workbench/contrib/chat/browser/chat' ;
28
28
import { ChatInputPart } from 'vs/workbench/contrib/chat/browser/chatInputPart' ;
29
29
import { ChatAccessibilityProvider , ChatListDelegate , ChatListItemRenderer , IChatRendererDelegate } from 'vs/workbench/contrib/chat/browser/chatListRenderer' ;
30
30
import { ChatEditorOptions } from 'vs/workbench/contrib/chat/browser/chatOptions' ;
@@ -108,8 +108,6 @@ export class ChatWidget extends Disposable implements IChatWidget {
108
108
private lastSlashCommands : ISlashCommand [ ] | undefined ;
109
109
private slashCommandsPromise : Promise < ISlashCommand [ ] | undefined > | undefined ;
110
110
111
- private _chatAccessibilityService : ChatAccessibilityService ;
112
-
113
111
constructor (
114
112
readonly viewContext : IChatWidgetViewContext ,
115
113
private readonly styles : IChatWidgetStyles ,
@@ -118,15 +116,13 @@ export class ChatWidget extends Disposable implements IChatWidget {
118
116
@IChatService private readonly chatService : IChatService ,
119
117
@IChatWidgetService chatWidgetService : IChatWidgetService ,
120
118
@IContextMenuService private readonly contextMenuService : IContextMenuService ,
121
- @IAudioCueService audioCueService : IAudioCueService
119
+ @IChatAccessibilityService private readonly _chatAccessibilityService : IChatAccessibilityService
122
120
) {
123
121
super ( ) ;
124
122
CONTEXT_IN_CHAT_SESSION . bindTo ( contextKeyService ) . set ( true ) ;
125
123
this . requestInProgress = CONTEXT_CHAT_REQUEST_IN_PROGRESS . bindTo ( contextKeyService ) ;
126
124
127
125
this . _register ( ( chatWidgetService as ChatWidgetService ) . register ( this ) ) ;
128
- this . _chatAccessibilityService = new ChatAccessibilityService ( audioCueService ) ;
129
- this . _register ( this . _chatAccessibilityService ) ;
130
126
}
131
127
132
128
get providerId ( ) : string {
@@ -511,9 +507,14 @@ export class ChatWidgetService implements IChatWidgetService {
511
507
}
512
508
}
513
509
510
+
514
511
const CHAT_RESPONSE_PENDING_AUDIO_CUE_LOOP_MS = 7000 ;
515
- class ChatAccessibilityService extends Disposable {
512
+ export class ChatAccessibilityService extends Disposable implements IChatAccessibilityService {
513
+
514
+ declare readonly _serviceBrand : undefined ;
515
+
516
516
private _responsePendingAudioCue : IDisposable | undefined ;
517
+
517
518
constructor ( @IAudioCueService private readonly _audioCueService : IAudioCueService ) {
518
519
super ( ) ;
519
520
}
@@ -523,10 +524,10 @@ class ChatAccessibilityService extends Disposable {
523
524
}
524
525
acceptResponse ( response ?: IChatResponseViewModel ) : void {
525
526
this . _responsePendingAudioCue ?. dispose ( ) ;
527
+ this . _audioCueService . playRandomAudioCue ( AudioCueGroupId . chatResponseReceived , true ) ;
526
528
if ( ! response ) {
527
529
return ;
528
530
}
529
- this . _audioCueService . playRandomAudioCue ( AudioCueGroupId . chatResponseReceived , true ) ;
530
531
const errorDetails = response . errorDetails ? ` ${ response . errorDetails . message } ` : '' ;
531
532
alert ( response . response . value + errorDetails ) ;
532
533
}
0 commit comments