mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
* Fix #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 <megan.rogge@microsoft.com> Co-authored-by: Megan Rogge <merogge@microsoft.com>
This commit is contained in:
parent
cc77912561
commit
81bb68fed1
|
@ -11,7 +11,8 @@ export const enum AccessibilityVerbositySettingId {
|
|||
Terminal = 'accessibility.verbosity.terminal',
|
||||
DiffEditor = 'accessibility.verbosity.diff-editor',
|
||||
Chat = 'accessibility.verbosity.chat',
|
||||
InteractiveEditor = 'accessibility.verbosity.interactiveEditor'
|
||||
InteractiveEditor = 'accessibility.verbosity.interactiveEditor',
|
||||
KeybindingsEditor = 'accessibility.verbosity.keybindingsEditor'
|
||||
}
|
||||
|
||||
const configuration: IConfigurationNode = {
|
||||
|
@ -42,6 +43,12 @@ const configuration: IConfigurationNode = {
|
|||
type: 'boolean',
|
||||
default: true,
|
||||
tags: ['accessibility']
|
||||
},
|
||||
[AccessibilityVerbositySettingId.KeybindingsEditor]: {
|
||||
description: localize('verbosity.keybindingsEditor.description', 'Provide information about how to change a keybinding in the keybindings editor when a row is focused'),
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
tags: ['accessibility']
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -54,6 +54,8 @@ import { isString } from 'vs/base/common/types';
|
|||
import { SuggestEnabledInput } from 'vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput';
|
||||
import { CompletionItemKind } from 'vs/editor/common/languages';
|
||||
import { settingsTextInputBorder } from 'vs/workbench/contrib/preferences/common/settingsEditorColorRegistry';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { AccessibilityVerbositySettingId } from 'vs/workbench/contrib/accessibility/browser/accessibilityContribution';
|
||||
|
||||
const $ = DOM.$;
|
||||
|
||||
|
@ -112,7 +114,8 @@ export class KeybindingsEditor extends EditorPane implements IKeybindingsEditorP
|
|||
@IClipboardService private readonly clipboardService: IClipboardService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@IStorageService storageService: IStorageService
|
||||
@IStorageService storageService: IStorageService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService
|
||||
) {
|
||||
super(KeybindingsEditor.ID, telemetryService, themeService, storageService);
|
||||
this.delayedFiltering = new Delayer<void>(300);
|
||||
|
@ -474,7 +477,7 @@ export class KeybindingsEditor extends EditorPane implements IKeybindingsEditorP
|
|||
{
|
||||
identityProvider: { getId: (e: IKeybindingItemEntry) => e.id },
|
||||
horizontalScrolling: false,
|
||||
accessibilityProvider: new AccessibilityProvider(),
|
||||
accessibilityProvider: new AccessibilityProvider(this.configurationService),
|
||||
keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: (e: IKeybindingItemEntry) => e.keybindingItem.commandLabel || e.keybindingItem.command },
|
||||
overrideStyles: {
|
||||
listBackground: editorBackground
|
||||
|
@ -1178,6 +1181,8 @@ class WhenColumnRenderer implements ITableRenderer<IKeybindingItemEntry, IWhenCo
|
|||
|
||||
class AccessibilityProvider implements IListAccessibilityProvider<IKeybindingItemEntry> {
|
||||
|
||||
constructor(private readonly configurationService: IConfigurationService) { }
|
||||
|
||||
getWidgetAriaLabel(): string {
|
||||
return localize('keybindingsLabel', "Keybindings");
|
||||
}
|
||||
|
@ -1187,6 +1192,7 @@ class AccessibilityProvider implements IListAccessibilityProvider<IKeybindingIte
|
|||
ariaLabel += ', ' + (keybindingItemEntry.keybindingItem.keybinding?.getAriaLabel() || localize('noKeybinding', "No Keybinding assigned."));
|
||||
ariaLabel += ', ' + keybindingItemEntry.keybindingItem.when ? keybindingItemEntry.keybindingItem.when : localize('noWhen', "No when context.");
|
||||
ariaLabel += ', ' + (isString(keybindingItemEntry.keybindingItem.source) ? keybindingItemEntry.keybindingItem.source : keybindingItemEntry.keybindingItem.source.description ?? keybindingItemEntry.keybindingItem.source.identifier.value);
|
||||
ariaLabel += this.configurationService.getValue(AccessibilityVerbositySettingId.KeybindingsEditor) ? localize('keyboard shortcuts arial label', ", use space or enter to change the keybinding.") : '';
|
||||
return ariaLabel;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue