Skip to content

WorkspaceSvg.cleanUp() method doesn't account for immovable blocks #6889

@mikeharv

Description

@mikeharv

Check for duplicates

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

Description

If blocks are immovable when cleanUp() is called, they are skipped. Other blocks are moved into a column but ignoring any immovable blocks that might already be there: https://github.com/google/blockly/blob/4125fd31534dd9f450219259b9ccb3c1495605c9/core/workspace_svg.ts#L1812-L1830

This creates a situation where cleanUp() can actually make things look worse, covering up immovable blocks with movable ones.

Reproduction steps

  1. Add several blocks to the workspace.
  2. Set one or more blocks to be immovable (e.g. Blockly.selected.setMovable(false))
  3. Select "Clean up blocks" from the workspace context menu.

Stack trace

No response

Screenshots

2023-03-09.08-16-55.2023-03-09.08_18_05.mp4

image

Browsers

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions