Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disconnecting nested c-shaped blocks causes blocks to disappear #8189

Closed
1 task done
FlorianTschimben opened this issue Jun 3, 2024 · 6 comments · Fixed by #8203
Closed
1 task done

Disconnecting nested c-shaped blocks causes blocks to disappear #8189

FlorianTschimben opened this issue Jun 3, 2024 · 6 comments · Fixed by #8203
Assignees
Labels
issue: bug Describes why the code or behaviour is wrong

Comments

@FlorianTschimben
Copy link

FlorianTschimben commented Jun 3, 2024

Check for duplicates

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

Description

image
I created this Structure and when i drag the 2nd loop (count with i...) out of the outer loop, everything in it disappears, but the output code stays the same.
image

Reproduction steps

Build from Inside out

  1. Recreate a structure with multiple loops in it like in the first picture
  2. drag the second loop out of the first loop
  3. watch the blocks disappear

Stack trace

block_svg.ts:298  Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
    at BlockSvg$$module$build$src$core$block_svg.setParent (file:///C:/PSBlockly/blockly/blockly_compressed.js:1225:28)
    at RenderedConnection$$module$build$src$core$rendered_connection.disconnectInternal (file:///C:/PSBlockly/blockly/blockly_compressed.js:960:417)
    at RenderedConnection$$module$build$src$core$rendered_connection.disconnectInternal (file:///C:/PSBlockly/blockly/blockly_compressed.js:1204:479)
    at RenderedConnection$$module$build$src$core$rendered_connection.disconnect (file:///C:/PSBlockly/blockly/blockly_compressed.js:959:323)
    at BlockSvg$$module$build$src$core$block_svg.unplugFromStack_ (file:///C:/PSBlockly/blockly/blockly_compressed.js:977:134)
    at BlockSvg$$module$build$src$core$block_svg.unplug (file:///C:/PSBlockly/blockly/blockly_compressed.js:975:342)
    at InsertionMarkerPreviewer$$module$build$src$core$insertion_marker_previewer.hideInsertionMarker (file:///C:/PSBlockly/blockly/blockly_compressed.js:1387:315)
    at InsertionMarkerPreviewer$$module$build$src$core$insertion_marker_previewer.hidePreview (file:///C:/PSBlockly/blockly/blockly_compressed.js:1386:486)
    at BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy.updateConnectionPreview (file:///C:/PSBlockly/blockly/blockly_compressed.js:1215:492)
    at BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy.drag (file:///C:/PSBlockly/blockly/blockly_compressed.js:1214:256)

Screenshots

No response

Browsers

No response

@FlorianTschimben FlorianTschimben added issue: bug Describes why the code or behaviour is wrong issue: triage Issues awaiting triage by a Blockly team member labels Jun 3, 2024
@AlanVescoli
Copy link

I have the same problem

@BeksOmega
Copy link
Collaborator

Hello! I wasn't able to reproduce this :/ Can you recreate it on the playground?

@FlorianTschimben
Copy link
Author

FlorianTschimben commented Jun 4, 2024

Hi,
Yes I can recreate it on the playground. Maybe my reprodution steps weren't clear enough, so I will describe again:

  1. Take a repeat 10 times block
    image
  2. Take a repeat while and place it under the repeat 10 times block
    image
  3. Take a while block and place it in the repeat 10 times block
    image
  4. Take a repeat 10 times block and place it in the outer while block
    image
  5. Take another while block and place it under the other while block
    image
  6. Take a count with i block and place it over the other blocks
    image
  7. Now take a foreach block and place it over the count with i block
    image

Now when you grab the count with i block out of the foreach, everything in it disappears
image

@AlanVescoli
Copy link

AlanVescoli commented Jun 4, 2024

If you build this from the inside out it also reproduces it. So start with the repeat then the count and then the for each

image

In my experience it happens when you add to a already existing block or mutiple blocks the outer two blocks(first count with, then for each) on outside

@BeksOmega
Copy link
Collaborator

Ok sweet, thank you for the repro steps! Building from the inside to the outside reproduces the problem. You can also do it with three nested "if" blocks, so I don't think this is specific to loops.

@BeksOmega BeksOmega changed the title Loop blocks disappear Disconnecting nested c-shaped blocks causes blocks to disappear Jun 6, 2024
@BeksOmega BeksOmega self-assigned this Jun 10, 2024
@BeksOmega
Copy link
Collaborator

I'm looking into this pre-triage b/c it's pretty bad.

@cpcallen cpcallen removed the issue: triage Issues awaiting triage by a Blockly team member label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Describes why the code or behaviour is wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants