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

Improve keyboard and screen reader accessibility #2726

Merged
merged 17 commits into from
Mar 17, 2021

Conversation

dcalhoun
Copy link
Member

@dcalhoun dcalhoun commented Mar 8, 2021

Fix

Related to #1935 (comment), this addresses several issue that inhibited keyboard
and screen reader users from navigation the application easily.

Summary of changes:

  • Add ARIA roles for virtualized list
  • Improve accessibility of notes list
  • Reduce noise in screen reader audio
  • Increase accuracy of search field descriptions
  • Adjust search button styles to improve tap area
  • Increase accuracy of tag list accessibility labels
  • Allow scaling to improve accessibility
  • Improve ARIA descriptions for application layout
  • Add ARIA label for all icon buttons
  • Set language for HTML document
Issue Count Before Issue Count After
axe-devtools-before axe-devtools-after

The remaining issues identified by the axe DevTools fall into three categories:

  1. Issues that require design input (e.g. text color legibility).
  2. Issues with the third-party Monaco editor (e.g. lack of ARIA attributes).
  3. Issues that are not applicable to the Simplenote web application (e.g. lack of level-one heading).

Test

  1. Launch Simplenote web or desktop app.
  2. Enable macOS VoiceOver or screen reader.
  3. Navigate the application.

Expected Outcome: No major issues block navigating the application.

Release

Improved accessibility of the application for keyboard and screen reader users.

dcalhoun added 9 commits March 8, 2021 09:44
Elements within `grid` and `rowgroup` require specific roles to be valid
for the ARIA spec.
- Announce notes list title when focused on list.
- Reduce notes list to one column for easier focus navigation.
- Change actionable elements to buttons to improve accessibility.
- Improve accuracy of note list labels.
This span appears to be unnecessary and was creating an unnecessary
"group" when stepping through UI elements with macOS VoiceOver.
Center the icon within the tap area so that the button is easier to tap
with a larger tap area.
Hide internal text input. Describe available action on tag list.
Improve keyboard and screen reader navigation by describing various
pieces of the top-level layout and hide internal developer tooling.
Ensure screen reader can accurately describe icon buttons that do not
contain text strings.
@dcalhoun dcalhoun changed the title Improve accessibility Improve keyboard and screen reader accessibility Mar 8, 2021
Comment on lines 76 to 79
const placeholder = openedTag ?? 'Search notes and tags';

const screenReaderLabel =
'Search ' + (openedTag ? 'notes with tag ' : '') + placeholder;
const description =
'Search ' +
(openedTag ? 'notes with tag ' + openedTag : 'notes and tags');
Copy link
Member Author

@dcalhoun dcalhoun Mar 8, 2021

Choose a reason for hiding this comment

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

I wanted to draw attention to this change. Previously the placeholder value and the ARIA label were different strings. From reviewing the history of the UI, this at one point made sense because it appears the search field was utilized as the "title" of the list of notes, but also served a search input.

However, several changes were made to this portion of the app — the UI was moved around, the structure of the state, etc. These various changes led to a screen reader description that read "Search Search notes and tags Search notes and tags, search text field." 😂 Needless to say, this description is a bit...confusing.

So, these changes are an attempt to fix this label, but it also involves changing the visual placeholder for the search input. I would appreciate if others would please look carefully at this piece to ensure the current state matches the desired experience.

@dcalhoun dcalhoun marked this pull request as ready for review March 8, 2021 22:55
dcalhoun added 2 commits March 8, 2021 17:01
The SVG icon was cut off on the bottom due to its vertical alignment.
@dcalhoun dcalhoun requested a review from a team March 8, 2021 23:04
lib/note-list/index.tsx Outdated Show resolved Hide resolved
@@ -320,6 +339,7 @@ export class NoteList extends Component<Props> {
rowHeight={heightCache.rowHeight}
rowRenderer={renderNoteRow}
scrollToIndex={selectedIndex}
tabIndex={null}
Copy link
Member

Choose a reason for hiding this comment

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

what's the difference between tabIndex={-1} and tabIndex={null}?

Copy link
Member Author

Choose a reason for hiding this comment

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

The difference being that tabIndex={null} unsets a tabIndex="0" set by default from react-virtualized and tabIndex={-1} disables the element from being focused by keyboard tabbing while still allowing programmatic focus.

Given that the contents of our virtualized list are focusable (buttons to pin or edit a note), IMO it doesn't make sense for the entire list to be a focusable element. We also, to my knowledge, have no need to programmatically focus the list, so null makes more sense than -1.

Copy link
Member

Choose a reason for hiding this comment

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

interesting. thanks! so the list is no longer focusable: does that have any implications for scrolling the list with the keyboard?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question. I had not explicitly tested scrolling the list with the keyboard until just now. It would appear the scrolling the list is still possible and matches the experience as when tabindex="0" is set. 👍🏻

dcalhoun added 3 commits March 9, 2021 08:24
Address issues introduced from changing elements from div to button for
better accessibility.
Avoid unnecessary class method.
Accurately describe that search is scoped to the selected tag. Hide
overflow ellipsis.
@dcalhoun dcalhoun requested a review from dmsnell March 11, 2021 16:44
Replace static "Notes With Selected Tag" title with the tag name itself
to provide better context.
Copy link
Contributor

@sandymcfadden sandymcfadden 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 and works well. Seem much better than what we had previously. Thanks for taking the time to do this.
The only confusing part I had while testing with voiceover was when clicking the button to open the left navigation. Trying to get to the items in it once I clicked the button wasn't straight forward, but I think we can look at that in some future enhancements.

@dcalhoun
Copy link
Member Author

The only confusing part I had while testing with voiceover was when clicking the button to open the left navigation. Trying to get to the items in it once I clicked the button wasn't straight forward, but I think we can look at that in some future enhancements.

@sandymcfadden thanks for taking time to review. #2707 should address all issues with navigating the left navigation with a keyboard or screen reader. So, until both PRs are merged, one has to test those areas independently, unfortunately. Please let me know if I am misunderstanding or there are specific issues you encountered.

@sandymcfadden
Copy link
Contributor

Yes @dcalhoun yeah, of course, you're right. I even looked at and tested the other one. I think I got confused with the two, sorry for that confusion.

@codebykat codebykat added this to the 2.9.0 milestone Mar 16, 2021
Copy link
Member

@codebykat codebykat left a comment

Choose a reason for hiding this comment

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

With the caveat that I don't have a lot of domain knowledge here, so in general I trust your expertise. This all looks great!

@dcalhoun dcalhoun merged commit 42d2110 into develop Mar 17, 2021
@dcalhoun dcalhoun deleted the update/improve-accessibility branch March 17, 2021 12:50
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.

6 participants