Screen Reader Optimized indicator opens a misleading "enable?" prompt; answering "No" silently disables screen reader mode

Open Beginner friendly
#349,647 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
electron, typescript
Domain
accessibility

Research direction

The bug lives in src/vs/workbench/contrib/accessibility/browser/accessibilityStatus.ts: the command 'showEditorScreenReaderNotification' calls showScreenReaderNotification() unconditionally, and the Yes/No actions write 'on'/'off' to editor.accessibilitySupport. Start by reading showScreenReaderNotification() and the status bar entry registration, then check accessibilityService.isScreenReaderOptimized() to branch the prompt. Done when the prompt reflects the current mode, offers Turn Off when already on, and 'No' no longer disables an active mode.

Written by the indexing model from the issue text.

Description

Type: Bug

Does this issue occur when all extensions are disabled?: Yes — the prompt is created by built-in workbench code (src/vs/workbench/contrib/accessibility/browser/accessibilityStatus.ts); no extension is involved.

Version

  • VS Code 1.146.0 (commit 69047191fc427f2f92828279aae1d90d8eeda7ab), arm64
  • OS: macOS 27.3 (26C5035r)
  • Display language: zh-hans (the localized string has the same problem: "检测到屏幕阅读器使用情况。是否要启用 editor.accessibilitySupport 以针对屏幕阅读器使用情况优化编辑器?")
  • No organization policy (/Library/Managed Preferences/com.microsoft.VSCode does not exist) and no custom profiles — the default profile is the only one.

Steps to reproduce

  1. Enable screen reader mode explicitly, e.g. run Toggle Screen Reader Accessibility Mode (Shift+Option+F1), or set in User settings:

    "editor.accessibilitySupport": "on"
    
  2. Confirm the status bar (lower right) already shows Screen Reader Optimized — the mode is on.

  3. Click the Screen Reader Optimized status bar item.

Actual

The notification appears:

Screen reader usage detected. Do you want to enable editor.accessibilitySupport to optimize the editor for screen reader usage?
Yes / No / Learn More

Problems:

  • It asks to enable something that is already enabled.
  • It is sticky: true with NotificationPriority.URGENT, so it stays on screen until explicitly closed.
  • Yes writes 'on' again (a no-op). Nothing visible happens and the notification is not dismissed, because the notification is only closed from the configuration-change path.
  • No writes editor.accessibilitySupport = "off" — i.e. answering "No" (which reads as "no, I don't want to change anything / don't ask me again") silently turns screen reader mode off.
  • Every click on the indicator re-opens the prompt.

Expected

The prompt should reflect the current state, for example:

  • mode off/auto: "Enable screen reader mode?" with Enable / Not now
  • mode on: "Screen reader optimized mode is on." with Turn Off / Learn More

This also matches the documentation, which says selecting the indicator turns the mode off:

"The Status Bar displays Screen Reader Optimized in the lower right. ... Select either indicator or run the Toggle Screen Reader Accessibility Mode command to turn off screen reader mode."

— https://code.visualstudio.com/docs/configure/accessibility/accessibility#_screen-reader-mode

At a minimum, No must not disable a mode the user never asked to disable.

Root cause

src/vs/workbench/contrib/accessibility/browser/accessibilityStatus.ts (current main):

L35 — the command behind the status bar item calls the prompt unconditionally, bypassing the === 'auto' guard that exists only on the automatic path:

this._register(CommandsRegistry.registerCommand({ id: 'showEditorScreenReaderNotification', handler: () => this.showScreenReaderNotification() }));

L85–L92 — the status bar entry is wired to that command:

command: 'showEditorScreenReaderNotification',
kind: 'prominent',

L52–L80 — the prompt text is state-independent and Yes → 'on', No → 'off':

localize('screenReaderDetectedExplanation.question', "Screen reader usage detected. Do you want to enable {0} to optimize the editor for screen reader usage?", 'editor.accessibilitySupport'),
[{
    label: localize('screenReaderDetectedExplanation.answerYes', "Yes"),
    run: () => { this.configurationService.updateValue('editor.accessibilitySupport', 'on', ConfigurationTarget.USER); }
}, {
    label: localize('screenReaderDetectedExplanation.answerNo', "No"),
    run: () => { this.configurationService.updateValue('editor.accessibilitySupport', 'off', ConfigurationTarget.USER); }
}, ...],
{ sticky: true, priority: NotificationPriority.URGENT }

L99–L117 — onScreenReaderModeChange() only auto-shows the prompt when screenReaderConfiguration === 'auto', and closes the open notification; but a click-triggered notification is only closed if a configuration change event fires.

Impact

This is actively harmful for screen reader users:

  1. The indicator contradicts itself — the status bar says "optimized" while the prompt asks whether to enable it.
  2. Answering No turns the optimization off, silently. A user who just wants to dismiss the prompt loses screen reader mode.
  3. Because the notification is sticky and urgent, it interrupts work and must be closed with the × button.

Suggested fix

  • Branch on this.accessibilityService.isScreenReaderOptimized() inside showScreenReaderNotification() and offer Turn Off when the mode is already on.
  • Or make the status bar item's command the actual toggle (as the docs describe) instead of a prompt.
  • Or drop the prompt from the status bar item entirely (see #167962) and keep it only on the auto-detection path.
  • Also dismiss the notification after the Yes action runs, even when the value does not change.

Related issues

  • #167962 — "now that we detect screen readers, consider not prompting"
  • #235133 — "Lacking context for question about 'screen reader'"
  • #288688 — repeated popup, different trigger

Screenshot

The notification "Screen reader usage detected..." while the status bar simultaneously shows Screen Reader Optimized.

Screen Reader Optimized status bar item and the enable prompt shown at the same time
Dominant language
TypeScript
Stars
196k
Forks
43.9k
Avg merge
12h 49m
Merged PRs (30d)
682

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode

All issues in microsoft/vscode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.