Skip to content

Commit e94b3ef

Browse files
committed
polish
1 parent 5fe4218 commit e94b3ef

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/vs/workbench/contrib/chat/browser/chatWidget.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ export interface IChatWidgetStyles {
5353
resultEditorBackground: string;
5454
}
5555

56+
const CHAT_RESPONSE_PENDING_AUDIO_CUE_LOOP_MS = 7000;
57+
5658
export class ChatWidget extends Disposable implements IChatWidget {
5759
public static readonly CONTRIBS: { new(...args: [IChatWidget, ...any]): any }[] = [];
5860

@@ -391,13 +393,14 @@ export class ChatWidget extends Disposable implements IChatWidget {
391393
return;
392394
}
393395
this.audioCueService.playAudioCue(AudioCue.chatRequestSent, true);
396+
const responsePendingAudioCue = this.audioCueService.playAudioCueLoop(AudioCue.chatResponsePending, CHAT_RESPONSE_PENDING_AUDIO_CUE_LOOP_MS);
394397
const input = query ?? editorValue;
395-
const cue = this.audioCueService.playAudioCueLoop(AudioCue.chatResponsePending, 7000);
396398
const result = await this.chatService.sendRequest(this.viewModel.sessionId, input);
399+
397400
if (result) {
398401
this.inputPart.acceptInput(query);
399402
result.responseCompletePromise.then(async () => {
400-
cue?.dispose();
403+
responsePendingAudioCue?.dispose();
401404
this.audioCueService.playRandomAudioCue(AudioCueGroupId.chatResponseReceived, true);
402405
const responses = this.viewModel?.getItems().filter(isResponseVM);
403406
const lastResponse = responses?.[responses.length - 1];

0 commit comments

Comments
 (0)