Skip to content

Commit 8b9f999

Browse files
committed
add hint to aria label
1 parent ac813b6 commit 8b9f999

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export interface IAccessibleViewService {
5353
* If the setting is enabled, provides the open accessible view hint as a localized string.
5454
* @param verbositySettingKey The setting key for the verbosity of the feature
5555
*/
56-
getOpenAriaHint(verbositySettingKey: AccessibilityVerbositySettingId): string | undefined;
56+
getOpenAriaHint(verbositySettingKey: AccessibilityVerbositySettingId): string | null;
5757
}
5858

5959
export const enum AccessibleViewType {
@@ -279,15 +279,11 @@ export class AccessibleViewService extends Disposable implements IAccessibleView
279279
previous(): void {
280280
this._accessibleView?.previous();
281281
}
282-
getOpenAriaHint(verbositySettingKey: AccessibilityVerbositySettingId): string | undefined {
282+
getOpenAriaHint(verbositySettingKey: AccessibilityVerbositySettingId): string | null {
283283
if (!this._configurationService.getValue(verbositySettingKey)) {
284-
return;
284+
return null;
285285
}
286-
let hint = '';
287286
const keybinding = this._keybindingService.lookupKeybinding(AccessibleViewAction.id)?.getAriaLabel();
288-
if (this._configurationService.getValue(verbositySettingKey)) {
289-
hint = keybinding ? localize('chatAccessibleViewHint', "Inspect this in the accessible view with {0}", keybinding) : localize('chatAccessibleViewHintNoKb', "Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding");
290-
}
291-
return hint;
287+
return keybinding ? localize('chatAccessibleViewHint', "Inspect this in the accessible view with {0}", keybinding) : localize('chatAccessibleViewHintNoKb', "Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding");
292288
}
293289
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import * as aria from 'vs/base/browser/ui/aria/aria';
5151
import { IMenuWorkbenchButtonBarOptions, MenuWorkbenchButtonBar } from 'vs/platform/actions/browser/buttonbar';
5252
import { SlashCommandContentWidget } from 'vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget';
5353
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
54+
import { IAccessibleViewService } from 'vs/workbench/contrib/accessibility/browser/accessibleView';
5455

5556
const defaultAriaLabel = localize('aria-label', "Inline Chat Input");
5657

@@ -199,6 +200,7 @@ export class InlineChatWidget {
199200
@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,
200201
@IConfigurationService private readonly _configurationService: IConfigurationService,
201202
@IContextMenuService private readonly _contextMenuService: IContextMenuService,
203+
@IAccessibleViewService private readonly _accessibleViewService: IAccessibleViewService
202204
) {
203205

204206
// input editor logic
@@ -364,6 +366,7 @@ export class InlineChatWidget {
364366
this._previewCreateEditor = new IdleValue(() => this._store.add(_instantiationService.createInstance(EmbeddedCodeEditorWidget, this._elements.previewCreate, _previewEditorEditorOptions, codeEditorWidgetOptions, parentEditor)));
365367

366368
this._elements.message.tabIndex = 0;
369+
this._elements.message.ariaLabel = this._accessibleViewService.getOpenAriaHint(AccessibilityVerbositySettingId.InlineChat);
367370
this._elements.statusLabel.tabIndex = 0;
368371
const markdownMessageToolbar = this._instantiationService.createInstance(MenuWorkbenchToolBar, this._elements.messageActions, MENU_INLINE_CHAT_WIDGET_MARKDOWN_MESSAGE, workbenchToolbarOptions);
369372
this._store.add(markdownMessageToolbar.onDidChangeMenuItems(() => this._onDidChangeHeight.fire()));

0 commit comments

Comments
 (0)