Giter VIP home page Giter VIP logo

Comments (5)

tmickel avatar tmickel commented on August 16, 2024

aahhh!

When blocks are dragged from the flyout, a new CREATE event is generated for them - with a different workspaceId. But then, a DELETE event is fired for the old block in the flyout - which has the same block ID, but a different workspaceId.

Our implementation doesn't consider workspaceId because I assumed the blocks in the flyout would have unique IDs vs. the blocks in the workspace. Not sure why this didn't become a problem in the prototype. Probably a good way to solve this would be just track workspaceId on the block representation as well, e.g., blocks[workspaceId][blockId] = {...}. Any thoughts, @thisandagain ?

from scratch-vm.

tmickel avatar tmickel commented on August 16, 2024

Oh, actually we never saw this in the prototype because flyout blocks were never created/destroyed after the first display of the flyout. This is only really a problem with category switches.

from scratch-vm.

thisandagain avatar thisandagain commented on August 16, 2024

Yikes. Tracking the workspace ID along with the block seems like a reasonable way to deal with it. This and #46 might be nice to talk about today.

from scratch-vm.

tmickel avatar tmickel commented on August 16, 2024

Other options include:

  • Modify Blockly to generate a new unique ID for blocks when they're dragged from the flyout to the workspace.
  • Tack on workspace ID to block ID in the VM representation (e.g., "workspaceId:blockId") and make sure to parse this correctly as it's going in and out.

from scratch-vm.

tmickel avatar tmickel commented on August 16, 2024

We've fixed the problem in scratch-blocks by ensuring blocks always have a unique ID.

from scratch-vm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.