Skip to content

blocks: how to handle 'undocked' blocks #43

Open
@jaustin

Description

@jaustin

(this is a complex one that I think needs some discussion - opening this issue as a place for that)

At the moment in blocks, as far as I can see, any block on the canvas will cause code to be generated and likely run. There aren't 'hats' or 'events', not even an 'on start' one.

This can cause a few possible issues.
For one, it's fundamentally different to scratch
image
In this case, the 'hmm' will never happen.
The difference is not in itself a reason to change, but In the past we've seen kids use 'undocking' blocks as a way to 'comment them out' (IE you build a complex set of blocks and then 'undock' them in order to stop them running. This is one good reason to think about how things work.

(it's also different from PXT, too)

Secondly, it can create some confusing things on canvas if your project has grown and then shrunk again.

For example, someone who knows how to code will easily spot the issue here:
image
...but for someone who is only focused on the blocks this could be really confusing. This is a slightly artificial example, but I think the problem in general is real, especially given the lack of clear notification that things are not currently visible, etc. (see in part #42 )

Note that PXT removed 'hats' early on in development and decided to add them back. There's a good discussion about that here:
microsoft/pxt#849

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions