feat: Add relevant things to full-block field labels#10037
Conversation
| // Full block fields get a more detailed label that includes the block's label | ||
| label = computeAriaLabel(this.getSourceBlock() as BlockSvg).replace( | ||
| this.computeAriaLabel(false), | ||
| label, |
There was a problem hiding this comment.
This admittedly feels a bit janky, but it's needed because getInputLabels will use includeTypeInfo = false for standard verbosity.
| this.getSourceBlock() as BlockSvg, | ||
| ); | ||
|
|
||
| // Insert "Edit" after "Begin stack" if found, otherwise at start. |
There was a problem hiding this comment.
This is vibes based, but it felt odd to read/hear "Edit Begin stack, number:10..."
|
I've done some initial testing with these changes in MakeCode. When I refresh the page, I see a lot of full block numbers as block inputs that get the "begin stack" prefix when I think they shouldn't. If I delete the block, then hit undo, the "begin stack" prefix is removed and the input name is added. I'm not sure if there's a timing issue here - perhaps the full block field labels are calculated on load before they are attached to block they are in? Screen.Recording.2026-06-19.at.13.35.14.mov |
|
This is a really daft example, but it's more likely to happen in MakeCode where we have full block text inputs. If the value of the input matches the input name, then weird things happen to the output. The order of elements is switched and repeated? I don't really know what's happening here. Screen.Recording.2026-06-19.at.17.20.17.mov |
|
I ran into another text mangling example and it does seem to depend on the value of the input. I was able to reproduce in the Blockly playground running locally. Some kind of replacement problem maybe? I haven't investigated. Update: Ahh it's this code. For this example it amounts to I've raised #10050 separately. Screen.Recording.2026-06-22.at.16.34.55.mov |
|
Hi @microbit-robert. Thanks for the thorough testing here! I've updated this branch with fixes that should remove the timing problems and text mangling. Please feel free to take another look! |

The basics
The details
Resolves
Fixes #9864
Proposed Changes
This updates how ARIA labels are computed for field classes that support full-block fields (
FieldInputandFieldDropdown). WhenrecomputeAriaContext()is called for these fields, we were update thearia-labelusing the full block's label, which includes a lot of additional information. This requires re-inserting the expected field label (with type name) to the right place with the block label.Examples:
Focusing full-block field, number top block








Focusing full-block field, child
Information shortcut, shadow
Focusing full-block field, dropdown top block
Information shortcut
Focusing full-block field
Information shortcut, disabled
Extended Information shortcut
Labels are also refreshed automatically when block context changes:
BlockSvgdelegates aria recomputation to the full-block field on connect/disconnect (setParent) and after drag ends (setDragging(false)), with tests for those paths.Reason for Changes
Blocks that are full-block field blocks get special cased in block aria composer, but the special case didn't include adding things like "begin stack", "disabled", the custom input name, etc if they are relevant to the block.
Test Coverage
Tests were added that check expected labels for focused blocks similar to those screenshotted above.