Check for duplicates
Description
There is at least one scenario when a container block in the top left of the workspace is mysteriously pushed down when the user adds a statement block to an unrelated container block. Please see the reproduction steps and video recording for more information as this one is difficult to explain.
Reproduction steps
- Go to the Blockly test deployment
- Using keyboard, add a new function container block in the default position (top left)
- Press T to return to the toolbox and add a return statement. This will automatically be placed inside in the function container block. Accept the position
- Press T to return to the toolbox and add a second function container block (identical to the first). This will be placed to the right hand side of the first function block. Accept the position.
- Press T to return to the toolbox and add a statement block that is larger / taller than the return statement block you added to the first function container. In the example below, I used the repeat block. This will be placed inside the second function container block
- Observe that the first function container block has been pushed down the workspace slightly - it is not clear why. It doesn't matter if you accept the statement block position or discard it at this point.
- Press C to clean up the code. The second function block is now above the first function block as a result of the first function block getting pushed down. This matters more for MakeCode when you add a Button A handler, then a Button B handler, but their positions after switched after the cleanup function runs.
Priority
Work effort: Unknown. We suspect that the block is initially placed in the top left (unseen by the user) before being moved to the correct position and this might be causing the shift, but this is speculation.
Impact: We don't know how many people this affects, but it is certainly more of a quirk, and doesn't need urgent attention.
Stack trace
Screenshots
Video of behaviour in the Blockly deployment:
https://github.com/user-attachments/assets/622335b7-21dd-44cd-9cc0-a0dc248be528
Screenshot in MakeCode before cleanup:

Screenshot in MakeCode after cleanup:

Browsers
No response
Check for duplicates
Description
There is at least one scenario when a container block in the top left of the workspace is mysteriously pushed down when the user adds a statement block to an unrelated container block. Please see the reproduction steps and video recording for more information as this one is difficult to explain.
Reproduction steps
Priority
Work effort: Unknown. We suspect that the block is initially placed in the top left (unseen by the user) before being moved to the correct position and this might be causing the shift, but this is speculation.
Impact: We don't know how many people this affects, but it is certainly more of a quirk, and doesn't need urgent attention.
Stack trace
Screenshots
Video of behaviour in the Blockly deployment:
https://github.com/user-attachments/assets/622335b7-21dd-44cd-9cc0-a0dc248be528
Screenshot in MakeCode before cleanup:

Screenshot in MakeCode after cleanup:

Browsers
No response