Skip to content

fix: Coalesce adjacent field labels#9996

Merged
lizschwab merged 3 commits into
RaspberryPiFoundation:mainfrom
lizschwab:9855-2
Jun 17, 2026
Merged

fix: Coalesce adjacent field labels#9996
lizschwab merged 3 commits into
RaspberryPiFoundation:mainfrom
lizschwab:9855-2

Conversation

@lizschwab

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #9855

Proposed Changes

Coalesces adjacent field labels, taking into account whether the labels are on the same visual row.

Reason for Changes

Blocks built in ways where multiple labels are next to one another were computed as being comma separated when building out the block's ARIA label. This is confusing for users as these labels are treated as a single string for sighted users while being read as separate strings for screenreader users.

Test Coverage

Unit tests have been added to cover the edge cases around this change.

@lizschwab lizschwab requested a review from a team as a code owner June 16, 2026 00:39
@lizschwab lizschwab requested a review from maribethb June 16, 2026 00:39
@github-actions github-actions Bot added the PR: fix Fixes a bug label Jun 16, 2026
/**
* Returns whether an input's list of visible fields begins with a FieldLabel
*
* @internal

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.

You don't need to mark these as internal because they already aren't exported from this file

assert.include(label, 'third fourth');
});
test('Statement inputs are not combined', function () {
const statementBlock = Blockly.Xml.domToBlock(

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.

prefer using json for these kinds of tests (even if older existing tests use xml).

@lizschwab lizschwab merged commit 9ede433 into RaspberryPiFoundation:main Jun 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

coalesce adjacent label fields

2 participants