refactor: split out block serialization for creating new blocks from the flyout#8065
Merged
gonfunko merged 3 commits intoRaspberryPiFoundation:rc/v11.0.0from May 3, 2024
Merged
Conversation
Contributor
|
This needs to go against the rc/v11 branch since we're not doing any releases from |
BeksOmega
approved these changes
May 3, 2024
Contributor
BeksOmega
left a comment
There was a problem hiding this comment.
For posterity: This is definitely a kludge on top of an already bad API. But I don't think this is the time to dig into changing flyouts, because several of our major partners depend on various implementation details, and it would be really time consuming to untangle.
For context:
- This was the original fix where we made it so the first blocks dragged from a flyout would have a different ID. This is the functionality scratch needs for its reporter blocks. #7618
- This is the PR where we reverted that change, because it broke a bunch of tests for code.org. It seemed like fixing them was going to be so burdensome it would prevent them from updating. #7788
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.
This PR adds a method for serializing a block to the flyout, which is used during the block dragging/creation process. This will allow subclasses to override it to customize the block that gets created on the target workspace.
This is needed by scratch-blocks to ensure that newly created blocks have different IDs from their source blocks in the flyout, to allow uniquely identifying blocks.