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

Android: Accessibility: Improve voice typing dialog screen reader accessibility #11428

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Nov 21, 2024

Summary

This pull request improves the accessibility of the voice typing panel. In particular it:

  • Automatically moves focus to the "Voice typing..." header when the dialog opens.
    • Currently, the dialog is opened from the note actions menu. Previously, focus moved to the first focusable item on the screen when opening the panel (the back button).
  • Removes the role=alert and aria-live=polite attributes from the voice typing panel's container.
    • Previously, whenever new spoken text was recognised, the screen reader re-read "Voice typing... Please record your voice..." followed by the recognised text.
  • Adds role=alert and aria-live=polite to just the Please record your voice status region.
    • With this change, TalkBack announces when voice typing is ready.

Note

There are accessibility issues related to the voice typing dialog that are not fixed by this pull request. For example,

  • Closing the panel: focus is still not restored to the editor after clicking "Done"
  • Recognised text preview is difficult to use: the recognised text preview section is difficult to discover and unlabelled.

Related to #10795.

Testing plan

Android 13/TalkBack:

  1. Open the note actions menu.
  2. Open the voice typing dialog.
  3. Verify that TalkBack reads "Voice typing... Please record your voice..."
  4. Say "something".
  5. (Visually) verify that "something" has been added to the editor.
  6. Move accessibility focus to the item just after "Please record your voice".
  7. Say "something else".
  8. Verify that, after several seconds, TalkBack reads "Something else".
    • Note: I needed to repeat step 6 for this to work.
  9. Move accessibility focus to the next item.
  10. Verify that TalkBack reads "Done, Button, Ends voice typing, Double-tap to activate".
  11. Double-tap.
  12. Verify that the voice typing dialog has been closed.

Comment on lines +191 to +193
// role="status" might fit better here. However, react-native
// doesn't seem to support it.
role='alert'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

See the list of supported roles.

Comment on lines -160 to +172
</Banner>
<Surface>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This pull request switches from a <Banner> to a <Surface>. React Native Paper sets role=alert and accessibilityLiveRegion=polite on the content of <Banner>s. This caused TalkBack to re-read "Voice typing... Please record your voice... [[recognised text here]]" when new text was recognised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Related to accessibility android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant