-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: Add support for preserving block comment locations. #8231
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic LGTM assuming you tested that round-tripping the coords in RTL works correctly. Easy to typo that stuff.
Can you also:
- Update the breaking change section of the PR description to tell people they'll need to implement these new methods if they're creating a custom comment icon.
- File an issue to update the docs on creating a custom comment icon to include this info?
Yep, verified roundtripping with each layout as well as going between them for both XML and JSON.
Done
Sent you a CL updating the docs |
The basics
The details
Resolves
Fixes #8230
Proposed Changes
This PR preserves the positions of block comments when (de)serializing a workspace.
Reason for Changes
We allow users to position block comments arbitrarily, but while we preserve the location of workspace comments when (de)serializing the workspace, block comments have their positions lost. This is also needed to support the Scratch modernization effort, since Scratch persists block comment locations as well.
Breaking Change
This PR modifies the ICommentIcon interface to have two additional methods:
setBubbleLocation(location: Coordinate): void
andgetBubbleLocation(): Coordinate | undefined
. If you have a class that implements ICommentIcon, you'll need to implement these methods as well. They should set and retrieve the location of the comment bubble/box, in workspace coordinates.