sugarlabs / musicblocks

Music Blocks -- A musical microworld
https://musicblocks.sugarlabs.org/
GNU Affero General Public License v3.0
549 stars 748 forks source link

Collapsed blocks are showing their expanded state #3941

Closed pikurasa closed 3 weeks ago

pikurasa commented 1 month ago

Description

Collapsed blocks are rendering some of their expanded state.

Expected Behavior

A collapsed block shouldn't show anything from its expanded state.

Screenshots

Screenshot from 2024-07-11 21-27-00

How to Reproduce

Collapse an action/start block and move it around a little.

Console log Errors:

I don't see anything of interest...

Environment:

Presumably all.

Checklist


Thank you for contributing to our project! We appreciate your help in improving it.

πŸ“š See contributing instructions.

πŸ™‹πŸΎπŸ™‹πŸΌ Questions: Community Matrix Server.

Yash020405 commented 1 month ago

@pikurasa I would like to resolve this issue

therealharshit commented 1 month ago

@pikurasa @walterbender I have tried to work on this issue, but since I am new to the codebase I couldn't. What i tried is that I have gone through activity.js file and found a function "toggleCollapsibleStacks" which I think could be related to this issue. Please help me to locate the file/function from which i can resolve it.

walterbender commented 1 month ago

The collapse artwork is generated in block.js. The functions for showing/hiding the collapse artwork is also there. It seems that the problem is with the containing action (or start) block, so maybe add some console log messages to see if you can determine when the show/hide is triggered.

therealharshit commented 1 month ago

@pikurasa @walterbender Screenshot 2024-07-17 000712 I added some trigger messages and according to me show/ hide is triggered at correct time, its the expanded block which is rendering when we collapse the block and move it around. What I think: the problem is with the event, when we click the block and move it around, it starts rendering both expanded and collapsed state of that block.

walterbender commented 1 month ago

Could be a race condition of some sort between hiding the expanded version and showing the collapsed version.

walterbender commented 3 weeks ago

@pikurasa please let me know if you see this any more. I think I fixed it but may have missed a corner case.