Merge pull request #186445 from microsoft/merogge/fix-time

play cue after response takes 1 second to bypass user gesture rule
This commit is contained in:
Megan Rogge 2023-06-28 06:32:16 -07:00 committed by GitHub
commit 44de2d0c2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -39,7 +39,7 @@ export function getAccessibilityHelpText(accessor: ServicesAccessor, type: 'pane
content.push(localize('inlineChat.explain', "When a request is prefixed with /explain, a response will explain the code in the current selection and the chat view will be focused."));
content.push(localize('inlineChat.toolbar', "Use tab to reach conditional parts like commands, status, message responses and more."));
}
content.push(localize('chat.audioCues', "Audio cues can be changed via settings with a prefix of audioCues.chat. By default, if a request takes more than 5 seconds, you will hear an audio cue indicating that progress is still occurring."));
content.push(localize('chat.audioCues', "Audio cues can be changed via settings with a prefix of audioCues.chat. By default, if a request takes more than a second, you will hear an audio cue indicating that progress is still occurring."));
return content.join('\n');
}

View file

@ -11,6 +11,7 @@ import { IChatAccessibilityService } from 'vs/workbench/contrib/chat/browser/cha
import { IChatResponseViewModel } from 'vs/workbench/contrib/chat/common/chatViewModel';
const CHAT_RESPONSE_PENDING_AUDIO_CUE_LOOP_MS = 5000;
const CHAT_RESPONSE_PENDING_ALLOWANCE_MS = 1000;
export class ChatAccessibilityService extends Disposable implements IChatAccessibilityService {
declare readonly _serviceBrand: undefined;
@ -25,7 +26,7 @@ export class ChatAccessibilityService extends Disposable implements IChatAccessi
if (!this._hasReceivedRequest) {
this._responsePendingAudioCue = this._audioCueService.playAudioCueLoop(AudioCue.chatResponsePending, CHAT_RESPONSE_PENDING_AUDIO_CUE_LOOP_MS);
}
}, CHAT_RESPONSE_PENDING_AUDIO_CUE_LOOP_MS));
}, CHAT_RESPONSE_PENDING_ALLOWANCE_MS));
}
acceptRequest(): void {
this._audioCueService.playAudioCue(AudioCue.chatRequestSent, true);