Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 6, 2025

Fixes #144801

Screen readers (NVDA, Orca) announce "Type the command to run" when pressing Ctrl to silence speech in the Command Palette. This occurs because the ariaLabel setter unconditionally calls setAttribute, triggering announcements even when the value hasn't changed.

Changes

src/vs/platform/quickinput/browser/quickInputBox.ts

  • Guard setAttribute('aria-label') to only execute when value differs from current DOM attribute
  • Prevents unnecessary DOM manipulation during frequent update cycles

src/vs/platform/quickinput/test/browser/quickinput.test.ts

  • Add test verifying placeholder updates don't throw errors
set ariaLabel(ariaLabel: string) {
    const currentValue = this.findInput.inputBox.inputElement.getAttribute('aria-label') || '';
    if (currentValue !== ariaLabel) {
        this.findInput.inputBox.inputElement.setAttribute('aria-label', ariaLabel);
    }
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Screen reader announces “Type the command to run” prompt after pressing Ctrl to silence speech</issue_title>
<issue_description>
Type: Bug

There is an accessibility issue when navigating through the Command Palette using a screen reader (tested with both NVDA and Orca).

When I open the Command Palette with Ctrl+Shift+P and start navigating through the list of commands, if I press the Ctrl key to silence the screen reader speech, the initial prompt (“Type the command to run”) is spoken again — it seems to be announced just before the speech is actually silenced.

Additionally, after pressing Ctrl to stop the speech, if I then press the Down Arrow key, the same prompt (“Type the command to run”) is announced once more, as if I had pressed Ctrl+Shift+P again.

Steps to reproduce:

  1. Open the Command Palette with Ctrl+Shift+P.
  2. Start navigating the list of commands using the arrow keys.
  3. Press Ctrl to silence the screen reader speech.
  4. Notice that the prompt (“Type the command to run”) is spoken just before the speech is interrupted.
  5. Press the Down Arrow key again and note that the same prompt is spoken once more.

Expected behavior:
The prompt should not be spoken again when pressing Ctrl or when resuming navigation after silencing speech.

Screen readers tested:

  • NVDA (Windows)
  • Orca (Linux)

VS Code version: Code - Insiders 1.106.0-insider (d8b0787, 2025-10-10T08:19:44.111Z)
OS version: Windows_NT x64 10.0.26100
Modes:

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz (8 x 2611)
GPU Status 2d_canvas: enabled
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 15.66GB (5.10GB free)
Process Argv --crash-reporter-id f8460393-7b6d-4fa3-b912-843cc3297a42
Screen Reader yes
VM 0%
Extensions (20)
Extension Author (truncated) Version
copilot Git 1.380.1802
copilot-chat Git 0.32.2025100703
remote-containers ms- 0.429.0
remote-ssh ms- 0.121.2025093015
remote-ssh-edit ms- 0.87.0
remote-wsl ms- 0.104.3
vscode-remote-extensionpack ms- 0.26.0
remote-explorer ms- 0.6.2025081809
remote-server ms- 1.6.2025091709
java red 1.47.2025101108
intellicode-api-usage-examples Vis 0.2.9
vscodeintellicode Vis 1.3.2
migrate-java-to-azure vsc 1.5.2025092401
vscode-gradle vsc 3.17.2025090802
vscode-java-debug vsc 0.58.2025082105
vscode-java-dependency vsc 0.26.1
vscode-java-pack vsc 0.30.3
vscode-java-test vsc 0.43.2025040304
vscode-java-upgrade vsc 1.6.1
vscode-maven vsc 0.44.2024072906
A/B Experiments
vsliv368:30146709
pythonvspyt551cf:31249598
nativeloc1:31118317
dwcopilot:31158714
dwoutputs:31242946
copilot_t_ci:31333650
g012b348:31231168
6gi0g917:31259950
pythonrdcb7:31268811
usemplatestapi:31297334
pythonpcpt1cf:31399617
6518g693:31302842
0g1h6703:31329154
agentisdefault:31399626
82j33506:31327384
6abeh943:31336334
envsactivate1:31349248
ovs_ter_t:31398874
editstats-enabled:31346256
aa_c:31379597
cloudbuttont:31366566
todos-0:31366869
qwen_all_req:31396049
multireplacestring:31382717
nb255704_tf:31377673
3efgi100_wstrepl:31382709
ge3cd652:31390471
trigger-command-fix:31379601
cmd-onchange-true:31382213
auto_model_enabled:31385282
grok-control-prompt:31384642
use-responses-api:31390341
c91a3477:31396429
applesignin:31399434
9i271672:31399627

<agent_instructions>fix this</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@meganrogge @jvesouza thanks for the issue. Is this new? I thought `esc` was used to silence the screen reader. Did you configure `ctrl` instead? @dmitrivMS This appears related to #144801

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 6, 2025
Copilot AI and others added 2 commits November 6, 2025 23:24
…alette

Prevent unnecessary DOM manipulation of aria-label attribute by only calling setAttribute when the value has actually changed. This prevents screen readers from announcing the prompt when the user presses Ctrl to silence speech.

Fixes #144801

Co-authored-by: dmitrivMS <[email protected]>
Instead of calling the getter (which indirectly reads from DOM), explicitly read the current attribute value from the DOM element. This makes the code clearer and addresses code review feedback.

Co-authored-by: dmitrivMS <[email protected]>
Copilot AI changed the title [WIP] Fix screen reader prompt reannouncements in Command Palette Fix screen reader re-announcing Command Palette prompt on Ctrl key press Nov 6, 2025
Copilot AI requested a review from dmitrivMS November 6, 2025 23:34
Copilot finished work on behalf of dmitrivMS November 6, 2025 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants