Skip to content

Conversation

@lizlooney
Copy link

@lizlooney lizlooney commented Nov 4, 2025

Reconnect blocks if steps are reordered.

I used Blockly's controls_if block as an example.

Added renameSteps function.

In mrc_step_container:
Added conditionShadowState, conditionTargetConnection, statementTargetConnection to StepItemMixin.

In mrc_steps:
Renamed INPUT_STEP_PREFIX to INPUT_STATEMENT_PREFIX.
Added saveConnections method to keep track of connections during mutation. (This is what blockly's controls_if block does.)
Changed compose method to reconnect connections. (This is what blockly's controls_if block does.)
Call renameSteps (from mrc_jump_to_step) when steps are renamed.
Changed updateShape_ to remove all inputs and create new ones. (This is what blockly's controls_if block does.)
Copy link
Owner

@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! Thanks for your work pushing this along!!

@alan412 alan412 merged commit dcf2a24 into alan412:pr_try_steps_block Nov 5, 2025
1 check passed
@lizlooney lizlooney deleted the pr_try_steps_block branch November 6, 2025 05:09
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.

2 participants