Skip to content

Commit 21353cf

Browse files
authored
Improve help dialog wording for activeEditorState inclusion (microsoft#242246)
fixes microsoft#242244
1 parent 7e84e80 commit 21353cf

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/vs/editor/common/standaloneStrings.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export namespace AccessibilityHelpNLS {
1212
export const editableDiffEditor = nls.localize("editableDiffEditor", "You are in a pane of a diff editor.");
1313
export const readonlyEditor = nls.localize("readonlyEditor", "You are in a read-only code editor.");
1414
export const editableEditor = nls.localize("editableEditor", "You are in a code editor.");
15-
export const activeEditorState = nls.localize("activeEditorState", "Get information about the active editor such as Modified, Problems, and more by setting activeEditorState as a part of the window.title setting.");
15+
export const defaultWindowTitleIncludesEditorState = nls.localize("defaultWindowTitleIncludesEditorState", "activeEditorState - such as modified, problems, and more, is included as a part of the window.title setting by default. Disable it with accessibility.windowTitleOptimized.");
16+
export const defaultWindowTitleExcludingEditorState = nls.localize("defaultWindowTitleExcludingEditorState", "activeEditorState - such as modified, problems, and more, is currently not included as a part of the window.title setting by default. Enable it with accessibility.windowTitleOptimized.");
1617
export const toolbar = nls.localize("toolbar", "Around the workbench, when the screen reader announces you've landed in a toolbar, use narrow keys to navigate between the toolbar's actions.");
1718
export const changeConfigToOnMac = nls.localize("changeConfigToOnMac", "Configure the application to be optimized for usage with a Screen Reader (Command+E).");
1819
export const changeConfigToOnWinLinux = nls.localize("changeConfigToOnWinLinux", "Configure the application to be optimized for usage with a Screen Reader (Control+E).");

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import { NEW_UNTITLED_FILE_COMMAND_ID } from '../../files/browser/fileConstants.
2020
import { IAccessibleViewService, IAccessibleViewContentProvider, AccessibleViewProviderId, IAccessibleViewOptions, AccessibleViewType } from '../../../../platform/accessibility/browser/accessibleView.js';
2121
import { AccessibilityVerbositySettingId } from './accessibilityConfiguration.js';
2222
import { ctxHasEditorModification, ctxHasRequestInProgress } from '../../chat/browser/chatEditing/chatEditingEditorContextKeys.js';
23+
import { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.js';
24+
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
2325

2426
export class EditorAccessibilityHelpContribution extends Disposable {
2527
static ID: 'editorAccessibilityHelpContribution';
@@ -50,7 +52,9 @@ class EditorAccessibilityHelpProvider extends Disposable implements IAccessibleV
5052
constructor(
5153
private readonly _editor: ICodeEditor,
5254
@IKeybindingService private readonly _keybindingService: IKeybindingService,
53-
@IContextKeyService private readonly _contextKeyService: IContextKeyService
55+
@IContextKeyService private readonly _contextKeyService: IContextKeyService,
56+
@IAccessibilityService private readonly accessibilityService: IAccessibilityService,
57+
@IConfigurationService private readonly _configurationService: IConfigurationService,
5458
) {
5559
super();
5660
}
@@ -72,7 +76,11 @@ class EditorAccessibilityHelpProvider extends Disposable implements IAccessibleV
7276
content.push(AccessibilityHelpNLS.editableEditor);
7377
}
7478
}
75-
content.push(AccessibilityHelpNLS.activeEditorState);
79+
if (this.accessibilityService.isScreenReaderOptimized() && this._configurationService.getValue('accessibility.windowTitleOptimized')) {
80+
content.push(AccessibilityHelpNLS.defaultWindowTitleIncludesEditorState);
81+
} else {
82+
content.push(AccessibilityHelpNLS.defaultWindowTitleExcludingEditorState);
83+
}
7684
content.push(AccessibilityHelpNLS.toolbar);
7785

7886
const chatEditInfo = getChatEditInfo(this._keybindingService, this._contextKeyService, this._editor);

0 commit comments

Comments
 (0)