Skip to content

[A11y] Connect the Screen Reader Debugger switch to the app - #10114

Open
victorsanni wants to merge 1 commit into
flutter:masterfrom
victorsanni:a11y-screen-reader-debugger
Open

victorsanni wants to merge 1 commit into
flutter:masterfrom
victorsanni:a11y-screen-reader-debugger

Conversation

@victorsanni

Copy link
Copy Markdown
Contributor

Part of #9893. Follows #10065.

This connects the Screen Reader Debugger switch on the Accessibility page to the app. The switch now shows the semantics debugger in the app, so that a developer can see what the app reports to a screen reader. It goes through ext.flutter.showSemanticsDebugger, which flutter/flutter#197822 adds.

That PR should land first, because the extension's name can still change in its review. DevTools refers to the extension by name, because the Flutter version that it builds with does not have WidgetsServiceExtensions.showSemanticsDebugger yet.

On the page:

  • The switch shows what the app reports, including changes from other tools. While a change is on its way to the app, it shows the new value.
  • While the app has not registered the extension, for example before it starts, in a profile build or on an older Flutter version, the switch is disabled and dimmed, and a message below it says why.

The switch goes through ServiceExtensionManager, as brightness does. The manager only tracks the extensions in serviceExtensionsAllowlist, so the extension is added there, in devtools_app_shared.

Caveats:

  • After a hot restart, ServiceExtensionManager turns the debugger on again. The text scale, bold text and high contrast overrides do not come back yet.
  • When DevTools connects, the VM service (DDS) replays earlier extension events and ServiceExtensionManager applies them. So if the debugger was on before a hot restart that DevTools was not connected for, connecting turns it on again. The other extensions that go through the manager, such as the performance overlay, do the same today.
  • Showing or hiding the debugger rebuilds the app from its root, like the performance overlay. Add the showSemanticsDebugger service extension flutter#197822 lists what state that keeps.
  • There is no release note, because the page is behind the accessibility experiment flag.

Controller tests cover availability, the state that the app reports, changes from other tools, hot restarts, and a change that the app does not answer. Widget tests cover the disabled switch with its message, the pending value and a narrow pane. The devtools_test fake of ServiceExtensionManager can now leave calls unanswered.

Pre-launch Checklist

General checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I updated/added relevant documentation (doc comments with ///).

Issues checklist

Tests checklist

  • I added new tests to check the change I am making...
  • OR there is a reason for not adding tests, which I explained in the PR description.

AI-tooling checklist

  • I did not use any AI tooling in creating this PR.
  • OR I did use AI tooling, and...
    • I read the AI contributions guidelines and agree to follow them.
    • I reviewed all AI-generated code before opening this PR.
    • I understand and am able to discuss the code in this PR.
    • I have verifed the accuracy of any AI-generated text included in the PR description.
    • I commit to verifying the accuracy of any AI-generated code or text that I upload in response to review comments.

Feature-change checklist

  • This PR does not change the DevTools UI or behavior and...
    • I added the release-notes-not-required label or left a comment requesting the label be added.
  • OR this PR does change the DevTools UI or behavior and...
    • I added an entry to packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.
    • I included before/after screenshots and/or a GIF demo of the new UI to my PR description.
    • I ran the DevTools app locally to manually verify my changes.

build.yaml badge

If you need help, consider asking for help on Discord.

The Screen Reader Debugger switch of the Accessibility page now shows the
semantics debugger in the connected app, through the
ext.flutter.showSemanticsDebugger service extension.

The switch goes through ServiceExtensionManager, so it shows the state
that the app reports, follows the changes that other tools make, and the
debugger is turned on again after a hot restart. While the app has not
registered the extension, the switch is disabled, its label is dimmed and
a message below it says why.

The extension is referred to by name until the Flutter version that
DevTools builds with has WidgetsServiceExtensions.showSemanticsDebugger.

Part of flutter#9893
@victorsanni
victorsanni requested review from a team and kenzieschmoll as code owners December 3, 2026 01:07
@victorsanni
victorsanni requested review from srawlins and removed request for a team December 3, 2026 01:07
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

This branch has not been deployed

No deployments
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.

1 participant