feat: Icon ARIA#9805
Merged
mikeharv merged 3 commits intoRaspberryPiFoundation:v13from May 4, 2026
Merged
Conversation
gonfunko
reviewed
May 1, 2026
gonfunko
reviewed
May 4, 2026
gonfunko
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The basics
The details
Resolves
Fixes #9662
Proposed Changes
Updates
Iconand its subclasses with the following API changes:This follows a similar pattern to
Bubbles including defaulting the label to'Icon'if no override is provided. By default,Icons are given the rolebuttonas it best fits their interactive nature since it's expected thatIconsare always clickable. Developers are thus expected to use non-clickableFieldImages when they want to include non-clickable graphics as part of a block.Icons are also responsible for configuring their corresponding Bubbles to have correct ARIA labels (with translation support). This is done by providing an
AriaLabelProviderstring or function to theBubble. This is done becauseBubbleand its subtypes do not have any particular awareness of the context in which they are being used.Icons for Mutators, Warnings, and Comments have a new
getAriaLabeloverride that returns a localized message pertaining to opening its bubble or closing it. The bubble itself will be labeled either as 'Block editor workspace' (mutator) or the full bubble text preceded by'Warning: '/'Comment: '.In order to ensure that labels for comment bubbles are updated, a change listener was added to
TextInputBubble. Note that read-only workspaces useTextBubble, which does need to have a similar mechanism due to users not being able to type. Warnings are also effectively read-only.Reason for Changes
This gives built-in bubble owners (mutators, warnings, and comments) correct dynamically updated ARIA labels and roles for their icons and bubbles. This will also make it possible for developers to do the same for their own
Iconimplementations.Test Coverage
A new test suite was added for
Iconwhich tests roles and labels for generic icons. For mutators, warnings, and comments, existing suites were updated check label providers, expected roles for icons and bubbles, and dynamic updates from toggling the bubble visibility and updating comment text.Documentation
Additional Information