You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys! Amazing addon with lot of awesome features 💯
Github displays the original repo path when visiting a fork. But, the original don't have link to your fork. Right now we have to access the forks from here...
My proposal is to add a forked to cg-cnu/refined-github below the original repo.
Let me know your comments and ideas. Will be happy to do a pr if you guys like it.
Cheers 😄
Thanks for reopening the issue @bfred-it , continuing the discussion from the pr #1108
Might be a crazy idea, how about just displaying the text fork : <user-name>/<repo-name> below every repo (apart from yours) irrespective of you have fork or not.
On clicking the link
If you have fork, go to the link.
if you don't have the fork, open the Where should we fork this repository? modal dialog.
@sangeeth96, the best I can think of to get the link working with out making the api calls.
When you visit a fork of your own (have upstream link in the header and settings tab).
We could cache as a map that this upstream repo correspond to your fork.
When you visit the upstream repo we'd check the cached map of your own forks and we'd add a link under the upstream name to your fork.
A caveat here is that you could have multiple forks you have access to of a single repo (forks in multiple organisations and user), but we can still support that by showing multiple forks in the header to choose from.
I think this is a simpler implementation and would show you the information that you've forked this in a familiar way.
I delete the fork and never visit it again
Your link stays there forever?
I haven't thought of that indeed. Cache invalidation here is hard, but we can invalidate it on 2 events:
Visiting the 404 URL of the fork (we could detect it's a 404 and the URL should be in our cache map). This would invalidate the cache after first click on the missing fork link.
Detecting the deletion of the fork in the Settings tab and invalidating the cache for that fork. I don't think this would be too hard.
So the caching implementation is not so easier with the invalidation, but I still think it's a good one as we won't be performing API calls and you have the fork link on the page immediately in a familiar fashion. I don't think detecting the fork dialog or adding a drop down button would be a good experience.
We don't detect the dialog but we open an intermediary page invisible to the user.
There's no real dropdown, it's just the button that opens the regular dialog. If you don't like that "arrow down" we can leave it as is and just add an extra "your fork" button that either visits or creates "your fork"
Essentially the difference here is that in your case we might:
not have the link of our fork if we created it on a different computer
have a 404 link that disappears after the first visit (especially if deleted on a different computer)
and in my case:
the link always visits the fork, whether it exists or not, that's why I wanted to hide it behind the regular "Fork" button.
It's exactly how the Fork button works when there are no organizations. Honestly I think GitHub should have handled it this way when it found organizations for the current user.
Activity
salmanulfarzy commentedon Mar 3, 2018
There's already a PR at #1108
cg-cnu commentedon Mar 3, 2018
Thanks @salmanulfarzy for pointing that out. I Should have searched in prs before creating this issue. Closing this one.
fregante commentedon Mar 5, 2018
Still a good idea to keep track of the idea outside the PR.
cg-cnu commentedon Mar 5, 2018
Thanks for reopening the issue @bfred-it , continuing the discussion from the pr #1108
Might be a crazy idea, how about just displaying the text
fork : <user-name>/<repo-name>below every repo (apart from yours) irrespective of you have fork or not.On clicking the link
Where should we fork this repository?modal dialog.@sangeeth96, the best I can think of to get the link working with out making the api calls.
fregante commentedon Mar 5, 2018
Too crazy. Not a fan of displaying links that are too likely to be 404s
Ok, here's what I suggest in detail.
The new link would open the page
/user/repo/fork+ a query string, like:That page is exactly the content of the modal box, but we can load it without going through GitHub's AJAX.
?rgh-fork=truepage load in ourinitfunctionhiddenattribute on<html>and abort the rest of RGHEven if technically two pages are loaded, the user won't see the
/forkpage and it will feel like a simple redirect.However, users without organizations don't have this modal at all, so they should be left untouched.
hkdobrev commentedon Mar 6, 2018
I'd suggest an alternative approach:
A caveat here is that you could have multiple forks you have access to of a single repo (forks in multiple organisations and user), but we can still support that by showing multiple forks in the header to choose from.
I think this is a simpler implementation and would show you the information that you've forked this in a familiar way.
fregante commentedon Mar 6, 2018
The problem with caching forks:
hkdobrev commentedon Mar 6, 2018
I haven't thought of that indeed. Cache invalidation here is hard, but we can invalidate it on 2 events:
hkdobrev commentedon Mar 6, 2018
So the caching implementation is not so easier with the invalidation, but I still think it's a good one as we won't be performing API calls and you have the fork link on the page immediately in a familiar fashion. I don't think detecting the fork dialog or adding a drop down button would be a good experience.
fregante commentedon Mar 6, 2018
We don't detect the dialog but we open an intermediary page invisible to the user.
There's no real dropdown, it's just the button that opens the regular dialog. If you don't like that "arrow down" we can leave it as is and just add an extra "your fork" button that either visits or creates "your fork"
fregante commentedon Mar 6, 2018
Essentially the difference here is that in your case we might:
and in my case:
It's exactly how the Fork button works when there are no organizations. Honestly I think GitHub should have handled it this way when it found organizations for the current user.
16 remaining items
Add link to forked repo below the original. Closes refined-github#1129
Add link to forked repo below the original. Closes refined-github#1129
Merge branch 'master' into refined-github#1129-forked-to
Add link to forked repo below the original. Closes refined-github#1129
Merge branch 'master' into refined-github#1129-forked-2
Merge branch 'master' into refined-github#1129-forked-2
Merge branch 'master' into refined-github#1129-forked-2
Merge branch 'master' into refined-github#1129-forked-2
Merge branch 'master' into refined-github#1129-forked-2
Merge branch 'master' into refined-github#1129-forked-2
issuehunt-oss commentedon Jul 3, 2019
@sindresorhus has rewarded $36.00 to @jerone. See it on IssueHunt