Skip to content

Commit

Permalink
fix #210590
Browse files Browse the repository at this point in the history
  • Loading branch information
meganrogge committed Apr 18, 2024
1 parent e20f630 commit 7b49653
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
Expand Up @@ -311,7 +311,6 @@ export class Sound {
public static readonly diffLineDeleted = Sound.register({ fileName: 'diffLineDeleted.mp3' });
public static readonly diffLineModified = Sound.register({ fileName: 'diffLineModified.mp3' });
public static readonly chatRequestSent = Sound.register({ fileName: 'chatRequestSent.mp3' });
public static readonly chatResponsePending = Sound.register({ fileName: 'chatResponsePending.mp3' });
public static readonly chatResponseReceived1 = Sound.register({ fileName: 'chatResponseReceived1.mp3' });
public static readonly chatResponseReceived2 = Sound.register({ fileName: 'chatResponseReceived2.mp3' });
public static readonly chatResponseReceived3 = Sound.register({ fileName: 'chatResponseReceived3.mp3' });
Expand All @@ -321,6 +320,7 @@ export class Sound {
public static readonly format = Sound.register({ fileName: 'format.mp3' });
public static readonly voiceRecordingStarted = Sound.register({ fileName: 'voiceRecordingStarted.mp3' });
public static readonly voiceRecordingStopped = Sound.register({ fileName: 'voiceRecordingStopped.mp3' });
public static readonly progress = Sound.register({ fileName: 'progress.mp3' });

private constructor(public readonly fileName: string) { }
}
Expand Down Expand Up @@ -359,7 +359,7 @@ export const enum AccessibilityAlertSettingId {
OnDebugBreak = 'accessibility.alert.onDebugBreak',
NoInlayHints = 'accessibility.alert.noInlayHints',
LineHasBreakpoint = 'accessibility.alert.lineHasBreakpoint',
ChatResponsePending = 'accessibility.alert.chatResponsePending'
Progress = 'accessibility.alert.chatResponseProgress'
}


Expand Down Expand Up @@ -553,13 +553,13 @@ export class AccessibilitySignal {
settingsKey: 'accessibility.signals.chatResponseReceived'
});

public static readonly chatResponsePending = AccessibilitySignal.register({
name: localize('accessibilitySignals.chatResponsePending', 'Chat Response Pending'),
sound: Sound.chatResponsePending,
public static readonly progress = AccessibilitySignal.register({
name: localize('accessibilitySignals.progress', 'Progress'),
sound: Sound.progress,
legacySoundSettingsKey: 'audioCues.chatResponsePending',
legacyAnnouncementSettingsKey: AccessibilityAlertSettingId.ChatResponsePending,
announcementMessage: localize('accessibility.signals.chatResponsePending', 'Chat Response Pending'),
settingsKey: 'accessibility.signals.chatResponsePending'
legacyAnnouncementSettingsKey: AccessibilityAlertSettingId.Progress,
announcementMessage: localize('accessibility.signals.progress', 'Progress'),
settingsKey: 'accessibility.signals.progress'
});

public static readonly clear = AccessibilitySignal.register({
Expand Down
Expand Up @@ -18,7 +18,7 @@ export class AccessibilityProgressSignalScheduler extends Disposable {
constructor(msDelayTime: number, msLoopTime: number | undefined, @IAccessibilitySignalService private readonly _accessibilitySignalService: IAccessibilitySignalService) {
super();
this._scheduler = new RunOnceScheduler(() => {
this._signalLoop = this._accessibilitySignalService.playSignalLoop(AccessibilitySignal.chatResponsePending, msLoopTime ?? PROGRESS_SIGNAL_LOOP_DELAY);
this._signalLoop = this._accessibilitySignalService.playSignalLoop(AccessibilitySignal.progress, msLoopTime ?? PROGRESS_SIGNAL_LOOP_DELAY);
}, msDelayTime);
this._scheduler.schedule();
}
Expand Down
Expand Up @@ -257,8 +257,8 @@ const configuration: IConfigurationNode = {
'markdownDescription': localize('announcement.chatRequestSent', "Indicates when a chat request is sent. Also see {0}.", '`#audioCues.chatRequestSent#`'),
...baseAlertProperty
},
[AccessibilityAlertSettingId.ChatResponsePending]: {
'markdownDescription': localize('announcement.chatResponsePending', "Indicates when a chat response is pending. Also see {0}.", '`#audioCues.chatResponsePending#`'),
[AccessibilityAlertSettingId.Progress]: {
'markdownDescription': localize('announcement.progress', "Indicates when a chat response is pending. Also see {0}.", '`#audioCues.chatResponsePending#`'),
...baseAlertProperty
},
[AccessibilityAlertSettingId.NoInlayHints]: {
Expand Down Expand Up @@ -540,16 +540,16 @@ const configuration: IConfigurationNode = {
},
}
},
'accessibility.signals.chatResponsePending': {
'accessibility.signals.progress': {
...signalFeatureBase,
'description': localize('accessibility.signals.chatResponsePending', "Plays a signal on loop while the response is pending."),
'description': localize('accessibility.signals.progress', "Plays a signal on loop while progress is occurring."),
'properties': {
'sound': {
'description': localize('accessibility.signals.chatResponsePending.sound', "Plays a sound on loop while the response is pending."),
'description': localize('accessibility.signals.progress.sound', "Plays a sound on loop while progress is occurring."),
...soundFeatureBase
},
'announcement': {
'description': localize('accessibility.signals.chatResponsePending.announcement', "Alerts on loop while the response is pending."),
'description': localize('accessibility.signals.progress.announcement', "Alerts on loop while progress is occurring."),
...announcementFeatureBase
},
},
Expand Down Expand Up @@ -790,6 +790,18 @@ Registry.as<IConfigurationMigrationRegistry>(WorkbenchExtensions.ConfigurationMi
}
}]);


Registry.as<IConfigurationMigrationRegistry>(WorkbenchExtensions.ConfigurationMigration)
.registerConfigurationMigrations([{
key: 'accessibility.signals.chatResponsePending',
migrateFn: (value, accessor) => {
return [
['accessibility.signals.progress', { value }],
['accessibility.signals.chatResponsePending', { value: undefined }],
];
}
}]);

Registry.as<IConfigurationMigrationRegistry>(WorkbenchExtensions.ConfigurationMigration)
.registerConfigurationMigrations(AccessibilitySignal.allAccessibilitySignals.map(item => ({
key: item.legacySoundSettingsKey,
Expand Down

0 comments on commit 7b49653

Please sign in to comment.