Scratch-blocks: Local variables should all be sorted after global variables

Created on 10 Jul 2018  路  4Comments  路  Source: LLK/scratch-blocks

Expected Behavior

Local variables should, in the block palette, be sorted so that they all appear (in alphanumeric order) after all the global variables.

Actual Behavior

Local variables and global variables are sorted together.

Steps to Reproduce

Create a global variable such as "A". Create a local variable such as "B". Create a global variable such as "C". Note that the sort order is A, B (local), C, not A, C, B (local).


This sort of ties into #1379. I believe in 2.0 all variables are sorted together, so I suppose this is a request more than a compatibility issue. It should be noted that Scratch 1.4 has a visible horizontal-rule separator between global variables and local variables:

A, C; separator line; B. Scratch 1.4.

I don't think scratch-blocks has support for <hr>-style separators, but it does have ordinary separator spaces (e.g. between "point towards mouse-pointer" and "change x by 10"). Could be useful here.

feature needs-triage

All 4 comments

For clarity you could also include a label for each type of variable, rather than a simple separator space. That would need to be translated, but I think it's text that's already translated.

See https://github.com/LLK/scratch-blocks/pull/1657 for more discussion about the labeling of variable scope, including some great demo code from @towerofnix. We'll take "help wanted" off this issue for now, since it needs some more design discussion (see end of that link for more about that)

@paulkaplan Sounds good, glad to use my PR and discussion as a starting board :)

(PS, the help wanted label is still here!)

Another important point - the dropdown menu for variables would also have to be updated. And maybe it's just me, but having two relatively long, user-generated, separated lists within a dropdown seems a little unwieldy..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brianpoor5775 picture brianpoor5775  路  4Comments

tmickel picture tmickel  路  6Comments

thisandagain picture thisandagain  路  5Comments

tmickel picture tmickel  路  3Comments

picklesrus picture picklesrus  路  3Comments