Skip to content

chore: announce search results in side navigation#2019

Merged
ToMESSKa merged 1 commit into
masterfrom
INSTUI-4243-ensure-that-status-messages-can-be-determined-programmatically-without-receiving-focus
Jun 13, 2025
Merged

chore: announce search results in side navigation#2019
ToMESSKa merged 1 commit into
masterfrom
INSTUI-4243-ensure-that-status-messages-can-be-determined-programmatically-without-receiving-focus

Conversation

@ToMESSKa

@ToMESSKa ToMESSKa commented Jun 12, 2025

Copy link
Copy Markdown
Contributor

INSTUI-4243

ISSUE:

  • search results in documentation's side navigation are not announced

TEST PLAN:

  • navigate to the "Find…" search bar in the side navigation using different screen readers
  • type a search term (e.g., "color" or "select")
  • the screen reader should:
    • announce the number of results available
    • clearly indicate when no results are available

@ToMESSKa ToMESSKa self-assigned this Jun 12, 2025
@ToMESSKa ToMESSKa requested a review from Copilot June 12, 2025 12:51

Copilot AI left a comment

Copy link
Copy Markdown

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 addresses screen reader accessibility for the documentation side navigation by announcing search results.

  • Introduces a new state property "announcement" to hold the result message.
  • Implements new methods (announceResults and countSearchResults) to update and calculate announcements.
  • Inserts an Alert component for screen reader announcements.

Reviewed Changes

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

File Description
packages/docs/src/Nav/props.ts Adds a new "announcement" property to the NavState interface.
packages/docs/src/Nav/index.tsx Implements announcement logic in search handling and renders an Alert for screen reader feedback.
Comments suppressed due to low confidence (2)

packages/docs/src/Nav/props.ts:62

  • Consider adding inline documentation for the 'announcement' property to clarify its intended usage in accessibility announcements.
announcement: string | null

packages/docs/src/Nav/index.tsx:113

  • Consider verifying that the component is still mounted before calling setState within the delayed callback to prevent potential state updates on an unmounted component.
this.setState({ announcement: message })

@github-actions

github-actions Bot commented Jun 12, 2025

Copy link
Copy Markdown
PR Preview Action v1.6.1
Preview removed because the pull request was closed.
2025-06-13 10:11 UTC

@ToMESSKa ToMESSKa changed the title chore: annouce search results in side navigation chore: announce search results in side navigation Jun 12, 2025
@ToMESSKa ToMESSKa requested review from joyenjoyer and matyasf June 12, 2025 14:22

@matyasf matyasf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks good, I've tested with VoiceOver on OSX, JAWS and NVDA on Windows 11

@joyenjoyer joyenjoyer 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.

gj

@ToMESSKa ToMESSKa merged commit 02b8eaa into master Jun 13, 2025
11 checks passed
@ToMESSKa ToMESSKa deleted the INSTUI-4243-ensure-that-status-messages-can-be-determined-programmatically-without-receiving-focus branch June 13, 2025 10:11
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.

4 participants