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 additional accessible text to linked faceted searches #3428

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thatbudakguy
Copy link
Member

@thatbudakguy thatbudakguy commented Oct 31, 2024

This updates the LinkToFacet rendering step to add an additional
visually hidden element when creating a link to a faceted search
that indicates the facet that will be used in the search.

This helps give additional context to screen reader users when
link_to_facet is used, especially when the page may include
links that go to searches for the same value in different fields.

Fixes #3427

Visual display (no change):

Screenshot 2024-10-31 at 14 55 06

Emitted HTML:

<dd class="col-md-9 blacklight-author_tsim">
  <a href="/?f%5Bauthor_tsim%5D%5B%5D=Hearth%2C+Amy+Hill%2C+1958-">
    <span>Hearth, Amy Hill, 1958-</span>
    <span class="visually-hidden">Author search</span>
  </a>
</dd>

Accessible name for link (shown in VoiceOver):

Screenshot 2024-10-31 at 14 54 51

@thatbudakguy thatbudakguy force-pushed the linked-facet-desc branch 3 times, most recently from 79d0a73 to 11245d7 Compare November 1, 2024 17:02
@dbranchini
Copy link

The proposed solution on this ticket sul-dlss/earthworks#1430 is essentially the same, just slightly different phrasing, so I'm okay with this solution.

This updates the LinkToFacet rendering step to add an additional
visually hidden element when creating a link to a faceted search
that indicates the facet that will be used in the search.

This helps give additional context to screen reader users when
link_to_facet is used, especially when the page may include
links that go to searches for the same value in different fields.

Fixes #3427
Copy link
Contributor

@sandbergja sandbergja left a comment

Choose a reason for hiding this comment

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

Thanks, @thatbudakguy ! This works well on voiceover, but it means that voice control users could no longer say "click ML Infomap Firm" (for example), on the example earthworks record. Since the accessible name has changed, but a voice control user has no possible way of knowing that the accessible name is different than the visible link text, they would have to use a different way of clicking on the link. More info in this article, if you're interested. I'm wondering if there's another solution that could work well for users of both assistive technologies? Maybe something like?

<a href="my-facet" aria-described-by="author-search">ML InfoMap (Firm)</a> <span id="author-search">(author search)</span>

With both pieces visible? Although I don't think the additional disambiguation text would show up in the Voiceover rotor... What do you think?

@thatbudakguy
Copy link
Member Author

Thanks for sharing that article, I hadn't thought about this tension between different use cases!

I tested your suggestion and indeed it doesn't update the name listed in the rotor, which makes sense because I think it only lists the accessible name there and aria-description doesn't contribute to the name itself.

I'm kind of at a loss for a solution that ticks all the boxes...I think we need the link texts/names to be different so that duplicate values can be distinguished, but I think the solution has to apply in every case where link_to_facet is used. Otherwise, we get into really complex stuff about inspecting what was rendered after all the facets are processed to detect only the cases where a rendered value is duplicated.

That being the case, if we add additional text that is visible, it'll always display for every linked facet, which could add a ton of extra content that might distract or confuse sighted users.

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.

link_to_facet can create links with identical text that goes to different URLs
3 participants