Skip to content

Re-randomize block IDs on paste - #32

Merged
GarboMuffin merged 1 commit into
developfrom
change-block-ids-on-paste
Jul 12, 2026
Merged

GarboMuffin merged 1 commit into
developfrom
change-block-ids-on-paste

Conversation

@GarboMuffin

@GarboMuffin GarboMuffin commented Jul 12, 2026

Copy link
Copy Markdown
Member

May fix some general odd behaviors with the copy + paste

This would also resolve TurboWarp/scratch-gui#1172 but leave the more underlying issue in there

@GarboMuffin

Copy link
Copy Markdown
Member Author

it gets unique-ified later in Block constructor

but this doesn't work across workspaces

ideally we would randomize across workspace. this PR fixes that

  this.id = (opt_id && !workspace.getBlockById(opt_id) &&
      (!flyoutWorkspace || !flyoutWorkspace.getBlockById(opt_id))) ?
      opt_id : Blockly.utils.genUid();

@GarboMuffin
GarboMuffin merged commit 7c58de6 into develop Jul 12, 2026
2 checks passed
@GarboMuffin
GarboMuffin deleted the change-block-ids-on-paste branch July 12, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant