google / blockly

The web-based visual programming editor.
https://developers.google.com/blockly/
Apache License 2.0
12.43k stars 3.71k forks source link

Deleting a block does not resize the workspace such that the view is within the content bounds #7815

Open BeksOmega opened 8 months ago

BeksOmega commented 8 months ago

Check for duplicates

Description

When you delete a block from the workspace, the workspace viewport does not move such that the viewport is within the new content bounds.

Reproduction steps

  1. Open the playground
  2. Drag a block into the workspace.
  3. Drag the workspace such that the block is at the top of the workspace.
  4. Drag a block onto the bottom of the workspace.
  5. Drag the workspace such that the block is in the middle of the workspace.
  6. Delete the second block.
  7. Drag the workspace.
  8. Observe how the view jumps so the original block is within the bounds of the view.

Stack trace

No response

Screenshots

Screen recording 2024-01-29 1.39.54 PM.webm

Browsers

No response

Additional Info

This makes the minimap plugin look weird, because it does properly resize when the block is deleted.

BeksOmega commented 4 months ago

I'm going to punt on this because resizing the workspace on delete actually has performance implications if we're (e.g.) clearing the workspace