fix: Don't include 'begin' in label for blocks in the first statement input (#9514)

This commit is contained in:
Aaron Dodson
2025-12-08 10:29:40 -08:00
committed by GitHub
parent 57be8ca37f
commit ebda1e4b73

View File

@@ -252,7 +252,15 @@ export class BlockSvg
const parentInput = (
this.previousConnection ?? this.outputConnection
)?.targetConnection?.getParentInput();
if (parentInput && parentInput.type === inputTypes.STATEMENT) {
if (
parentInput &&
parentInput.type === inputTypes.STATEMENT &&
// The first statement input is redundant with the parent block's label.
parentInput !==
parentInput
.getSourceBlock()
.inputList.find((input) => input.type === inputTypes.STATEMENT)
) {
labelComponents.push(`Begin ${parentInput.getFieldRowLabel()}`);
} else if (
parentInput &&