Skip to content

Commit 345ef68

Browse files
committed
fix 185127
1 parent 4148d30 commit 345ef68

File tree

7 files changed

+23
-16
lines changed

7 files changed

+23
-16
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class AccessibilityHelpProvider extends Disposable implements IAccessibleContent
3737
this._editor.focus();
3838
this.dispose();
3939
}
40-
options: IAccessibleViewOptions = { ariaLabel: localize('terminal-help-label', "terminal accessibility help") };
40+
options: IAccessibleViewOptions = { isHelpMenu: true, ariaLabel: localize('terminal-help-label', "terminal accessibility help") };
4141
id: string = 'editor';
4242
onKeyDown(e: IKeyboardEvent): void {
4343
if (e.keyCode === KeyCode.KeyH) {
@@ -141,7 +141,7 @@ class HoverAccessibileViewContribution extends Disposable {
141141
static ID: 'hoverAccessibleViewContribution';
142142
constructor() {
143143
super();
144-
this._register(AccessibilityViewAction.addImplementation(105, 'hover', accessor => {
144+
this._register(AccessibilityViewAction.addImplementation(90, 'hover', accessor => {
145145
const accessibleViewService = accessor.get(IAccessibleViewService);
146146
const codeEditorService = accessor.get(ICodeEditorService);
147147
const editor = codeEditorService.getActiveCodeEditor() || codeEditorService.getFocusedCodeEditor();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis
1313
export const enum AccessibilityVerbositySettingId {
1414
Terminal = 'accessibility.verbosity.terminal',
1515
DiffEditor = 'accessibility.verbosity.diffEditor',
16-
Chat = 'accessibility.verbosity.chat',
16+
Chat = 'accessibility.verbosity.panelChat',
1717
InlineChat = 'accessibility.verbosity.inlineChat',
1818
KeybindingsEditor = 'accessibility.verbosity.keybindingsEditor',
1919
Notebook = 'accessibility.verbosity.notebook'

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ export interface IAccessibleViewService {
4444

4545
export interface IAccessibleViewOptions {
4646
ariaLabel: string;
47+
isHelpMenu?: boolean;
4748
}
4849

50+
4951
class AccessibleView extends Disposable {
5052
private _editorWidget: CodeEditorWidget;
5153
get editorWidget() { return this._editorWidget; }
@@ -95,8 +97,11 @@ class AccessibleView extends Disposable {
9597
}
9698

9799
private _render(provider: IAccessibleContentProvider, container: HTMLElement): IDisposable {
100+
const settingKey = `accessibility.verbosity.${provider.id}`;
101+
const value = this._configurationService.getValue(settingKey);
98102

99-
const fragment = provider.provideContent() + localize('exit-tip', 'Exit this menu via the Escape key.\n');
103+
const disableHelpHint = provider.options.isHelpMenu && value ? localize('disable-help-hint', '\nTo disable the `accessibility.verbosity` hint for this feature, press D now.\n') : '\n';
104+
const fragment = provider.provideContent() + disableHelpHint + localize('exit-tip', 'Exit this menu via the Escape key.');
100105

101106
this._getTextModel(URI.from({ path: `accessible-view-${provider.id}`, scheme: 'accessible-view', fragment })).then((model) => {
102107
if (!model) {
@@ -112,6 +117,8 @@ class AccessibleView extends Disposable {
112117
this._register(this._editorWidget.onKeyUp((e) => {
113118
if (e.keyCode === KeyCode.Escape) {
114119
this._contextViewService.hideContextView();
120+
} else if (e.keyCode === KeyCode.KeyD) {
121+
this._configurationService.updateValue(settingKey, false);
115122
}
116123
e.stopPropagation();
117124
provider.onKeyDown?.(e);

src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import { InlineChatController } from 'vs/workbench/contrib/inlineChat/browser/in
1616

1717
const inputBox = localize('chat.requestHistory', 'In the input box, use up and down arrows to navigate your request history. Edit input and use enter or the submit button to run a new request.');
1818

19-
export function getAccessibilityHelpText(accessor: ServicesAccessor, type: 'chat' | 'inline'): string {
19+
export function getAccessibilityHelpText(accessor: ServicesAccessor, type: 'panelChat' | 'inlineChat'): string {
2020
const keybindingService = accessor.get(IKeybindingService);
2121
const content = [];
22-
if (type === 'chat') {
22+
if (type === 'panelChat') {
2323
content.push(localize('chat.overview', 'The chat view is comprised of an input box and a request/response list. The input box is used to make requests and the list is used to display responses.'));
2424
content.push(inputBox);
2525
content.push(localize('chat.announcement', 'Chat responses will be announced as they come in. A response will indicate the number of code blocks, if any, and then the rest of the response.'));
@@ -50,10 +50,10 @@ function descriptionForCommand(commandId: string, msg: string, noKbMsg: string,
5050
return format(noKbMsg, commandId);
5151
}
5252

53-
export async function runAccessibilityHelpAction(accessor: ServicesAccessor, editor: ICodeEditor, type: 'chat' | 'inline'): Promise<void> {
53+
export async function runAccessibilityHelpAction(accessor: ServicesAccessor, editor: ICodeEditor, type: 'panelChat' | 'inlineChat'): Promise<void> {
5454
const widgetService = accessor.get(IChatWidgetService);
5555
const accessibleViewService = accessor.get(IAccessibleViewService);
56-
const inputEditor: ICodeEditor | undefined = type === 'chat' ? widgetService.lastFocusedWidget?.inputEditor : editor;
56+
const inputEditor: ICodeEditor | undefined = type === 'panelChat' ? widgetService.lastFocusedWidget?.inputEditor : editor;
5757
const editorUri = editor.getModel()?.uri;
5858

5959
if (!inputEditor || !editorUri) {
@@ -71,15 +71,15 @@ export async function runAccessibilityHelpAction(accessor: ServicesAccessor, edi
7171
id: type,
7272
provideContent: () => helpText,
7373
onClose: () => {
74-
if (type === 'chat' && cachedPosition) {
74+
if (type === 'panelChat' && cachedPosition) {
7575
inputEditor.setPosition(cachedPosition);
7676
inputEditor.focus();
77-
} else if (type === 'inline') {
77+
} else if (type === 'inlineChat') {
7878
InlineChatController.get(editor)?.focus();
7979
}
8080
provider.dispose();
8181
},
82-
options: { ariaLabel: type === 'chat' ? localize('chat-help-label', "Chat accessibility help") : localize('inline-chat-label', "Inline chat accessibility help") }
82+
options: { isHelpMenu: true, ariaLabel: type === 'panelChat' ? localize('chat-help-label', "Chat accessibility help") : localize('inline-chat-label', "Inline chat accessibility help") }
8383
});
8484
accessibleViewService.show(type);
8585
}

src/vs/workbench/contrib/chat/browser/actions/chatActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ export function registerChatActions() {
102102
static ID: 'chatAccessibilityHelpContribution';
103103
constructor() {
104104
super();
105-
this._register(AccessibilityHelpAction.addImplementation(105, 'chat', async accessor => {
105+
this._register(AccessibilityHelpAction.addImplementation(105, 'panelChat', async accessor => {
106106
const codeEditor = accessor.get(ICodeEditorService).getActiveCodeEditor() || accessor.get(ICodeEditorService).getFocusedCodeEditor();
107107
if (!codeEditor) {
108108
return;
109109
}
110-
runAccessibilityHelpAction(accessor, codeEditor, 'chat');
110+
runAccessibilityHelpAction(accessor, codeEditor, 'panelChat');
111111
}, CONTEXT_IN_CHAT_INPUT));
112112
}
113113
}

src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,12 +619,12 @@ export class ContractMessageAction extends AbstractInlineChatAction {
619619
export class InlineAccessibilityHelpContribution extends Disposable {
620620
constructor() {
621621
super();
622-
this._register(AccessibilityHelpAction.addImplementation(106, 'inline-chat', async accessor => {
622+
this._register(AccessibilityHelpAction.addImplementation(106, 'inlineChat', async accessor => {
623623
const codeEditor = accessor.get(ICodeEditorService).getActiveCodeEditor() || accessor.get(ICodeEditorService).getFocusedCodeEditor();
624624
if (!codeEditor) {
625625
return;
626626
}
627-
runAccessibilityHelpAction(accessor, codeEditor, 'inline');
627+
runAccessibilityHelpAction(accessor, codeEditor, 'inlineChat');
628628
}, CTX_INLINE_CHAT_FOCUSED));
629629
}
630630
}

src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibilityHelp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class TerminalAccessibleContentProvider extends Disposable implements IAc
2929
this._instance.focus();
3030
this.dispose();
3131
}
32-
options: IAccessibleViewOptions = { ariaLabel: localize('terminal-help-label', "terminal accessibility help") };
32+
options: IAccessibleViewOptions = { isHelpMenu: true, ariaLabel: localize('terminal-help-label', "terminal accessibility help") };
3333
id: string = 'terminal';
3434

3535
constructor(

0 commit comments

Comments
 (0)