Skip to content

Conversation

@cee-chen
Copy link
Contributor

@cee-chen cee-chen commented Dec 22, 2020

Summary

This PR is a follow-up to this conversation where we added links to document views. The issue with the wrapping <a> tag around the article content was that it caused screen readers to read out all the content at once, resulting in a lot of overwhelming verbiage:

image

This approach of changing our Result card markup/layout as a compromise to get working behavior for all kinds of users follows a pattern similar to EuiCard, where it balances the following trade-offs:

  • [Keyboard & Screenreader users] A focus-able link with a large/predictable location
  • [Screenreader users] Main internal article remains individually navigable
  • [Mouse users] The entire component still remains clickable with a large/predictable main link button where the link URL is previewable (bottom left corner of browser)

Screencaps

immkaJAWMD

QA

Checklist

- Move toggle action to the bottom of the card content
- [TODO] Action button to the right will be used for new link button (separate for accessibility/screen readers)
- Use grid to get the layout we want without extra div wrappers
+ remove <a> tag on article content - should have onClick only
- this allows screenreaders to granularly navigate through the card content while allowing mouse users the entire card to click
- the new actionButton details link is accessible to both keyboard & screen reader users
- since the aria-label for the new detail button link is basically that
@cee-chen cee-chen added Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.12.0 labels Dec 22, 2020
@cee-chen cee-chen requested review from a team and JasonStoltz December 22, 2020 21:21
snippet={value.snippet}
type={typeForField(field)}
/>
))}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This didn't actually change, I just removed a wrapper. I recommend viewing the diff with whitespace changes off (?w=0)

Copy link
Member

Choose a reason for hiding this comment

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

I think ?w=1 hides whitespace changes, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh derp haha, you're right 🤦‍♀️

Comment on lines 75 to +77
title={i18n.translate('xpack.enterpriseSearch.appSearch.result.title', {
defaultMessage: 'View document details',
defaultMessage: 'Document {id}',
values: { id: result[ID].raw },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not 100% sold on this change and if it improves the experience for screenreader users at all - happy to revert if people aren't a fan of this

@cee-chen
Copy link
Contributor Author

@JasonStoltz Definitely would love to know what you think! From a general UI/UX perspective I'm a fan of the expand/collapse being on the bottom instead to the side and think that makes a lot of sense. 🤞 In that sense I don't think this is too big a compromise/sacrifice to get a better experience for screenreader users and is (hopefully) a net gain overall for everyone.

I'm also curious to think if you'd be for or against removing the onClick on the main card content/body also generally - I think you mentioned it's really nice to be able to copy/paste stuff for linked cards and I can definitely see the use case for that and only having the document link being on the side link/button.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 1.8MB 1.8MB +4.4KB

Distributable file count

id before after diff
default 47260 48020 +760

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@JasonStoltz JasonStoltz left a comment

Choose a reason for hiding this comment

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

This looks good.

I would remove the the link from the result body though. Feel free to do that in a separate PR.

@cee-chen
Copy link
Contributor Author

Re: link/onClick on main body - for sure, I'm kinda leaning that way myself. Let me run that by @daveyholler when he gets back from OOO next year to see if he's down with that.

@cee-chen cee-chen merged commit 2cc2312 into elastic:master Dec 23, 2020
@cee-chen cee-chen deleted the result-a11y-enhancements branch December 23, 2020 18:39
cee-chen pushed a commit that referenced this pull request Dec 23, 2020
* Refactor Result card layout

- Move toggle action to the bottom of the card content
- [TODO] Action button to the right will be used for new link button (separate for accessibility/screen readers)
- Use grid to get the layout we want without extra div wrappers

* Add action button link to document detail

+ remove <a> tag on article content - should have onClick only
- this allows screenreaders to granularly navigate through the card content while allowing mouse users the entire card to click
- the new actionButton details link is accessible to both keyboard & screen reader users

* [Polish] Hover effects to help guide mouse users

* [i18n] Add pluralization to fields copy

* Update tests

* [Cleanup] Remove unneeded wrapper

* [??] More specific title for result group

- since the aria-label for the new detail button link is basically that
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.12.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants