Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 14, 2026

Screen readers were not announcing search results count or "No Results Found" status, violating WCAG 4.1.3 (Status Messages). Users relying on assistive technology had no feedback when queries completed.

Changes

CollectionView.tsx

  • Capture documentCount from runFindQuery response (previously discarded)
  • Add ARIA live region with role="status" and aria-live="polite" for non-intrusive announcements
  • Implement getResultsAnnouncement() helper with proper singular/plural handling
  • Mark decorative ProgressBar with aria-hidden={true} to prevent redundant announcements

collectionView.scss

  • Add .sr-only utility class for visually-hidden, screen-reader-accessible content

Example

<div role="status" aria-live="polite" aria-atomic="true" className="sr-only">
    {getResultsAnnouncement()}  // "42 results found" | "1 result found" | "No results found"
</div>

Screen readers now announce "X results found", "1 result found", or "No results found" when queries complete, without visual changes to the UI.

Original prompt

This section details on the original issue you should resolve

<issue_title>ScreenReader does not announce search results count or "No Results Found" Information: A11y_DocumentDB for VS Code Extension_Screenreader</issue_title>
<issue_description>GitHub Tags
#A11yTCS; #A11yMAS; #A11ySev2; #DesktopApp; #FTP; #Win32; #DocumentDB for VS Code Extension; #SH_DocumentDB_Win32_NOV2025; #WCAG4.1.3; #StatusMessage;

Environment Details:

Application Name: DocumentDB for VS Code Extension
Version 0.6.0
OS: Windows 11[Version 23H2(OS Build 22631.3593)]

Repro Steps:

  1. Open VS code
  2. Install the DocumentDB for VS Code Extension and open it
  3. Navigate to the DocumentDB Connections area.
  4. Click the New Connection action.
  5. Select Connection String as the connection method.
  6. Paste the connection string when prompted.
  7. Choose to authenticate with username/password and enter the credentials
  8. Confirm to create the connection.
  9. Locate the desired cluster in the DocumentDB Connections list.
  10. Expand the cluster entry to initiate the connection.
  11. Expand one of the databases under the cluster.
  12. Expand a collection within that database.
  13. Select the Documents item for that collection.
  14. Collection View will open
  15. Observe that ScreenReader does not announce search results count or "No Results Found" Information.

Actual Result:

ScreenReader does not announce search results count or "No Results Found" Information

Expected Result:

Screen Reader should announce the search results count or "No Results Found" Information.

User Impact:

Users relying on screen readers are not informed about the number of search results or when no results are found. This creates confusion and prevents users from understanding the outcome of their search actions.
Without this feedback, users may assume the search failed or that their input was not processed.

Attachment

https://github.com/user-attachments/assets/bc70c7e2-1f05-4cc0-89a2-c4a8ada0fb60</issue_description>

<agent_instructions>Use the accessibility skill.</agent_instructions>

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


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix screen reader announcement for search results count Add ARIA live region for screen reader announcements of search results Jan 14, 2026
Copilot AI requested a review from tnaum-ms January 14, 2026 17:11
@tnaum-ms tnaum-ms marked this pull request as ready for review January 14, 2026 19:17
@tnaum-ms tnaum-ms requested a review from a team as a code owner January 14, 2026 19:17
Copilot AI review requested due to automatic review settings January 14, 2026 19:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds screen reader accessibility for search results in the CollectionView webview to comply with WCAG 4.1.3 (Status Messages). Previously, screen readers did not announce query results counts or "No Results Found" status, leaving users with assistive technology without feedback when queries completed.

Changes:

  • Captures documentCount from query responses for accessibility announcements
  • Adds ARIA live region with proper attributes for screen reader announcements
  • Implements helper function with singular/plural handling for result announcements
  • Adds .sr-only utility class for visually-hidden but screen-reader-accessible content
  • Marks decorative ProgressBar with aria-hidden={true} to prevent redundant announcements

Reviewed changes

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

File Description
src/webviews/documentdb/collectionView/CollectionView.tsx Adds state for document count, captures it from query responses, implements announcement helper, and adds ARIA live region for screen reader announcements
src/webviews/documentdb/collectionView/collectionView.scss Adds .sr-only utility class for visually-hidden, screen-reader-accessible content
l10n/bundle.l10n.json Adds localized strings for result announcements: "No results found", "1 result found", and "{0} results found"

.then((_response) => {
.then((response) => {
// Capture document count for accessibility announcements
setDocumentCount(response.documentCount);
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The documentCount is set in the .then() block but not cleared in the .catch() or .finally() blocks. If a query fails, the live region will continue to announce the previous query's results. Set documentCount to undefined in the .catch() block to prevent stale announcements after errors.

Copilot uses AI. Check for mistakes.
Comment on lines +528 to +530
<div role="status" aria-live="polite" aria-atomic="true" className="sr-only">
{getResultsAnnouncement()}
</div>
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The ARIA live region is rendered unconditionally and always present in the DOM. While this works correctly, best practice for live regions is to keep them persistent in the DOM (which this does), so this implementation is correct. However, the live region will announce results on every query including pagination. For pagination (where executionIntent is 'pagination'), users may not want repeated announcements of the same count. Consider conditionally suppressing announcements during pagination by checking currentContext.activeQuery.executionIntent in getResultsAnnouncement().

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ScreenReader does not announce search results count or "No Results Found" Information: A11y_DocumentDB for VS Code Extension_Screenreader

2 participants