Skip to content

Search Page Implementation & Review Fixes#205

Merged
rianrietveld merged 30 commits intowpaccessibility:mainfrom
kurapativyshnavi:main
Nov 13, 2025
Merged

Search Page Implementation & Review Fixes#205
rianrietveld merged 30 commits intowpaccessibility:mainfrom
kurapativyshnavi:main

Conversation

@kurapativyshnavi
Copy link
Copy Markdown
Contributor

I've implemented the dedicated search results page and resolved all code issues from the review.

What was changed:

  • search.html: Added this new file for the search results page layout.

  • _includes/components/search_header.html: Added the new search input and the search-submit button markup.

  • _sass/components/_search.scss: Updated the styles. I used Flexbox to line up the search input and button, and added CSS to make the submit button visible with an accessible :focus state.

  • assets/js/wp-a11y-docs.js: Changed the document ready function to jtd.onReady().

Added logic to re-populate the search box with the URL query when the page loads.

Implemented code to wait for the search index to finish loading before running the search, resolving the timing issue.

Thanks for the review!

@rianrietveld
Copy link
Copy Markdown
Member

@kurapativyshnavi thanks!
@joedolson can you review this when you have time?
I know you are busy the next few days, when you have time :-) .

This is a copy of the file from PR 90.
Copy link
Copy Markdown
Member

@joedolson joedolson left a comment

Choose a reason for hiding this comment

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

There are a number of changes required to make this functional.

Comment thread _sass/components/_search.scss Outdated
Comment thread _sass/components/_search.scss Outdated
Comment thread _sass/components/_search.scss Outdated
Comment thread _sass/components/_search.scss Outdated
Comment thread assets/js/wp-a11y-docs.js Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 23, 2025

PR Preview
Preview removed because the pull request was closed.
2025-11-13 06:30 UTC

@rianrietveld rianrietveld linked an issue Oct 25, 2025 that may be closed by this pull request
@joedolson joedolson dismissed their stale review November 5, 2025 18:11

obsolete

Copy link
Copy Markdown
Member

@rianrietveld rianrietveld left a comment

Choose a reason for hiding this comment

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

Yes, it works, thank you!

A few things:

The Skip link brings you to the first link in the content, skipping the search.
2 ways to solve this:

  • add a skip to search or
  • let the skip link move to the search input field.

This is personal, but I really hate the <mark> in your face 1999 styling.
Please remove that yellow and only leave bold in the CSS for mark.

There is an empty <mark></mark> and <span></span>.

<div class="search-result-section">
<mark></mark>
<mark class="search-result-highlight">WCAG Succes Criteria</mark>
<span></span>
</div>

With the mobile search, I find it unexpected that the focus scrolls up to the top of the window. We can wait and see what the auditor says about that.

Suggestion:
We can add a description to the pages and use that instead of the uri below the link.

Question:
DId you add pagination?

And note to self:
The headings must be more descriptive, search for WCAG gives multiple times the same vage results. I will fix that.

screen shot search for WCAG

Comment thread _includes/components/search_header.html
Comment thread assets/js/wp-a11y-docs.js Outdated
searchResults.appendChild(resultsList);
screenReaderFeedback.innerText = results.length + ' results found, tab to read them';
if ( results.length === 1 ) {
screenReaderFeedback.innerText = results.length + ' result found, tab to read it';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

'tab to read it' is in fact 'arrow down to read it', a tab brings you to the search button.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Close the list of search results when the focus moves to the search button.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Currently, you can navigate to the search results either using tab or using arrows. Before this PR, it was only by tab. Do we want to only support arrows? In that case, I'd want to also add some visual affordance so that's more obvious.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No, it's about the tab order and the instruction text. You go from input to search buttons to search results. And then the text "tab to read it" doesn't make sense.

But if you change the tab order, one is forced to tab through all the results to get to the submit button. and that's no use either.

In fact, how it works now is great, but if you cannot see, the focus on the submit button instead of the results could be confusing. Am I overthinking this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So, I was responding to your second comment, not the first. The text change makes sense; but if we close the list of search results when focus moves to the search button, then a user can't get to the search results using the tab key.

Comment thread search.html Outdated
Comment thread search.html
@rianrietveld
Copy link
Copy Markdown
Member

Additional: If you press enter and not the search button to submit the search, the {{site.baseurl}} is not attached in the form submit and it gives a 404

@joedolson
Copy link
Copy Markdown
Member

I've dealt with most things here, and the ones I haven't addressed are things I think should be handled in a follow up, if needed.

  1. Did not change the Skip link behavior. First, because I think it's unrelated to the search changes and should be done separately if at all, and second because I'm not convinced it's a good change. The skip link bypassing the search makes sense to me; it's not part of the content. But the language of the skip link isn't correct, as it's not skipping the menu; it's skipping to the content. I agree that a change needs to be made.

  2. Did not remove the mark styling. I think all style characteristics should be handled as part of the redesign effort.

  3. Did not add description to the search index. That's just because that's really complicated, and I think we should get this finished as it is and then iterate to add those indices.

  4. Did not add pagination. Same reason: pretty complicated, and I think we should get this iteration done first.

  5. Did not change so that the list of search results closes when focus moves to the search button. I think that would make this less predictable, and it's better that users can reach the results either by arrows or by tabbing.

@rianrietveld rianrietveld self-requested a review November 13, 2025 06:29
Copy link
Copy Markdown
Member

@rianrietveld rianrietveld left a comment

Choose a reason for hiding this comment

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

@joedolson
I agree with your choices, let’s merge this now.
Thanks so much for your work!

@rianrietveld rianrietveld merged commit 51357dd into wpaccessibility:main Nov 13, 2025
1 check passed
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.

Improve the accessibility of the search option

3 participants