Skip to content

Use setTimeout0 to defer setting Count til element is fully shown for now#270825

Merged
TylerLeonhardt merged 1 commit into
mainfrom
tyler/mean-lamprey
Oct 10, 2025
Merged

Use setTimeout0 to defer setting Count til element is fully shown for now#270825
TylerLeonhardt merged 1 commit into
mainfrom
tyler/mean-lamprey

Conversation

@TylerLeonhardt

Copy link
Copy Markdown
Member

This is a workaround for now for an accessibility bug that should be addressed.

The way that the checked count works is that it's a CountBadge widget wrapped in an aria-live that reports when the text content (aka the number) changes.

However, when the QuickPick is initially shown to the user, the resolved count is done so before actually made visible... aria-live does not read out anything that is changed when hidden.

I think a proper change here would be to have a separate aria-live element that is always off screen (so "technically" visible)... that can be updated when a Count is made visible... but this small fix is fine to at least give screen reader users a count.

Fixes #258617

… now

This is a workaround for now for an accessibility bug that should be addressed.

The way that the checked count works is that it's a `CountBadge` widget wrapped in an `aria-live` that reports when the text content (aka the number) changes.

However, when the QuickPick is initially shown to the user, the resolved count is done so before actually made visible... `aria-live` does not read out anything that is changed when hidden.

I think a proper change here would be to have a separate `aria-live` element that is always off screen (so "technically" visible)... that can be updated when a Count is made visible... but this small fix is fine to at least give screen reader users a count.

Fixes #258617
Copilot AI review requested due to automatic review settings October 10, 2025 22:25
@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) October 10, 2025 22:25
@TylerLeonhardt TylerLeonhardt self-assigned this Oct 10, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request implements a temporary workaround for an accessibility issue where screen readers don't announce the count of checked items in QuickPick dialogs when initially shown. The fix defers the count update until the element is fully visible using setTimeout0.

Key changes:

  • Added setTimeout0 wrapper around count setting calls to ensure screen reader accessibility
  • Applied the workaround in two locations where checked item counts are updated

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/vs/platform/quickinput/browser/tree/quickTree.ts Added import for setTimeout0 and wrapped initial count setting in setTimeout0 with TODO comment explaining the accessibility workaround
src/vs/platform/quickinput/browser/quickInputController.ts Added setTimeout0 import and wrapped checked count updates in setTimeout0 with TODO comment referencing the accessibility issue

@vs-code-engineering vs-code-engineering Bot added this to the October 2025 milestone Oct 10, 2025
@TylerLeonhardt TylerLeonhardt merged commit 4dbe013 into main Oct 10, 2025
28 checks passed
@TylerLeonhardt TylerLeonhardt deleted the tyler/mean-lamprey branch October 10, 2025 23:46
pwang347 pushed a commit that referenced this pull request Oct 14, 2025
… now (#270825)

This is a workaround for now for an accessibility bug that should be addressed.

The way that the checked count works is that it's a `CountBadge` widget wrapped in an `aria-live` that reports when the text content (aka the number) changes.

However, when the QuickPick is initially shown to the user, the resolved count is done so before actually made visible... `aria-live` does not read out anything that is changed when hidden.

I think a proper change here would be to have a separate `aria-live` element that is always off screen (so "technically" visible)... that can be updated when a Count is made visible... but this small fix is fine to at least give screen reader users a count.

Fixes #258617
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Nov 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quicktree textbox should announce selected amount

3 participants