blockly-samples icon indicating copy to clipboard operation
blockly-samples copied to clipboard

Block-dynamic-connection plugin undo does not resize dynamic create text block

Open changminbark opened this issue 1 year ago • 2 comments

Check for duplicates

  • [X] I have searched for similar issues before opening a new one.

Component

Block-dynamic-connection plugin

Description

The dynamic create text block does not shrink back to its original number when I undo the action of dynamically connecting the block. If I move it off using the cursor, it resizes properly. It just doesn't do it with the undo. Refer to the gif to see what I am talking about.

Reproduction steps

Stack trace

No response

Screenshots

dynamic block bug

changminbark avatar Aug 05 '24 08:08 changminbark

Hi @changminbark. Can you provide exact steps to reproduce this, please?

I tried to reproduce it as follows and got a different incorrect undo behaviour:

  1. Go to test page for dynamic connection plugin.
  2. Drag a "create text with" (join) block from the toolbox to the workspace.
  3. Drag an "abc" block to the first input of the join block.
  4. Drag an "abc" block to the second input of the join block.
  5. Drag an "abc" block to join block to get a third input to appear, and attach the "abc" block to it.
  6. Press undo repeatedly.
  7. Observe that the first undo works as expected, removing the third "abc" block. It then takes several undos to fully undo the addition of the second "abc" block. The first "abc" block is undone in a single undo as expected.

There is at least one bug here but I'm not sure if it's the one that @changminbark reported.

cpcallen avatar Aug 09 '24 17:08 cpcallen

Here are the exact steps I took to produce the behavior:

  1. Go to test page for dynamic connection plugin.
  2. Drag a "create text with" (join) block from the toolbox to the workspace.
  3. Drag an "abc" block to the workspace.
  4. Connect this to first input of the join block.
  5. Drag an "def" block to the workspace.
  6. Connect this to second input of the join block.
  7. Drag an "ghi" block to the workspace.
  8. Connect this to third input of the join block. (This will dynamically create the third input)
  9. Press undo, disconnecting the third input but not deleting the input "ghi" block.

If you follow this step, you will end up with a "create text with" (join) block with 3 inputs even though there are only 2 input blocks: image

I am not familiar with the other bug. It seems that these bugs are fundamentally different as I was concerned with the "create text with" (join) block not destroying the third input when the undo action is performed.

changminbark avatar Aug 12 '24 06:08 changminbark