Makecode, if then else block, false is dropped to the canvas
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 641
- Avg merge
- 12h 4m
- Merged PRs (30d)
- 57
Description
Makecode has block if else that generates code if .. else if .. else if .. else. This is useful block but it is full of troubles.
-
New
else ifsection can be added only at the end of the block (before the lastelse). It is not possible to insert newelse ifsection in the middle (+button is missing at innerelse ifparts) -
It is possible to delete any
else ifpart (-) button of the complex statement but there is no way to add it back later (see point 1) -
When
else ifparts are added (+) or deleted (-),falsevalue is drooped to the "desk", these values cannot be selected and deleted. Well, man has to exit editor and then reopen project, then it is possible to select and delete those disconnectedfalseblocks. And there could be many of them, it is not easy task to clean up the desk... It is possible that more then 1falseblock is dropped for eachelse ifsection... This is a BUG in the editor.
This block is useful but I have stopped to use it because it is buggy (point 3) and difficult to use (point 1).
Hint, Try to use use this block to write event handler for DPAD messages, 16 "if else" sections has to be added to handle 2 states of 8 buttons. that is a long statement. It is not easy to change order of conditions in such statement or insert new condition to the middle of the block... Some details are here https://kitronik.co.uk/blogs/resources/adding-bluetooth-remote-control-move-mini
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the MakeCode editor's if/else block behavior described here, especially adding or removing inner else-if sections. Trace the editor path that handles those block mutations; no file or test is identified in the issue. Done means inner else-if sections can be inserted and removed without dropping disconnected false blocks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100