From 1c5a86860fee85d422bcdda58ca18df0f683f6a7 Mon Sep 17 00:00:00 2001 From: Liz Looney Date: Tue, 9 Dec 2025 20:16:07 -0800 Subject: [PATCH 1/2] When validating names, only look at mechanism and component blocks. --- src/blocks/mrc_mechanism_component_holder.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/blocks/mrc_mechanism_component_holder.ts b/src/blocks/mrc_mechanism_component_holder.ts index 35ca635b..a1a2ba0e 100644 --- a/src/blocks/mrc_mechanism_component_holder.ts +++ b/src/blocks/mrc_mechanism_component_holder.ts @@ -221,6 +221,7 @@ const MECHANISM_COMPONENT_HOLDER = { setNameOfChildBlock(this: MechanismComponentHolderBlock, child: Blockly.Block): void { const otherNames: string[] = [] this.getDescendants(true) + .filter(descendant => descendant.type === MRC_MECHANISM_NAME || descendant.type === MRC_COMPONENT_NAME) .filter(descendant => descendant.id !== child.id) .forEach(descendant => { otherNames.push(descendant.getFieldValue('NAME')); From 5ed07d81f33af4beb110e8343647a8524759dd62 Mon Sep 17 00:00:00 2001 From: Liz Looney Date: Tue, 9 Dec 2025 23:22:48 -0800 Subject: [PATCH 2/2] When validating names, collect the names from other mechanism, component, and event blocks. --- src/blocks/mrc_mechanism_component_holder.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/blocks/mrc_mechanism_component_holder.ts b/src/blocks/mrc_mechanism_component_holder.ts index a1a2ba0e..e49ff62b 100644 --- a/src/blocks/mrc_mechanism_component_holder.ts +++ b/src/blocks/mrc_mechanism_component_holder.ts @@ -221,7 +221,10 @@ const MECHANISM_COMPONENT_HOLDER = { setNameOfChildBlock(this: MechanismComponentHolderBlock, child: Blockly.Block): void { const otherNames: string[] = [] this.getDescendants(true) - .filter(descendant => descendant.type === MRC_MECHANISM_NAME || descendant.type === MRC_COMPONENT_NAME) + .filter(descendant => + descendant.type === MRC_MECHANISM_NAME || + descendant.type === MRC_COMPONENT_NAME || + descendant.type === MRC_EVENT_NAME) .filter(descendant => descendant.id !== child.id) .forEach(descendant => { otherNames.push(descendant.getFieldValue('NAME'));