Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add visually hidden comma after search items #4063

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

owenatgov
Copy link
Contributor

@owenatgov owenatgov commented Aug 21, 2024

What

Adds a visually hidden comma to search result rendering, after search results and before search result section information.

Why

This is to address an issue raised by DAC during an audit of the GOV.UK Design System website, in which they noted that search results and search result section info was not adequetly deliminated for screen reader users, currently being dictated as a single phrase. This solution adds a pause to screen reader dictation between the result and the section info, resolving the issue.

This solution has been chosen following testing of multiple solutions, including DAC's own proposal.

Resolves #4006

Notes

Something implicit in DAC's recommendation to add parentheses around section info was for it to be visual, like so:
Website search results with parentheses around result section info

This is also true of the colon solution where we could've adjusted the render output to position the section info above the result visually.

I haven't explored these further this time based on the results of the same solutions when they're visually hidden. I'm going to opt to leave them be for now. I could be prompted to re-explore this as it's not impossible that they could be different, especially if it means we can simplify the search output.

Testing has also found that instances where section info includes a section and a page aren't ideal for screen reader users. Screen readers don't interpret the greater than sign, intenteded as a visual arrow to associate a section with a page, as punctuation and announce this a s a single phrase. I'll fix this in a separate PR.

Copy link

netlify bot commented Aug 21, 2024

You can preview this change here:

Name Link
🔨 Latest commit 6e80175
🔍 Latest deploy log https://app.netlify.com/sites/govuk-design-system-preview/deploys/66c600e935671600081514b7
😎 Deploy Preview https://deploy-preview-4063--govuk-design-system-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@owenatgov owenatgov force-pushed the search-results-section-semantics-comma branch from 0afe9f8 to 9670108 Compare August 21, 2024 14:49
@owenatgov owenatgov force-pushed the search-results-section-semantics-comma branch from 9670108 to 6e80175 Compare August 21, 2024 14:59
@owenatgov owenatgov marked this pull request as ready for review August 21, 2024 17:35
@owenatgov owenatgov requested a review from a team August 21, 2024 17:35
@owenatgov owenatgov merged commit ba186a8 into main Aug 22, 2024
15 checks passed
@owenatgov owenatgov deleted the search-results-section-semantics-comma branch August 22, 2024 09:10
@selfthinker
Copy link
Contributor

selfthinker commented Aug 28, 2024

I'm not sure if this solution completely fixes the issue. While a comma helps separating the two strings, I don't think it says the same as what the visuals convey. But it is somewhat equivalent to what DAC suggested, so maybe it's fine. (To be fair, DAC's solution does similarly not represent the visuals 100% either.)

@owenatgov
Copy link
Contributor Author

@selfthinker I'm gonna answer this comment in tandem with #4066 (comment) as they're both related.

I wonder if there's an issue here around the design of the search results themselves in that they're confusing by themselves. You can get context clues that the metadata of a search result is typically one of the website nav sections but we're including headings in pages as well which changes the context of the results. The way we get around this is with the '[site section] > [page]' metadata pattern but I'm not sure that's actually helpful.

As you said in your other comment, the result is intended to be a heading whilst the metadata for heading results are intended to be like a breadcrumb. I would take this further and say that for instances where a result is a page, not a heading, the metadata is more intended to be a subheading. We've got changing contexts in our search results with not very much clear indication. I think the problems for screen readers are potentially just a symptom of the overall poor conveyance of these search results.

I was chatting about this to @hazalarpalikli in relation to work she's been doing on #4015 and we're wondering if there's an opportunity to iterate the whole site search, taking this into account as well. From your comments, I wonder if the answer is to go back to DAC's original implied suggestion and just spell the results out in text, no visually hidden text, which would involve reorganising these results which I was maybe too nervous to do. A bone-headed idea I suggested was something as blunt as:

[Result 1]
Radios
from section Components

[Result 2]
Responsive spacing
from page Spacing in section Styles

I think this solution I've put together in this PR is a minimum viable solution but I think it'd be worth revisiting it soon.

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.

Autocomplete: Visual information for sections not available to assistive tech
3 participants