question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Block comments should not be owned by the icon in a rendered workspace

See original GitHub issue

Problem statement

On a rendered workspace the icon for opening the comment also owns the text for that comment. This means the block model depends on the rendered icon for information about the comment text (and position). This information should be independent of the icon so that it isn’t lost when loaded/saved in a headless workspace.

Expected Behavior

  • Comment data is preserved in headless workspaces.
  • There should not be any special cases for serializing comments.

Actual Behavior

  • Only the text is preserved in a headless workspace.
  • We have to special case delete events to avoid losing the comment when its icon is destroyed.

Steps to Reproduce

See discussion in #1960

Stack Traces

Replace with error stack trace.

Operating System and Browser

Additional Information

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
RoboErikGcommented, Aug 27, 2019

So it looks like block_svg is essentially doing that. If the comment text is set to null it deletes the icon and any string object (including empty string) creates the icon if it doesn’t already exist.

Regarding events, it looks like the event setting the comment text to ‘’ is a side effect and the addition/removal of the comment isn’t actually captured in events right now (if you add a comment then remove it without adding any text you won’t see any events). I think adding a comment should fire an event setting the event text to ‘’ and removing a comment should fire an event setting it to null.

Whether we serialize empty comments is a separate question. It looks like we currently don’t, which I’m fine with.

0reactions
samelhusseinicommented, Nov 1, 2019

Fixed by #2923

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue #1554 · LLK/scratch-blocks - Comments ToDo - GitHub
Block comments render too far away from blocks in wide stacks. Workspace does not scroll with block comments (e.g. if a block comment...
Read more >
Commenting in Workspaces and Versions - Onshape
Comments are not recorded in the workspace history. Tap the Comments icon to open and close the comment flyout.
Read more >
Comment Anchors - Visual Studio Marketplace
Extension for Visual Studio Code - Place anchor tags within comments for easy file and workspace navigation.
Read more >
August 11, 2022 – Comment reactions, progress bars & more
React to comments with emojis, visualize your number properties as progress bars, set default templates for databases, and much more.
Read more >
Blockly - WorkspaceSvg - Google Developers
Unlink from all DOM elements to prevent memory leaks. Find all blocks in workspace. Blocks are optionally sorted by position; top to bottom...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found