Code change:
<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>

Related discussion:
text: 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