Skip to content

feat!: Add keyboard shortcut to toggle screenreader mode#9869

Open
gonfunko wants to merge 4 commits into
v13from
screenreader-mode
Open

feat!: Add keyboard shortcut to toggle screenreader mode#9869
gonfunko wants to merge 4 commits into
v13from
screenreader-mode

Conversation

@gonfunko
Copy link
Copy Markdown
Contributor

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.

@gonfunko gonfunko requested a review from a team as a code owner May 13, 2026 21:00
@gonfunko gonfunko requested a review from mikeharv May 13, 2026 21:00
@github-actions github-actions Bot added breaking change Used to mark a PR or issue that changes our public APIs. PR: feature Adds a feature labels May 13, 2026
Copy link
Copy Markdown
Contributor

@mikeharv mikeharv left a comment

Choose a reason for hiding this comment

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

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Used to mark a PR or issue that changes our public APIs. PR: feature Adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants