mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
Fix progress sound for backgrounded session re-entry (#286428)
This commit is contained in:
@@ -63,8 +63,10 @@ export class ChatAccessibilityService extends Disposable implements IChatAccessi
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
acceptRequest(uri: URI): void {
|
||||
this._accessibilitySignalService.playSignal(AccessibilitySignal.chatRequestSent, { allowManyInParallel: true });
|
||||
acceptRequest(uri: URI, skipRequestSignal?: boolean): void {
|
||||
if (!skipRequestSignal) {
|
||||
this._accessibilitySignalService.playSignal(AccessibilitySignal.chatRequestSent, { allowManyInParallel: true });
|
||||
}
|
||||
this._pendingSignalMap.set(uri, this._instantiationService.createInstance(AccessibilityProgressSignalScheduler, CHAT_RESPONSE_PENDING_ALLOWANCE_MS, undefined));
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ export interface IQuickChatOpenOptions {
|
||||
export const IChatAccessibilityService = createDecorator<IChatAccessibilityService>('chatAccessibilityService');
|
||||
export interface IChatAccessibilityService {
|
||||
readonly _serviceBrand: undefined;
|
||||
acceptRequest(uri: URI): void;
|
||||
acceptRequest(uri: URI, skipRequestSignal?: boolean): void;
|
||||
disposeRequest(requestId: URI): void;
|
||||
acceptResponse(widget: ChatWidget, container: HTMLElement, response: IChatResponseViewModel | string | undefined, requestId: URI | undefined, isVoiceInput?: boolean): void;
|
||||
acceptElicitation(message: IChatElicitationRequest): void;
|
||||
|
||||
@@ -301,6 +301,11 @@ export class ChatWidget extends Disposable implements IChatWidget {
|
||||
if (viewModel) {
|
||||
this.viewModelDisposables.add(viewModel);
|
||||
this.logService.debug('ChatWidget#setViewModel: have viewModel');
|
||||
|
||||
// If switching to a model with a request in progress, play progress sound
|
||||
if (viewModel.model.requestInProgress.get()) {
|
||||
this.chatAccessibilityService.acceptRequest(viewModel.sessionResource, true);
|
||||
}
|
||||
} else {
|
||||
this.logService.debug('ChatWidget#setViewModel: no viewModel');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user