-
Notifications
You must be signed in to change notification settings - Fork 47
prototype snap integration with CPO #462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WHAT!!!!! WOW!!!!!!
(Sorry, that is not a code review.)
|
Very cool! Yeah, refactoring I guess the next step is some kind of configuration file to do the code mappings? I can add them manually with right-click to get |
Yeah, we can do that. @elijah E Rivera ***@***.***> has really
become the master of this since then.
How do we connect up the blocks with how they translate into Pyret?
|
@shriram the mappings are handled by the |
My last commit hooks up @jmoenig's most recent support for exporting/loading just the additional blocks that are being added. For now this just saves and loads from local storage. A couple questions:
|
I always defer to @jpolitz on all things Pyret-related, but I'm guessing he's going to veto (c) right away. I'm inclined to say option (b) allows us to get this out into the world faster and simplifies our UI complexity considerably. Merging the UIs and refactoring the workflow to support multiple filetypes would need to be done together, and I suspect there are UI questions we won't be able to answer until we get this into teachers' hands and see how they're using it. |
(a) felt like the right thing to do at first, but I worry that CPO doesn't have much of a well-defined interface for what a “file” is, and there'd be a bunch of weird stuff about source locations / error messages that makes assumptions about there being a Pyret file. That could be a real mess; I wouldn't look forward to that refactor at all. That said, if someone was excited to take that on and kept all the UI tests running while doing the refactor, it's not a terrible risk. (b) is what I'd suggest, though, to get user feedback. Long-term the right thing might be to put this into the new editor at @schanzer is pretty much right about (c), though I think the detection is only medium-scary. It's really that having another way of running programs on the same page is just, well, challenging given the state and complexity of that system. |
@pcardune I've updated the Snap api so you can provide a callback to the configuration dictionary that gets called when the transpile microworld is loaded and ready: I've also updated my little POC page with an example how this could be used: https://github.com/jmoenig/Snap/blob/f24b00c1d43917ac03b989c6229daef8f8ffe336/pyret/inline.html#L35 This lets you Please let me know if you encounter any issue or if there's anything I can contribute / help you with! |
…odify google drive file handling
Thanks @jmoenig! I've updated this branch to that use that loader. @jpolitz I hacked together a fork of beforePyret.js (now called beforeBlocks.js) to save/load block xml files to/from google drive. I also added a hack to check the contents of the file for the blocks xml and redirect to /blocks in order to support opening files from the root dashboard without copying and pasting a lot of code. See this commit for the changes. I'm sure there are bugs, because it's very difficult to figure out all the entry points. Anyway, I think the next step is to update the transpile.xml file that @jmoenig mentioned to do the code mappings for all the other blocks. Is that something you want to take care of @jpolitz? @schanzer was also talking about changing the set of blocks that are available to choose from (including potentially their appearance?) |
yay, thanks @pcardune ! BTW if y'all need help with updating and extending the |
Apologies for the delay - February and March contain a 6-week stretch where I'm running flat-out on multiple projects, so my latency is spiking. @pcardune can you share the client_id information (and anything else I need) to properly connect to Google Drive? Finally - minor, unimportant nit - the blocks window is tiny and fixed, rather than filling up the Definitions Area and resizing with it. It also sits atop CPO's menus. I tried appending the canvas to |
Same here, @schanzer, I'm myself pretty much tied up for the next 2-3 weeks, so no worries. |
This PR adds a /blocks page (which is mostly a copy paste of /editor) that integrates Snap into the IDE.
Here's a screenshot:

Snap isn't packaged in any way, so I resorted to using git submodules to add it in, and copying the entire git directory into the build/ directory in the Makefile.
Some improvements that could be made:
Thanks to @jmoenig for making the changes to Snap that allow for this integration. cc @schanzer who would like to try this out.