Skip to content

Conversation

BrettJephson
Copy link
Contributor

Fixes some issues around search accessibility:

  1. Search results did not make sense and were overly verbose, I’ve simplified to “Page with title ‘some title’” and “Section with title ‘some title’” and abbreviated the content in a result that returns a section body so it doesn’t read like War and Peace. With translations provided by Claude.
  2. When search results are returned or no results are returned we actually notify the screen reader user
  3. We let the screen reader know that this is a combobox with an associated list of results
  4. We surface number of results and which is the selected result

@BrettJephson BrettJephson self-assigned this Sep 10, 2025
Copy link

linear bot commented Sep 10, 2025

Copy link

changeset-bot bot commented Sep 10, 2025

🦋 Changeset detected

Latest commit: 960ccc2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
gitbook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

argos-ci bot commented Sep 10, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2 (Inspect) ⚠️ Changes detected (Review) 4 changed Sep 15, 2025, 10:33 AM
v2-cloudflare (Inspect) ✅ No changes detected - Sep 15, 2025, 10:37 AM
v2-vercel (Inspect) ⚠️ Changes detected (Review) 1 changed Sep 15, 2025, 10:36 AM

Comment on lines 240 to 243
resultsShowing={resultsState.showing}
resultsCount={resultsState.count}
cursor={resultsState.cursor}
controlsId={searchResultsId}
Copy link
Member

Choose a reason for hiding this comment

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

Just a suggestion: I think it could be more readable to keep a resultsState object throughout instead of spreading it :

Suggested change
resultsShowing={resultsState.showing}
resultsCount={resultsState.count}
cursor={resultsState.cursor}
controlsId={searchResultsId}
resultsState={resultsState}
controlsId={searchResultsId}

Comment on lines 19 to 21
resultsCount: number;
cursor: number | null;
resultsShowing: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

Following up my suggestion above:

Suggested change
resultsCount: number;
cursor: number | null;
resultsShowing: boolean;
resultsState: ResultsState;

Comment on lines 164 to 168
const [resultsState, setResultsState] = React.useState<{
count: number;
showing: boolean;
cursor: number | null;
}>({
Copy link
Member

Choose a reason for hiding this comment

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

Following up my suggestion below:

Suggested change
const [resultsState, setResultsState] = React.useState<{
count: number;
showing: boolean;
cursor: number | null;
}>({
const [resultsState, setResultsState] = React.useState<ResultsState>({

And the type would live above:

type ResultsState = {
        count: number;
        showing: boolean;
        cursor: number | null;
    }

Comment on lines 104 to 105
{resultsShowing
? resultsCount > 0
Copy link
Member

Choose a reason for hiding this comment

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

and :

Suggested change
{resultsShowing
? resultsCount > 0
{resultsState.showing
? resultsState.count > 0

Comment on lines 37 to 39
resultsCount,
resultsShowing,
cursor,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
resultsCount,
resultsShowing,
cursor,
resultsState

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.

2 participants