Fix copy/paste issues and mutators#146
Open
LappiLappland wants to merge 7 commits into
Open
Conversation
added 7 commits
May 23, 2026 22:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The basics
The details
Resolves
Fixes #136 and #143
Proposed Changes
global.js. They should ideally behave exactly the same and creating shared functions ensures that (fixes "paste into visible area" not working with paste by context menu)copyMutatorIdvariable that tracks if last elements were copied from mutator workspace and its id. If this variable is present, then we try to find workspace by id and insert elements theredataCopyToStorageto never save mutator blocks in the storage. Now nothing will be saved in the storage if you copy mutator blocksif (selected instanceof MultiselectDraggable) else if (!dragSelection.size)check to a simpleif (selected instanceof MultiselectDraggable) else.!dragSelection.sizecheck was ignoring the fact that single block in dragSelection is not wrapped inside MultiselectDraggable[cd0718e](https://github.com/mit-cml/workspace-multiselect/commit/cd0718ee70c6e35ca57e85a6412e4123a2dadd85)by @mjgallag. Thanks for making it!)Reason for Changes
copyMutatorIdvariables allows copy/paste inside mutator blocks, a feature original Blockly supports. Also fixes the bug when mutator blocks can end up in the main workspace breaking code generation and possibly even deserialization!dragSelection.sizecheck aligns with multiselect logic - drag selection with size 1 is not wrapped in MultiselectDraggingTest Coverage
selectfolderDocumentation
N/A
Additional Information
I did both issues in this pull request, because I've moved copy/paste logic and wanted to avoid merge conflicts. Hope that's not a problem!