Reorder custom blocks

Loooooooong-wanted feature request here: there should be some way to reorder custom blocks. For comparison with Scratch:

  • In Scratch 2.0, custom blocks were sorted arbitrarily and inconsistently. (Presumably, the custom block "on top" in the workspace would be positioned at the end of the list - the result was that whenever you moved the "define" blocks around, the list would mysteriously rearrange itself.)

  • In Snap!, custom blocks are sorted so that the most recently created ones show up at the bottom of the list. This is consistent, but it locks you into a specific order. You have to prepare the order you want your custom blocks to be arranged from the start; if you don't, you end up with a list that may not be arranged in a useful manner.

  • In Scratch 3.0, custom blocks are sorted alphabetically, much like variables. This means you're locked into a particular order, but it's at least controllable by you and changeable after you've created your custom blocks: simply rename a custom block and the custom block order will change in a predictable way.

The problem with Snap! is that if you don't prepare well ahead, you'll end up with an assortment of blocks that are ordered rather arbitrarily. If your sprite or project has a lot of custom blocks, this can be remarkably inconvenient.

As a solution, I suggest one of the following:

  1. Steal Scratch 3.0's method - sort blocks alphabetically. This is straightforward to implement. However, it would mean messing with the order of custom blocks in existing libraries and projects.

  2. Implement a full-scale solution: an editor of sorts specifically designed for rearranging custom blocks. This should probably just be a mode of viewing the palette. When it's enabled, drag handles would appear beside each custom block. It'd be fast and straightforward; the last thing we want is confusing UI, of course. Down the road, the ability to arrange separators in your own custom block palettes could be added too.

I know this is a pretty big request, but I wanted to create it right away here on the forums for discussion, since it's really one of the most limiting factors of the Snap! editor presently. :')

Not big enough! :~) I want the ability to mix them in with the primitives. And to arrange the palette with two narrow blocks on the same line, so I can have the monadic minus block next to the subtraction one.

Currently, you can rearrange custom blocks by right-clicking on them and clicking "duplicate block definition...". It's not as efficient as drag handles, but it works.
Edit: in Snap! 6.0, you have to delete the previous block definition instance and remove the (2) from the new block spec.

I'd like to re-raise this request to be able to re-order custom blocks

I vote for this one, but in more expanded form:

You know about control-F to find blocks by name, right?

Yes, but still the human-factors of ctrl-f or click magnifying class to find each block is less ergonomic than having a shortlist of the 90% most common blocks right there in a view that you're used to the order you put them in.

That is, if you code Snap! by mousing, which most students probably do. I need to set aside some time (probably only 5 min!) and figure out keyboard mode

Yeah, I like your favorites idea. It competes somewhat with my Other idea, namely that (when we split the Variables tab into Variables, Lists, and Other) the Other tab should include all custom blocks, of all colors, in addition to their place in their native tab. Things to think about...

Interesting, I wondered why there was an 'Other' block category without a corresponding palette. If Variables spawns 2 new tabs, that's still an even number, no easy room to add an odd one, unless 'Favorites' lives in a centered tab rather than in the left/right column -- visually signifying the difference that it holds only copies/links, not actual block definitions.

I was thinking we could combine our ideas, and the Other tab could have first favorites and then all non-favorite custom blocks. With a


divider in between. Dunno if Jens will go for it, but we're clearly going to do something with the Other category. And Jens wants to invent user-created categories, to make extensions like NetsBlox and so on easier. (The less the extension has to mess with the core of Snap!, the easier it'll be to keep it usable with the latest Snap! release.)

That sounds great, with the note that an important aspect of my conops includes this OP's idea of being able to reorder blocks, so the user could put (links to) their favorite standard blocks, and their custom blocks, and separators, in any order that makes sense to them.

Righto.