Skip to content
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

Add fork button #278

Merged
merged 10 commits into from
May 26, 2020
Merged

Add fork button #278

merged 10 commits into from
May 26, 2020

Conversation

jamieliu386
Copy link
Contributor

Adds the forking feature to a view-only sketch if the user is logged in.

fork button

After pressing the fork button, a modal appears asking the user to confirm the fork.
confirmation

forking

Once the sketch is successfully forked, the user is prompted to visit their sketches page or close the modal.

sketch forked

If opened again, the modal remains at the final prompt.

…ly sketch.

Previously, a view-only sketch would be rendered with the same thumbnail and language as the user's most recent program.
Upon clicking the fork button, a modal appears to confirm the fork. If the fork button is clicked, the fork is initiated. Upon completion, a message appears alerting the user that the fork has completed.
@jamieliu386
Copy link
Contributor Author

I'm unsure about the styling of the fork button (what color?) and if the wording in the modal should be changed.

@krashanoff krashanoff self-requested a review May 18, 2020 21:31
@krashanoff
Copy link
Contributor

I personally like the look of it as is right now, actually, but that's mostly because it's reminiscent of the GitHub fork look. Something that is a bit of a concern is that I feel like the icon is pretty unfamiliar for new coders and would warrant an explicit label, but then it wouldn't look as clean :sigh:

image

@jamieliu386
Copy link
Contributor Author

jamieliu386 commented May 18, 2020

Something that is a bit of a concern is that I feel like the icon is pretty unfamiliar for new coders and would warrant an explicit label

Yeah, I agree.

but then it wouldn't look as clean :sigh:

A nice thing is that having an explicit label would look consistent with the Save button in the editor.

However, the function of the button is pretty clear once you click on it and read the description. I don't feel too strongly either way.

@krashanoff
Copy link
Contributor

having an explicit label would look consistent with the Save button in the editor.

Yeah that's actually a huge plus. I'm leaning more and more towards giving it a label and leaving it at that. In terms of the manual/automatic redirect business, we still have to figure out a cleaner way of doing that -- might be a separate issue entirely since it touches on the editor and also the deleteModal.

@mattxwang
Copy link
Collaborator

So after further discussion, I think what's on live is from a feature-perspective reasonable enough. Definitely not in the right state of mind to do a code review, but @krashanoff take a look when you can (or tag someone in).

@krashanoff
Copy link
Contributor

I'll take code review on this one! I agree that things are looking good 👍

Should have a review out by the end of the week.

@mattxwang mattxwang added the feature New feature or request label May 23, 2020
@jamieliu386
Copy link
Contributor Author

@malsf21 Thanks for the review! I fixed the typos.

Copy link
Contributor

@krashanoff krashanoff left a comment

Choose a reason for hiding this comment

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

Hey Jamie! Sorry for the delay on getting this review out. Everything looks solid to me, but I did encounter a bug. I was just testing around with it and everything was looking good until I performed the following sequence of actions:

  1. Navigate to a nonexistent sketch in the viewonly editor. For example: /p/bogus.
  2. Navigate to a sketch that exists in the viewonly editor. When I encountered this bug, I was using my own sketch.
  3. Fork the sketch
  4. Click OK to redirect
  5. Crashes as it thinks we are using a Redirect outside of a router.

I can't replicate this on the netlify deploy, but can consistently perform it locally. Anyone else see this issue?

@jamieliu386
Copy link
Contributor Author

jamieliu386 commented May 25, 2020

I can't replicate this on the netlify deploy, but can consistently perform it locally. Anyone else see this issue?

I just tried out the sequence of steps locally (using one of my own sketches as well) and weirdly I was unable to reproduce the bug. Tagging @malsf21 to see if he can?

Copy link
Contributor

@krashanoff krashanoff left a comment

Choose a reason for hiding this comment

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

Just redid the same sequence on my other machine and things were okay. I may have been using a 2-3 weeks old versions of our deps on my desktop compared to the latest versions which I used on my laptop which led to the error (whoops!). While I won't lie that it is concerning that this doesn't work on an older version of our deps, if it works on our current deps I have no problem with merging this now. May warrant further investigation on my end. Thanks a ton Jamie!

@jamieliu386
Copy link
Contributor Author

Ok, great! I resolved the merge conflicts and made sure the "share" button is hidden in view-only mode, so this feature should be good to go now!

@jamieliu386 jamieliu386 marked this pull request as draft May 26, 2020 18:39
@krashanoff krashanoff marked this pull request as ready for review May 26, 2020 20:19
@krashanoff
Copy link
Contributor

Phew! Glad we caught that one. I'll go ahead and merge this now that things are squared away. I'll be marking this as a minor release this week to commemorate the addition of the share and fork buttons. Thanks again Jamie! 👍

@krashanoff krashanoff merged commit e519970 into master May 26, 2020
@krashanoff krashanoff deleted the add-fork-button branch May 26, 2020 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants