feat!: Add keyboard shortcut to toggle screenreader mode#9869
Conversation
mikeharv
left a comment
There was a problem hiding this comment.
These changes look good. My naming comment is a bit nit-picky, but I mention it because now is the easiest time to get it right. Open to your thoughts!
Let me know what you think about adding a toast as well.
| export class KeyboardNavigationController { | ||
| /** Whether the user is actively using keyboard navigation. */ | ||
| private isActive = false; | ||
| private levelChangeBeepsEnabled = false; |
There was a problem hiding this comment.
There's a few different Beep functions in properties here, and I'm wondering if those names are maybe too implementation specific. I wonder if it might be clear to name the concept like AudioCues rather than the specific chosen sound effect.
Similarly, level on its own feels slightly vague. I wonder if there's a way for the property to more clearly signify we're talking about nested block levels/depth.
| callback: (workspace) => { | ||
| enabled = !enabled; | ||
| keyboardNavigationController.setLevelChangeBeepsEnabled(enabled); | ||
| workspace.getNavigator().setNavigationLoops(!enabled); |
There was a problem hiding this comment.
Since this changes functionality for all users, not just screen readers, would it be appropriate to also show a toast explaining what changed? Otherwise there's no visible feedback or way to understand why navigation behavior has changed (or how to toggle it back).
The basics
The details
Resolves
Fixes #9861
Proposed Changes
This PR adds a keyboard shortcut bound to Command Option Z that toggles screenreader mode on or off. With screenreader mode on, navigation looping is disabled and navigating between blocks of different nesting levels plays tones whose frequency corresponds to the level of nesting.
Additionally, error boops are now played when reaching the end of navigation, regardless of whether screenreader mode is on or off.