Skip to content

block-duplicate: spork fixes - #8997

Merged
mxmou merged 2 commits into
ScratchAddons:masterfrom
mxmou:fix-cursed-duplicate
Apr 24, 2026
Merged

block-duplicate: spork fixes#8997
mxmou merged 2 commits into
ScratchAddons:masterfrom
mxmou:fix-cursed-duplicate

Conversation

@mxmou

@mxmou mxmou commented Apr 23, 2026

Copy link
Copy Markdown
Member

Changes

Fixes two bugs in the block-duplicate addon.

Duplicating custom block prototypes

To reproduce:

  • Try to Alt+drag a prototype out of a define block. It looks like nothing has happened, but this actually creates a duplicate of the prototype.
  • Move the define block out of the way to reveal the duplicate.

Cursed inputs

To reproduce:

  • Put a variable into a text or number input
  • Duplicate the block using Alt+drag
  • Delete the original block
  • Switch to another sprite and back
  • Remove the variable from the input

Fixed by using the stripIds() utility function that Scratch added for this purpose.

Tests

Tested on Edge and Firefox.

@mxmou mxmou self-assigned this Apr 23, 2026
@mxmou mxmou added scope: addon Related to one or multiple addons scope: upstream Related to something we depend on (like Scratch, a library, or the browser) labels Apr 23, 2026
@Joeclinton1

Copy link
Copy Markdown
Member

Almost certainly btw it's about any block in an input not just variables.

@Joeclinton1

Joeclinton1 commented Apr 23, 2026

Copy link
Copy Markdown
Member

Can confirm you get the same block deletion bug. if you remove the variable from both the original and duplicated block.

2026-04-23.15-42-05.mp4

(this is without the fix to be clear)

@Joeclinton1 Joeclinton1 added the priority: 2 High priority. Includes crashes, major bugs and important features label Apr 23, 2026

@Joeclinton1 Joeclinton1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026-04-23.15-48-16.mp4

Not fixed, in fact your blocks now disappear faster.

@Joeclinton1

Copy link
Copy Markdown
Member

Problem is upstream not us (happens also with regular duplicate and no extension), will report to scratch on their spork issue lisst

@WorldLanguages

Copy link
Copy Markdown
Member

You discard your review then?

@Joeclinton1
Joeclinton1 dismissed their stale review April 23, 2026 17:59

Upstream not us causes the bug (probably)

@Joeclinton1

Copy link
Copy Markdown
Member

You discard your review then?

done

@Joeclinton1 Joeclinton1 added priority: 3 Medium priority. Includes bugs and useful features and removed priority: 2 High priority. Includes crashes, major bugs and important features labels Apr 23, 2026

@Joeclinton1 Joeclinton1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The duplicate for define prototypes bug is not fixed. First time I drag them out fine. Second time though I move the define block and the two inputs appear in top left of workspace.

the cursed input for variables is fixed.

@WorldLanguages

Copy link
Copy Markdown
Member

Should we release v1.45.1 with or without this?

@Samq64 Samq64 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think v1.45.1 should be pulled if it hasn't already and v1.45.2 should be released with this change.

Edit: I did not notice Joe's review until now but I just tested and can't reproduce the bug.

@Joeclinton1

Copy link
Copy Markdown
Member

I think v1.45.1 should be pulled if it hasn't already and v1.45.2 should be released with this change.

Edit: I did not notice Joe's review until now but I just tested and can't reproduce the bug.

Let me make a video then. Because there was a bug for sure.

@mxmou

mxmou commented Apr 24, 2026

Copy link
Copy Markdown
Member Author

I move the define block and the two inputs appear in top left of workspace

That doesn't sound as serious as the bug that happens on master and is fixed in this PR:

Screen.Recording.2026-04-24.181207.mp4

The duplicated prototype block this creates can't be dragged or even deleted. So I think this PR definitely improves things, even if there are still some bugs.

@DNin01

DNin01 commented Apr 24, 2026

Copy link
Copy Markdown
Member

Should we release v1.45.1 with or without this?

0e92324 should be included in the next release, if anything.

@Joeclinton1

Joeclinton1 commented Apr 24, 2026

Copy link
Copy Markdown
Member

After some difficulty trying to reproduce the bug I figured it out. It happens when you drag the custom block over a connection point. And is maybe a different bug?

oh. It's not even us, it's again: upstream

2026-04-24.19-46-44.mp4

@Joeclinton1
Joeclinton1 dismissed their stale review April 24, 2026 18:48

Bug with duplicated inputs in top left of workspace is upstream, not this PR. This PR has no bugs.

@Joeclinton1 Joeclinton1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR works well, and removes the two serious bugs.

@mxmou
mxmou merged commit 7752df4 into ScratchAddons:master Apr 24, 2026
2 checks passed
@mxmou
mxmou deleted the fix-cursed-duplicate branch April 24, 2026 19:15
@mxmou

mxmou commented Apr 25, 2026

Copy link
Copy Markdown
Member Author

@WorldLanguages There's an open PR in scratch-blocks that will break the cursed inputs fix from this PR. See #9003

@WorldLanguages

Copy link
Copy Markdown
Member

Okay, releasing another patch soon then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: 3 Medium priority. Includes bugs and useful features scope: addon Related to one or multiple addons scope: upstream Related to something we depend on (like Scratch, a library, or the browser)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants