Skip to content

Expose Screen Reader Mode over the iframe API#11459

Merged
riknoll merged 4 commits into
microsoft:masterfrom
microbit-matt-hillsdon:iframe-screen-reader-mode
Jul 10, 2026
Merged

Expose Screen Reader Mode over the iframe API#11459
riknoll merged 4 commits into
microsoft:masterfrom
microbit-matt-hillsdon:iframe-screen-reader-mode

Conversation

@microbit-matt-hillsdon

@microbit-matt-hillsdon microbit-matt-hillsdon commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Adds a "togglescreenreadermode" editor message that behaves like the settings menu toggle (including the "settings" telemetry event source), and reports the current state via a new screenReaderMode field on the "info" response.

As part of this change I realised that toggleScreenReaderMode was async in implementation but not interface so I've aligned both to be async.

Needed for micro:bit classroom to expose the same setting.

I'm hopeful that this is our last change!

Adds a "togglescreenreadermode" editor message that behaves like the
settings menu toggle (including the "settings" telemetry event source),
and reports the current state via a new screenReaderMode field on the
"info" response.

As part of this change I realised that toggleScreenReaderMode was async in
implementation but not interface so I've aligned both to be async.
@microbit-matt-hillsdon

Copy link
Copy Markdown
Contributor Author

@riknoll would be great to get this one in if possible.

@abchatra abchatra requested review from Copilot and riknoll July 9, 2026 23:39

Copilot AI left a comment

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.

Pull request overview

Exposes the editor’s Screen Reader Mode toggle via the iframe message API and reports the current state in the info response, aligning the project view API to reflect that the underlying implementation is async.

Changes:

  • Route the Settings menu and Blockly shortcut toggles through toggleScreenReaderModeAsync(...) in ProjectView.
  • Add togglescreenreadermode as an editor message and include screenReaderMode in the info response.
  • Update IProjectView typings to include toggleScreenReaderModeAsync(...) and isScreenReaderModeEnabled().
Show a summary per file
File Description
webapp/src/container.tsx Update Settings menu screen reader toggle to call the async project view method.
webapp/src/blocks.tsx Update Blockly screen reader shortcut handler to call the async project view method.
webapp/src/app.tsx Rename/adjust project view screen reader toggle to async method and add state getter.
pxteditor/editorcontroller.ts Add new togglescreenreadermode message handling and report state via info.
localtypings/pxteditor.d.ts Extend iframe message/action and project view typings to include the new API surface.

Review details

  • Files reviewed: 4/5 changed files
  • Comments generated: 3
  • Review effort level: Low

Comment thread webapp/src/app.tsx
Comment thread webapp/src/app.tsx
Comment thread pxteditor/editorcontroller.ts
@riknoll riknoll enabled auto-merge July 10, 2026 14:12
@riknoll riknoll added this pull request to the merge queue Jul 10, 2026
@microbit-matt-hillsdon

Copy link
Copy Markdown
Contributor Author

Thanks @riknoll. No worries if this doesn't make the release so long as it can be ported across soon.

Merged via the queue into microsoft:master with commit 32c75db Jul 10, 2026
12 checks passed
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.

4 participants