Initialization of interactions area on page load
Currently, interactions loads in a context that doesn't match anything users expect – it has num-max and other global builtins, but not images or other important libraries in essentials. Clicking “Run” puts interactions into the context of definitions.
This is jarring when students try to, for example, make a circle after creating a new program.
For context, some simple non-solutions are:
- Auto-running programs on page load. This is just too fraught with all the behavior a program can have to be safe or sensible to do automatically.
- Completely disabling interactions until first run. Bootstrap training (and other 1st day activities) dive right into interactions with numbers and arithmetic, and we can't rewrite/find all hard copies of that material to update it, and first days are fragile.
Instead, we propose:
- For brand-new programs and direct visits to https://code.pyret.org/editor, interactions starts with
use context essentialsNNNNloaded. - For
#shareand#programlinks, interactions is disabled on page load until the first run. Interactions is grayed out with a message that points an arrow towards the Run button to guide students to click on that; after this interactions functions as usual.
Quite possibly this is silly, but: is there not any way to tell what context the program would run in without fully running it?
I know we can't get the actual effect of the definitions in the program area, but I would have thought we could parse the program and tell if it has a use context or not. That would let us make this work uniformly for #share/#program cases, too.