Discuss Scratch
- Scratchuel21439new
-
100+ posts
Make C Blocks Collapsible
My Platformer Engine uses a lot the custom blocks, which makes me say…
Support!
Support!
- bananaandchoc1
-
1000+ posts
Make C Blocks Collapsible
I support this, since your coding area can get really cluttered and hard to find the bit you want to change if you have custom blocks with lots of code everywhere. I’d like to make my code more neat :3
- Yeetoburro1
-
1000+ posts
Make C Blocks Collapsible
Python, too, in loops and functions (The python equivalent of a custom block) Although in my experience, there is a little arrow near the line number. Yep, and I've seen a bunch of text-based languages like C++ and Java using those little + and - buttons to show or hide a { } section.
- MiniCoder11
-
100+ posts
Make C Blocks Collapsible
Note: This topic is only for code folding of custom blocks but my post also talks about an additional feature for code folding conditionals
I'd use this feature hundreds of times a day.
As a frequent user of massive custom blocks (mostly for the “run without screen refresh” feature and compactness), I can say from experience that large custom blocks with hundreds of child blocks are annoying to move around and lag the editor. With the ability to fold custom blocks, Scratchers would be able to easily move around large scripts and freely scroll the editor without the Blockly rendering engine turning your editor into a slideshow.
Additionally, tablet users (I mainly use a desktop but have spent lots of time using Scratch on a tablet) find it hard to drag around large scripts because it blocks out the screen around your finger and causes the tablet's browser to slow to a few frames per second. With code folding, tablet users would be able to fold their code, move it to a new spot, unfold it, and start editing again with minimal frustration and impact on their tablet's performance.
Code folding is a feature that I find myself missing every time I use Scratch because it is extremely useful. Custom blocks exist to allow users to save space and time in their code by abolishing the need for Scratchers to repeat themselves in their code. Code folding would allow Scratchers to organize their workspace even more and, if custom blocks automatically folded once they were dragged out of the backpack, you would be able to neatly position it in your code rather than cover your entire editor.
Scratch already has a feature similar to code folding but it is implemented only for editor comments.
For those that don't understand what code folding is, it is a simple feature that allows you to click a small button on a custom block definition to hide all of the blocks under it. Clicking the button does not get rid of the blocks beneath the definition, it just removes them from view until you click the button again to show them. This is useful for getting rid of bulky blocks that take up to much precious editing space. Folded blocks also work the exact same way as unfolded block definitions and do not alter the way that the blocks within the definition run.
Here is a list of features we'd need to implement code folding correctly:
Even though I'd think that these changes would be easy to implement, we still have to factor in that Scratch now uses Google's Blockly API so the Scratch team may have to ask the Blockly team to add this feature instead of just adding it themselves. If this is the case, I'd love to see if we could come together and submit a collective request for the feature.
I'd use this feature hundreds of times a day.
As a frequent user of massive custom blocks (mostly for the “run without screen refresh” feature and compactness), I can say from experience that large custom blocks with hundreds of child blocks are annoying to move around and lag the editor. With the ability to fold custom blocks, Scratchers would be able to easily move around large scripts and freely scroll the editor without the Blockly rendering engine turning your editor into a slideshow.
Additionally, tablet users (I mainly use a desktop but have spent lots of time using Scratch on a tablet) find it hard to drag around large scripts because it blocks out the screen around your finger and causes the tablet's browser to slow to a few frames per second. With code folding, tablet users would be able to fold their code, move it to a new spot, unfold it, and start editing again with minimal frustration and impact on their tablet's performance.
Code folding is a feature that I find myself missing every time I use Scratch because it is extremely useful. Custom blocks exist to allow users to save space and time in their code by abolishing the need for Scratchers to repeat themselves in their code. Code folding would allow Scratchers to organize their workspace even more and, if custom blocks automatically folded once they were dragged out of the backpack, you would be able to neatly position it in your code rather than cover your entire editor.
Scratch already has a feature similar to code folding but it is implemented only for editor comments.
For those that don't understand what code folding is, it is a simple feature that allows you to click a small button on a custom block definition to hide all of the blocks under it. Clicking the button does not get rid of the blocks beneath the definition, it just removes them from view until you click the button again to show them. This is useful for getting rid of bulky blocks that take up to much precious editing space. Folded blocks also work the exact same way as unfolded block definitions and do not alter the way that the blocks within the definition run.
Here is a list of features we'd need to implement code folding correctly:
- A new style for folded blocks including an arrow or other indicator that the block was folded.
- The ability to run a folded block by clicking on it the same way as you would run a non-folded custom block (This already works. Just verifying).
- Options in the “Edit” tab in the top left of the editor for “Expand all custom blocks” and “Fold all custom blocks”.
- A new option when right-clicking a custom block to either “Expand block” or “Fold block” (Accessibility for users that can't click the normal button).
- A feature that “pushes down” blocks beneath a folded custom block when it is unfolded so that they don't get covered by it. This also includes a feature to “pull up” the blocks beneath the folded block when it is folded so that the folding process doesn't leave too much space under the custom block.
- Although not part of the original suggestion, I think it would also be really helpful to be able to fold conditionals (the blocks shaped like a C) and hat blocks (green flag clicked, when I receive message, etc.) Although this feature isn’t necessary to complete the suggestion of the original poster, it would still help reduce clutter and ease the use of the Scratch editor for mobile users in the same way that folding custom blocks would.
Even though I'd think that these changes would be easy to implement, we still have to factor in that Scratch now uses Google's Blockly API so the Scratch team may have to ask the Blockly team to add this feature instead of just adding it themselves. If this is the case, I'd love to see if we could come together and submit a collective request for the feature.
Last edited by MiniCoder11 (July 17, 2020 06:09:58)
- Scratchuel21439new
-
100+ posts
Make C Blocks Collapsible
hundreds of times a day.Yeah, you have ALL but All but AAALLLLLL the reason! I'd use this feature
As a frequent user of massive custom blocks (mostly for the “run without screen refresh” feature and compactness), I can say from experience that large custom blocks with hundreds of child blocks are annoying to move around and lag the editor. With the ability to fold custom blocks, Scratchers would be able to easily move around large scripts and freely scroll the editor without the Blockly rendering engine turning your editor into a slideshow.
Additionally, tablet users (I mainly use a desktop but have spent lots of time using Scratch on a tablet) find it hard to drag around large scripts because it blocks out the screen around your finger and causes the tablet's browser to slow to a few frames per second. With code folding, tablet users would be able to fold their code, move it to a new spot, unfold it, and start editing again with minimal frustration and impact on their tablet's performance.
Code folding is a feature that I find myself missing every time I use Scratch because it is extremely useful. Custom blocks exist to allow users to save space and time in their code by abolishing the need for Scratchers to repeat themselves in their code. Code folding would allow Scratchers to organize their workspace even more and, if custom blocks automatically folded once they were dragged out of the backpack, you would be able to neatly position it in your code rather than cover your entire editor.
Scratch already has a feature similar to code folding but it is implemented only for editor comments.
Here is a list of features we'd need to implement code folding correctly:
- A new style for folded blocks including an arrow or other indicator that the block was folded.
- The ability to run a folded block by clicking on it the same way as you would run a non-folded custom block.
- Options in the “Edit” tab in the top left of the editor for “Expand all custom blocks” and “Fold all custom blocks”.
- A new option when right-clicking a custom block to either “Expand block” or “Fold block”.
Even though I'd think that these changes would be easy to implement, we still have to factor in that Scratch now uses Google's Blockly API so the Scratch team may have to ask the Blockly team to add this feature instead of just adding it themselves. If this is the case, I'd love to see if we could come together and submit a collective request for the feature.
- JackK211424
-
500+ posts
Make C Blocks Collapsible
- A new style for folded blocks including an arrow or other indicator that the block was folded.
- The ability to run a folded block by clicking on it the same way as you would run a non-folded custom block.
- Options in the “Edit” tab in the top left of the editor for “Expand all custom blocks” and “Fold all custom blocks”.
- A new option when right-clicking a custom block to either “Expand block” or “Fold block”.
2. you can do that
3. im not sure, but that would also be cool
4 is that needed? there is a button next to the block, I would use the button rather then the right click.
- gamebeater187
-
1000+ posts
Make C Blocks Collapsible
Support. This block helps clean up massive code.
- Scratchuel21439new
-
100+ posts
Make C Blocks Collapsible
Bump
Bump
Bump
Bump
To help this to be in the top.
Bump
Bump
Bump
To help this to be in the top.
- Priff
-
66 posts
Make C Blocks Collapsible
when green flag clicked
repeat until <suggestion is accepted>
bump
end
say [YES!]
- JackK211424
-
500+ posts
Make C Blocks Collapsible
remember,
dont block spam. just bump it if you want to.
dont block spam. just bump it if you want to.
- --Explosion--
-
1000+ posts
Make C Blocks Collapsible
Total support! This would be really amazing for code organization!
- -Zyte-
-
1000+ posts
Make C Blocks Collapsible
Support! For really complicated blocks, or people that just want their workspace to be cleaner, like me, can use this so it doesn't clutter up the entire workspace! Also, it's called “collapsing” (folding it up) and “expanding” (expanding, do i really have to explain?) custom blocks, but you can say whatever you want.
- RobFarley74
-
100+ posts
Make C Blocks Collapsible
I appreciate it's kinda splitting hairs and really not important in the grand scheme of things, however, the actual name for the mechanism is code folding… But it is often described as a collapsed or expanded block or code. Support! For really complicated blocks, or people that just want their workspace to be cleaner, like me, can use this so it doesn't clutter up the entire workspace! Also, it's called “collapsing” (folding it up) and “expanding” (expanding, do i really have to explain?) custom blocks, but you can say whatever you want.
https://en.wikipedia.org/wiki/Code_folding
Last edited by RobFarley74 (July 24, 2020 13:48:20)
- MiniCoder11
-
100+ posts
Make C Blocks Collapsible
I don't usually like to do this but this topic really needs to be bumped back up to the top. It is such a necessary feature.
- Byron_Inc
-
1000+ posts
Make C Blocks Collapsible
Support. One of my project have a custom block with 2200 blocks (It was a 100% pen text engine) and it cluttered up 2 thirds of my coding area. It'll be great if you can fold it.
Last edited by Byron_Inc (Aug. 24, 2020 05:10:21)
- zeussesions
-
1 post
Make C Blocks Collapsible
Suppourt
It would make organizing code so much easier.
It would make organizing code so much easier.
- gosoccerboy5
-
1000+ posts
Make C Blocks Collapsible
Support, code looks cleaner and more organized that way, and especially for big projects this would be great.
- ipaddude
-
100+ posts
Make C Blocks Collapsible
support
most good text IDEs have a similar feature
(also my code is messy as heck)
most good text IDEs have a similar feature
(also my code is messy as heck)
Last edited by ipaddude (Feb. 2, 2021 17:23:19)