Skip to content

feat: add "Create a copy" to block developer tools - #2784

Merged
zspriggs merged 3 commits into
RaspberryPiFoundation:mainfrom
zspriggs:duplicate-dev-tools
Nov 25, 2026
Merged

zspriggs merged 3 commits into
RaspberryPiFoundation:mainfrom
zspriggs:duplicate-dev-tools

Conversation

@zspriggs

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #2553

Proposed Changes

Adds a "Create a copy" button to the block factory.

Reason for Changes

The linked issue (#2553) requests a "save" button so that the requester can make similar blocks without starting from scratch. The block factory already auto-saves and it would be confusing to add a manual save option that behaves differently. However, another way to fulfill the requested use case is to allow users to create copy of an existing block and iterate on it. Now, clicking the "Create a copy" button will create a new block that's a copy of the current block.

Screenshot 2026-11-24 at 11 14 43 AM

Note that instead of using getNewUnusedName, I created a new function to add '_copy' to the end of the old block name, so it's clearer to the user what's happening when they create a copy.

Test Coverage

Tested manually, creating a copy properly creates a copy, name collisions are handled by adding subsequent '_copy's to the end of the block name.

Documentation

None

Additional Information

@zspriggs
zspriggs requested a review from a team as a code owner November 24, 2026 17:20
@zspriggs
zspriggs requested review from mikeharv and removed request for a team November 24, 2026 17:20
Comment thread examples/developer-tools/src/storage.ts Resolved
@zspriggs
zspriggs requested a review from mikeharv November 25, 2026 16:40
@zspriggs
zspriggs merged commit 18a9fb0 into RaspberryPiFoundation:main Nov 25, 2026
3 checks passed
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.

Bring back the "Save" button in the Blockly developer tools

2 participants