scratchfoundation / scratchfoundation/scratch-blocks
Local variables should all be sorted after global variables
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.8k
- Forks
- 1.6k
- Avg merge
- 4h 51m
- Merged PRs (30d)
- 12
Description
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:
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the block palette collects and sorts global and local variables, then reproduce the A/global, B/local, C/global example from the issue. Done means globals appear first in alphanumeric order, followed by locals in alphanumeric order, with the resulting palette behavior matching the requested ordering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100