[UIFLOW] Add a comment block.



  • Sorry if I missed something but I beleive comments are missing from UIFlow.

    While looking at visual code it is possible to determine what functions are being called but not the intent of the programmer.
    Also when used as a teaching tool encouraging comments encourages documentation.
    The alternative is to use th "Execute code:" block or document externally.

    0_1709752126077_9229e8fe-5fd4-42e7-ae4a-d142f7868018-image.png [UIFLOW] Add acomment block.



  • I have mentioned it several times but people don't like to search so well done for discovering it for yourself and sharing.



  • The official way to add comments only adds them to UIFlow (they are not exported into the python code)
    You can right-click any block and select "Add comment", which enables a question mark icon on the block. Clicking that icon lets you add a comment in a bubble.
    (I use those comments to describe why I did something specifically in UIflow/blockly.)

    The unofficial way is the code block you show. Those comments DO get exported into the python code.
    (I use those comments for things like describing variables usage and (re)configuration, stuff people would still need to know when using the micropython code directly.)

    It would however be wonderful to have one official "Comment block" block that could be set to work either way, and set to start expanded or collapsed, etc.
    I think it would be wise to retain "Insert into python code" or not as an option, as each type has advantages in different circumstances.