Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapsible define temperament and define mode blocks #2934

Closed
wants to merge 3 commits into from

Conversation

daksh4469
Copy link
Member

Issue Reference: #2931

Define temperament and define mode are now collapsible blocks.

@daksh4469
Copy link
Member Author

Please share your suggestions and feedback @walterbender.

Q: Should these blocks be in "collapsed" state when generated from a widget (as in the case of action block generated from the custom mode widget)?

Thanks.

@walterbender
Copy link
Member

collapsed is a good idea.

@daksh4469
Copy link
Member Author

To present the define mode and define temperament blocks in the collapsed state, I passed the {collapsed: true} object in the block stacks of "temperament1" and "definemode" after which the method loadNewBlocks method is called by passing this stack as the argument. This worked for define mode blocks but not for define temperament blocks. I suspect that there is a delay produced due to the time taken in loading the entire block stack of define temperament block(in the loadNewBlocks method) through the temperament widget, due to which it is not collapsing.
Suggestions on this, please.

@walterbender
Copy link
Member

I am not sure why the temperament stacks are often problematic when they load... I'll investigate.

@daksh4469
Copy link
Member Author

daksh4469 commented May 1, 2021

I tracked the state of the blocksToCollapse array. On clicking the "Save" button, two new block stacks are loaded(one of define temperament and one of set temperament) in the _save method. For this, the method loadNewBlocks is called for both these stacks. In this method, the blocksToCollapse array is re-initialized as an empty array here. Thus, when firstly the loadNewBlocks method is called for define temperament block stack, it is set to be in "collapsed" state in the cleanupAfterLoad method(by collapseToggle method here) which is called in the _generateCollapseArtwork method. Now, the loadNewBlocks is again called for the block stack of set temperament block, due to which the blocksToCollapse array is re-initialized as an empty array. Now, since the entire define temperament block stack is not loaded till this point, it does not collapse after completely loading as the array, blocksToCollapse is empty.
I tried setting a time-out to loading the define temperament block(after loading the set temperament blocks) so as to avoid this and it worked.

End Result:

temp.mp4

Please give your thoughts on this @walterbender.

@daksh4469
Copy link
Member Author

  • Define mode and define temperament blocks are now initialized in a collapsed state.
  • The initial positions of these blocks, when generated from widgets, are modified to prevent them from getting overlapped by the palette menu.
  • On clicking the "Save" button, the set temperament block is generated first, followed by define temperament block, and a timeout is set to loading of define temperament block to address the above-mentioned issue.

Please share your feedback and suggestions @walterbender @pikurasa .
Thanks.

@walterbender
Copy link
Member

This looks good. I have not merged it yet because I am working on a major overhaul, to which I will migrate your patch.

@walterbender
Copy link
Member

FYI: 6eef801

walterbender added a commit that referenced this pull request May 13, 2021
* clean up many un/misdeclared variables

* use getter/setter for octaveRatio

* use functions to access TEMPERAMENT

* eslint

* refactor to eliminate most globals and all eslint errors

* no longer supported

* refactor in response to activity.js refactoring

* refactor in response to activity.js refactoring

* refactor in response to activity.js refactoring

* refactor in response to activity.js refactoring

* refactor in response to activity.js refactoring

* refactor in response to activity.js refactoring

* refactoring due to changes to activity.js

* wrong case on exported

* inadvertently removed

* temporarily disable plugins and myblocks

* fix inconsistency with cameraID

* fix regression with custom pitch block

* handle neg. cents

* fix regression in stage

* fix regression with grid

* fix my blocks code

* fix regression in collapse graphics

* update maths plugin to reflect new format

* add support for flow plugins

* add external support for hideArrows

* linting

* mark as deprecated

* refactor to new format

* refactor plugin global storage

* updates for new refactor

* more changes to fix long-standing regressions with plugins

* more plugin updates

* updated to new format

* wrapping up plugin changes

* fix lint warnings

* don't use global lint disable

* missed one

* Fixes Mouse Name Block Connection issues #2942

* Fix: Print simultaneous with the note #2938

* Fixed : NaN appearing in Stats #2937

* Collapsible define temperament and define mode blocks #2934

* [email protected]

* fixes #2907: When new project button is pressed, the original project is first saved #2923

* missed some tweaks due to refactoring

* don't crash when macros as malformed

* lint

Co-authored-by: Kumar Saurabh Raj <[email protected]>
Co-authored-by: Daksh Shah <[email protected]>
Co-authored-by: Joykirat Singh <[email protected]>
Co-authored-by: Daksh Doshi <[email protected]>
Co-authored-by: tborich <[email protected]>
@walterbender
Copy link
Member

Merged as part of #2943

@daksh4469 daksh4469 deleted the collapsible branch May 14, 2021 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants