Change:
has said that when switching between editors, it's unclear to him when a diff editor has been entered, though this is clear for sighted users. We should something like to fix this. cc
I think we announce whenever an editor gets focus. Each editor has a title that is announced. So I am not sure what is missing here? I would not like that we just add a new alert. Is the title of the diff editor not descriptive enough? Or is nothing getting announced (which would be a bug)
Good point, the file name is announced and says (Working Tree). is that sufficient to indicate this?
Closing for now, but will reopen based on your feedback
Just discussed with JooYoung and the redundant info is escaped/ignored by screen reader users, so we need to alert with this info
Should we consider a better announcement on focus of the text editor? how does this interact with the existing announcement?
Venkatesh observed that the editor title isn't being read at all, only the accessibility help hint, need to investigate that. EDIT: I explored and this works as expected.
Edit: we use already. This is working as expected. When a new file is opened, the title is read. When a user focuses the document, they hear the hint, if any, along with the "edit text, ...content". If that hint is disabled, they hear "edit text,...content"
which command do you use to switch between editor tabs? Is it ? I believe this issue is about when using that command, indicating if the focused editor is a diff editor via an .
What should I be looking for when verifying this?
Have some editor groups open, including ones with diff editors. Run the command . When a diff editor group is focused, you should hear "diff editor" announced by a screen reader. Disable that setting, and ensure you don't hear that. You should also hear it when navigating the open editors view. !
Using the Open Editors view, I don't see anything read about diff editors when I hit on a diff editor: !
Actually, I do see it when I toggle accessibility mode on

Discussion:
import { EditorAccessibilityHelpContribution } from 'vs/workbench/contrib/accessibility/browser/editorAccessibilityHelp'; import { SaveAccessibilitySignalContribution } from 'vs/workbench/contrib/accessibility/browser/saveAccessibilitySignal'; import { CommentsAccessibilityHelpContribution } from 'vs/workbench/contrib/comments/browser/commentsAccessibility'; <ins> import { DiffEditorActiveAnnouncementContribution } from 'vs/workbench/contrib/accessibility/browser/openDiffEditorAnnouncement'; </ins> registerAccessibilityConfiguration(); registerSingleton(IAccessibleViewService, AccessibleViewService, InstantiationType.Delayed);

registerWorkbenchContribution2(AccessibilityStatus.ID, AccessibilityStatus, WorkbenchPhase.BlockRestore); registerWorkbenchContribution2(SaveAccessibilitySignalContribution.ID, SaveAccessibilitySignalContribution, WorkbenchPhase.AfterRestored); <ins> registerWorkbenchContribution2(DiffEditorActiveAnnouncementContribution.ID, DiffEditorActiveAnnouncementContribution, WorkbenchPhase.AfterRestored); </ins> registerWorkbenchContribution2(DynamicSpeechAccessibilityConfiguration.ID, DynamicSpeechAccessibilityConfiguration, WorkbenchPhase.AfterRestored);

Hover = 'accessibility.verbosity.hover', Notification = 'accessibility.verbosity.notification', EmptyEditorHint = 'accessibility.verbosity.emptyEditorHint', <del> Comments = 'accessibility.verbosity.comments' </del> <ins> Comments = 'accessibility.verbosity.comments', DiffEditorActive = 'accessibility.verbosity.diffEditorActive' </ins> } export const enum AccessibleViewProviderId {

description: localize('verbosity.comments', 'Provide information about actions that can be taken in the comment widget or in a file which contains comments.'), ...baseVerbosityProperty }, <ins> [AccessibilityVerbositySettingId.DiffEditorActive]: { description: localize('verbosity.diffEditorActive', 'Indicate when a diff editor becomes the active editor.'), ...baseVerbosityProperty }, </ins> [AccessibilityAlertSettingId.Save]: { 'markdownDescription': localize('announcement.save', "Indicates when a file is saved. Also see {0}.", '`#audioCues.save#`'), 'enum': ['userGesture', 'always', 'never'],

<ins> /*--------------------------------------------------------------------------------------------- *  Copyright (c) Microsoft Corporation. All rights reserved. *  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; import { isDiffEditor } from 'vs/editor/browser/editorBrowser'; import { localize } from 'vs/nls'; import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { Event } from 'vs/base/common/event'; import { AccessibilityVerbositySettingId } from 'vs/workbench/contrib/accessibility/browser/accessibilityConfiguration'; export class DiffEditorActiveAnnouncementContribution extends Disposable implements IWorkbenchContribution { static readonly ID = 'workbench.contrib.diffEditorActiveAnnouncement'; private _onDidActiveEditorChangeListener?: IDisposable; constructor( @IEditorService private readonly _editorService: IEditorService, @IAccessibilityService private readonly _accessibilityService: IAccessibilityService, @IConfigurationService private readonly _configurationService: IConfigurationService ) { super(); this._register(Event.runAndSubscribe(_accessibilityService.onDidChangeScreenReaderOptimized, () => this._updateListener())); this._register(_configurationService.onDidChangeConfiguration(e => { if (e.affectsConfiguration(AccessibilityVerbositySettingId.DiffEditorActive)) { this._updateListener(); } })); } private _updateListener(): void { const announcementEnabled = this._configurationService.getValue(AccessibilityVerbositySettingId.DiffEditorActive); const screenReaderOptimized = this._accessibilityService.isScreenReaderOptimized(); if (!announcementEnabled || !screenReaderOptimized) { this._onDidActiveEditorChangeListener?.dispose(); this._onDidActiveEditorChangeListener = undefined; return; } if (this._onDidActiveEditorChangeListener) { return; } this._onDidActiveEditorChangeListener = this._register(this._editorService.onDidActiveEditorChange(() => { if (isDiffEditor(this._editorService.activeTextEditorControl)) { this._accessibilityService.alert(localize('openDiffEditorAnnouncement', "Diff editor")); } })); } } </ins>

switchSides = localize('switchSidesNoKb', "Run the command Diff Editor: Switch Side, which is currently not triggerable via keybinding, to toggle between the original and modified editors."); } <ins> const diffEditorActiveAnnouncement = localize('msg5', "The setting, accessibility.verbosity.diffEditorActive, controls if a diff editor announcement is made when it becomes the active editor."); </ins> const keys = ['accessibility.signals.diffLineDeleted', 'accessibility.signals.diffLineInserted', 'accessibility.signals.diffLineModified']; const content = [ localize('msg1', "You are in a diff editor."), localize('msg2', "View the next ({0}) or previous ({1}) diff in diff review mode, which is optimized for screen readers.", next, previous), switchSides, <ins> diffEditorActiveAnnouncement, </ins> localize('msg4', "To control which accessibility signals should be played, the following settings can be configured: {0}.", keys.join(', ')), ]; const commentCommandInfo = getCommentCommandInfo(keybindingService, contextKeyService, codeEditor);