Skip to content

Remix programs#78

Merged
cabarnes merged 7 commits into
rovercode:alphafrom
cabarnes:remix-programs
Jul 5, 2019
Merged

Remix programs#78
cabarnes merged 7 commits into
rovercode:alphafrom
cabarnes:remix-programs

Conversation

@cabarnes
Copy link
Copy Markdown
Member

Closes #64

Depends somewhat on rovercode/rovercode-web#239 for name conflict resolution.

Adds a Remix button when viewing a program in read-only mode:
image
When clicked, the program is copied for the current user. The user is redirected back to the programs list with a message indicating that the remix is complete:
image
The user can now edit the program like any other owned program.

This seemed like the safest way to handle all of the state change through mission control when a new program is loaded and is now writable.

@cabarnes cabarnes requested a review from hbradio June 24, 2019 02:58
@hbradio
Copy link
Copy Markdown
Contributor

hbradio commented Jun 24, 2019

The user is redirected back to the programs list... This seemed like the safest way to handle all of the state change through mission control when a new program is loaded and is now writable.

It sounds like you tried it and it got pretty complicated, but would it be possible to keep the user in Mission Control and replace the program with their new, editable one? Scratch and Glitch do that, and it's really nice to go straight from viewing someone else's to editing your own copy.

If it's way too hairy, we can punt on it.

@cabarnes
Copy link
Copy Markdown
Member Author

It did get complicated so I wanted to get your thoughts on this approach. One idea that I had was to just have the program list immediately load the new program and redirect the user back to mission control. I can try that and see what the user experiences.

@cabarnes
Copy link
Copy Markdown
Member Author

@aninternetof I figured out the right way to accomplish this with leaving the user in Mission Control. The read only state was moved to redux so that the workspace and program name components can render on a change. The Blockly workspace must be removed and re-created to change the read only state: https://groups.google.com/forum/#!topic/blockly/NCukwTKMR0U

Copy link
Copy Markdown
Contributor

@hbradio hbradio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Thanks for doing the extra rework!

@hbradio
Copy link
Copy Markdown
Contributor

hbradio commented Jun 27, 2019

Hm. I created two users. Every program I create for user hbradio also shows up as a program owned by the other user otheruser.

image

This could be another symptom of the state not clearing when I log out?

I'll play with it a bit more when I get home.

@hbradio
Copy link
Copy Markdown
Contributor

hbradio commented Jul 4, 2019

I figured out that I was running an old version of the API, which was ignoring my query filters. So there's no problem with the UI, and this is good to merge!

@cabarnes cabarnes merged commit d30dc22 into rovercode:alpha Jul 5, 2019
@cabarnes cabarnes deleted the remix-programs branch July 5, 2019 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support program remixing

2 participants