_Please describe what should happen_
After creating a global variable, it should be available for all sprites.
_Describe what actually happens_
The variable disappears after switching to another sprite.
_Explain what someone needs to do in order to see what's described in Actual behavior above_
Note that this is not broken on http://llk.github.io/scratch-vm/
@rschamp Appears to be related to calling workspace.toolbox_.refreshSelection(), which we are doing on workspace update https://github.com/LLK/scratch-gui/blob/075216f585770f74a189ddaff66ac75a39c2308d/src/containers/blocks.jsx#L122
The git blame for that lines indicates it is being called because the sound dropdown menus wouldn't update for sprite changes.
@paulkaplan and I looked into this, here is what happens:
When switching sprites, the workspace is cleared (https://github.com/LLK/scratch-gui/blob/075216f585770f74a189ddaff66ac75a39c2308d/src/containers/blocks.jsx#L117) which clears workspace.variableList
The variable list is rebuilt during ScratchBlocks.Xml.domToWorkspace using the xml from the VM. Thus it only finds and restores the variables that are used in that workspace (so if you use the variable, in step 5 above, it will be restored on the cat)
Instead of parsing out of the xml, scratch blocks needs to get the list of variables from the VM.