Skip to content

Conversation

lizlooney
Copy link
Collaborator

Remove change framework.

Cleaned up mrc_param_container.ts.
Moved code in mrc_event.ts and mrc_class_method_def.ts that looked into the details of mrc_param_container blocks to mrc_param_container.ts.

Fixes #274

mrc_param_container.ts:
Add constants INPUT_STACK and FIELD_NAME.

mrc_class_method_def.ts:
Add constants INPUT_TITLE, FIELD_PARAM_REFIX, and INPUT_STACK.
Renamed constant RETURN_VALUE to INPUT_RETURN.
Replaced mutatorOpenListener function (a blockly change listener) with onMutatorOpen function,
which is is called only for mutator open events on mrc_class_method_def and mrc_event blocks.

mrc_class_method_def.ts and mrc_event.ts:
Added mrcOnMutatorOpen method, which calls onMutatorOpen in mrc_param_container.

editor.ts:
Added code to handle the BubbleOpenEvent for a mutator and call mrcOnMutatorOpen on the block.

App.tsx:
Removed code that adds mutatorOpenListener to each blockly workspace.
Call getMutatorIcon from mrc_class_method_def.ts and mrc_event.ts.
Call createMutatorBlocks from EventBlock.decompose and ClassMethodDefBlock.decompose.
Renamed METHOD_PARAM_CONTAINER to PARAM_CONTAINER.
Added type ParamContainerBlock, interface ParamContainerMixin, and type ParamContainerMixinType.
Added getParamItemBlocks function to ParamContainerBlock.
Renamed MUTATOR_BLOCK_NAME to PARAM_ITEM_BLOCK_NAME.
Renamed METHODS_MUTATORARG to PARAM_ITEM.
Renamed MethodMutatorArgBlock to ParamItemBlock.
Renamed MethodMutatorArgMixin to ParamItemMixin.
Renamed MethodMutatorArgMixinType to ParamItemMixinType
Added getName, getOriginalName, and setOriginalName functions to ParamItemBlock.

mrc_event.ts and mrc_class_method_def.ts:
Modified EventBlock.compose and ClassMethodDefBlock.compose to call getParamItemBlocks on the container block and then call getName, getOriginalName, and setOriginalName on each ParamItemBlock.
Changed function updateMutatorFlyout to use forEach loop. Renamed local variable argValue to uniqueName.
Copy link
Collaborator

@alan412 alan412 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alan412 alan412 merged commit 1a2c638 into wpilibsuite:main Oct 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get rid of ChangeFramework

2 participants