-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Inline Help Search Accessibility #43963
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~756 bytes removed 📉 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~363 bytes removed 📉 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
b4453c5
to
af65b38
Compare
98a2f24
to
98e19a4
Compare
Fix styling issues from HTML restructure Removed grid to leave for follow-up pr. Select correct search result on link click or enter keypress. Set focus styles for search result links Ripped out next/previous result selection from the state wrapped search results and placeholders in an aria-live region Fixed gridicon color on setting search results
4c91f72
to
c0c2cde
Compare
…since they're just visual things and not really a list
Are there tests that can be added to make sure the work you've done here is not going to be broken down the road? |
@obenland I'm honestly not sure what would be best to do regarding the tests. I don't think there are any integration or e2e tests for this. The tests I removed were all regarding the state, which I removed since we no longer needed those actions or states with the new keyboard interactions. I do think adding some tests would be great, but I think it would likely need to be in the larger context of testing the component, not just this work. Maybe @getdave has some ideas on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jeryj for wrangling this! Tabing through the results (instead of using arrow keys) is more intuitive in terms of accessibility. Also it seems that the code is cleaner now! Well done!
That said, it really works well in chrome but can't tab in results in safari the tabbed elements in sequence are input
-> Close button
-> Contact Us
With voice over, I got both the "Results are loading" and the actual results announcements!
In Chrome, I got the sections headers announced twice
Generally the Voice Over is a little hit and miss. I got very inconsistent results. I suppose we have to set it up properly.. To get solid results, I had to disable and enable before interacting with the Search
component.
Thank you for the review, @cpapazoglou! I don't get the Tab sequence issue in Safari 🤔. It sounds a little like it wasn't being built right, as that would have been the expected behavior previously to this PR. Could you try it again, and if Safari is doing that for you:
|
Tried rebuilding, clearing cache etc. Could not make it work, tabbing from the input moves me to Close Button and then to Contact Us. Checked my preferences though... And the following did the trick maybe it is worth mentioning in the accessibility PRs description 😃 ! So let's decide what we should do with the tracking event and we should be good to merge it! |
Oh yeah! I did that when I set-up my computer then forgot about it... It's such an odd preference. Nice find! |
@cpapazoglou Could you dismiss or approve your review? @retrofox said he'd give it another review in the morning. Thank you again for your testing and code review! 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/4087237 Thank you @jeryj for including a screenshot in the description! This is really helpful for our translators. |
In fact, we do have e2e tests for this component. I spent a good part of a previous Iteration adding these. I think perhaps you were away for this Iteration however @jeryj? Take a look in:
I'm noticed that both this PR and @retrofox's PR to add the admin sections didn't make provision for updating the tests. In one way I'm pleased the tests were resilient enough to avoid breaking during your refactor - this is correct as the existing functionality was preserved. In another way however, this seems overly lenient and points towards the need to assert more closely on the behaviour of the components. To ensure this necessary work isn't forgotten I've created an Issue to track the need to update the e2e tests. I could easily do this myself. However, I believe that this would be a great opportunity for @jeryj and @retrofox to write their first(?) e2e tests in Calypso and become familiar with the process. This will be a good learning environment because you will be adjusting existing tests rather than writing from scratch would should make everything easier. I'm more than happy to provide support with setup, reviews and implementation. I know we have lots of things on our plate, but I would like to see this pulled into the next Iteration to ensure we have fully completed the tasks on the support search and left things in a good state for future teams. |
Indeed. Sorry about this, honestly I was aware these implementations needed tests, but I put them in a low priority among other tasks that we had to achieve. Going to take it as soon as I get the chance. |
Translation for this Pull Request has now been finished. |
Overview
The search input will operate independently of the results. There won't be any arrow key interactions on the results while focused on the search input.
Markup General Structure
The previous markup was one list with
<li><h2>Section Title</h2></li>
with a combo-box-like interaction using arrow keys to navigate results. This PR changes it to a list of links with titles outside of the lists, usingTAB
to navigate the search results.Keyboard interactions
Everything gets a
tab
! This does add more tabstops to the page, but overall it is a more consistent and, likely, usable and standardized experience. Usinggrid
roles to implement arrowed results would likely be a confusing experience and, in the end, only benefit advanced sighted keyboard users.Screen Reader Announcements
I would have liked to have used
speak()
to announce state changes on the search, such as:There isn't an a11y
speak()
utility in Calypso and I was hesitant to add one. I opted to wrap anything loaded from the search (error message, placeholder search bars, results) in anaria-live
region. It works fairly well, but sometimes the results are not announced. This may be due to my inexperience with a screen reader though, as I believe the implementation is correct.Testing instructions
Visually, nothing should have changed. Manually test searches (including searches that would not return results, like
asdfadfasdfa
) for:/home
search sectionAll functionality should work correctly and feel the same as on production when using a mouse.
The HTML should look similar to the HTML section in this PR, with:
aria-live="polite"
wrapping the results<h3>Section Title</h3><ul>...</ul>
for the sections<div>
s instead of a<ul>
since it wasn't a real list, but a stylized thing to show the search.If you are comfortable with VoiceOver on Safari or another screen reader, you can test the announcements by performing a search and hopefully:
Fixes #43617
Translation String
The "Loading search results" string is hidden text only available to a screen reader. It is announced during this state when results are being fetched.
![loading state of component](https://user-images.githubusercontent.com/967608/87575675-dc7fa100-c695-11ea-87dc-ddf7afda2bcf.png)