Skip to content

Commit 81bb68f

Browse files
sandy081meganrogge
andauthored
* Fix microsoft#182491 * apply to aria label, add setting * revert unrelated changes * Update src/vs/workbench/contrib/terminal/browser/terminalService.ts * Update src/vs/workbench/contrib/terminal/browser/terminalService.ts --------- Co-authored-by: meganrogge <[email protected]> Co-authored-by: Megan Rogge <[email protected]>
1 parent cc77912 commit 81bb68f

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/vs/workbench/contrib/accessibility/browser/accessibilityContribution.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export const enum AccessibilityVerbositySettingId {
1111
Terminal = 'accessibility.verbosity.terminal',
1212
DiffEditor = 'accessibility.verbosity.diff-editor',
1313
Chat = 'accessibility.verbosity.chat',
14-
InteractiveEditor = 'accessibility.verbosity.interactiveEditor'
14+
InteractiveEditor = 'accessibility.verbosity.interactiveEditor',
15+
KeybindingsEditor = 'accessibility.verbosity.keybindingsEditor'
1516
}
1617

1718
const configuration: IConfigurationNode = {
@@ -42,6 +43,12 @@ const configuration: IConfigurationNode = {
4243
type: 'boolean',
4344
default: true,
4445
tags: ['accessibility']
46+
},
47+
[AccessibilityVerbositySettingId.KeybindingsEditor]: {
48+
description: localize('verbosity.keybindingsEditor.description', 'Provide information about how to change a keybinding in the keybindings editor when a row is focused'),
49+
type: 'boolean',
50+
default: true,
51+
tags: ['accessibility']
4552
}
4653
}
4754
};

src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ import { isString } from 'vs/base/common/types';
5454
import { SuggestEnabledInput } from 'vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput';
5555
import { CompletionItemKind } from 'vs/editor/common/languages';
5656
import { settingsTextInputBorder } from 'vs/workbench/contrib/preferences/common/settingsEditorColorRegistry';
57+
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
58+
import { AccessibilityVerbositySettingId } from 'vs/workbench/contrib/accessibility/browser/accessibilityContribution';
5759

5860
const $ = DOM.$;
5961

@@ -112,7 +114,8 @@ export class KeybindingsEditor extends EditorPane implements IKeybindingsEditorP
112114
@IClipboardService private readonly clipboardService: IClipboardService,
113115
@IInstantiationService private readonly instantiationService: IInstantiationService,
114116
@IEditorService private readonly editorService: IEditorService,
115-
@IStorageService storageService: IStorageService
117+
@IStorageService storageService: IStorageService,
118+
@IConfigurationService private readonly configurationService: IConfigurationService
116119
) {
117120
super(KeybindingsEditor.ID, telemetryService, themeService, storageService);
118121
this.delayedFiltering = new Delayer<void>(300);
@@ -474,7 +477,7 @@ export class KeybindingsEditor extends EditorPane implements IKeybindingsEditorP
474477
{
475478
identityProvider: { getId: (e: IKeybindingItemEntry) => e.id },
476479
horizontalScrolling: false,
477-
accessibilityProvider: new AccessibilityProvider(),
480+
accessibilityProvider: new AccessibilityProvider(this.configurationService),
478481
keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: (e: IKeybindingItemEntry) => e.keybindingItem.commandLabel || e.keybindingItem.command },
479482
overrideStyles: {
480483
listBackground: editorBackground
@@ -1178,6 +1181,8 @@ class WhenColumnRenderer implements ITableRenderer<IKeybindingItemEntry, IWhenCo
11781181

11791182
class AccessibilityProvider implements IListAccessibilityProvider<IKeybindingItemEntry> {
11801183

1184+
constructor(private readonly configurationService: IConfigurationService) { }
1185+
11811186
getWidgetAriaLabel(): string {
11821187
return localize('keybindingsLabel', "Keybindings");
11831188
}
@@ -1187,6 +1192,7 @@ class AccessibilityProvider implements IListAccessibilityProvider<IKeybindingIte
11871192
ariaLabel += ', ' + (keybindingItemEntry.keybindingItem.keybinding?.getAriaLabel() || localize('noKeybinding', "No Keybinding assigned."));
11881193
ariaLabel += ', ' + keybindingItemEntry.keybindingItem.when ? keybindingItemEntry.keybindingItem.when : localize('noWhen', "No when context.");
11891194
ariaLabel += ', ' + (isString(keybindingItemEntry.keybindingItem.source) ? keybindingItemEntry.keybindingItem.source : keybindingItemEntry.keybindingItem.source.description ?? keybindingItemEntry.keybindingItem.source.identifier.value);
1195+
ariaLabel += this.configurationService.getValue(AccessibilityVerbositySettingId.KeybindingsEditor) ? localize('keyboard shortcuts arial label', ", use space or enter to change the keybinding.") : '';
11901196
return ariaLabel;
11911197
}
11921198
}

0 commit comments

Comments
 (0)