bbcmicrobit / bbcmicrobit/PythonEditor

blocks: how to handle 'undocked' blocks

未關閉
#43 5 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
201
分支
126
PR 合併指標
30 天內沒有已合併 PR

描述

(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](https://cloud.githubusercontent.com/assets/147113/23949163/173bc202-097e-11e7-83be-5256ff6149d7.png)
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](https://cloud.githubusercontent.com/assets/147113/23949380/e751dbc0-097e-11e7-8773-0b2b5c51fefa.png)
...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:
https://github.com/Microsoft/pxt/issues/849

貢獻指南

開啟貢獻指南

研究方向

先閱讀此 issue 中的討論,尤其是未停駐區塊的範例,然後查看 issue #42 和所參照的 PXT issue #849。在開始實作之前,需要先為未停駐區塊確定一致的行為;此處未定義完成標準。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
frontend
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。