Check for duplicates
Problem
Currently, the location of block comments in the workspace are not preserved/restored when (de)serializing them, unlike workspace comments.
Request
To do this, we should:
- Extend
ICommentIcon and its implementation with setBubbleLocation(location: Coordinate): void and getBubbleLocation(): Coordinate methods.
- Update
blockToDom() to call getBubbleLocation() and persist the coordinate under x and y attributes in the block comment XML, and update applyCommentTagNodes() to move the comment to the specified location when deserializing. I realize we're not adding new functionality to XML serialization in general, but this particular change makes work on upgrading Scratch easier and is quite small/contained.
- Update
saveState() and loadState() in CommentIcon to persist and restore the comment coordinates when using JSON serialization.
- Update the tests to exercise moving the comment and (de)serialization
Alternatives considered
No response
Additional context
No response
Check for duplicates
Problem
Currently, the location of block comments in the workspace are not preserved/restored when (de)serializing them, unlike workspace comments.
Request
To do this, we should:
ICommentIconand its implementation withsetBubbleLocation(location: Coordinate): voidandgetBubbleLocation(): Coordinatemethods.blockToDom()to callgetBubbleLocation()and persist the coordinate underxandyattributes in the block comment XML, and updateapplyCommentTagNodes()to move the comment to the specified location when deserializing. I realize we're not adding new functionality to XML serialization in general, but this particular change makes work on upgrading Scratch easier and is quite small/contained.saveState()andloadState()inCommentIconto persist and restore the comment coordinates when using JSON serialization.Alternatives considered
No response
Additional context
No response