Skip to content

Add link to forked repo below the original  #1129

Closed

Description

@cg-cnu

Issuehunt badges

To resolve this issue, jump to: #1129 (comment)

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 😄


IssueHunt Summary

jerone jerone has been rewarded.

Backers (Total: $40.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

Activity

  1. salmanulfarzy commented on Mar 3, 2018

    @salmanulfarzy
    Contributor

    There's already a PR at #1108

  2. cg-cnu commented on Mar 3, 2018

    @cg-cnu
    Author

    Thanks @salmanulfarzy for pointing that out. I Should have searched in prs before creating this issue. Closing this one.

  3. fregante commented on Mar 5, 2018

    @fregante
    Member

    Still a good idea to keep track of the idea outside the PR.

  4. cg-cnu commented on Mar 5, 2018

    @cg-cnu
    Author

    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.

  5. fregante commented on Mar 5, 2018

    @fregante
    Member

    irrespective of you have fork or not

    Too crazy. Not a fan of displaying links that are too likely to be 404s


    Ok, here's what I suggest in detail.

    instant fork

    • Change current "icon Fork" button to "▼"
    • Add new link on the left with the text "icon Fork"

    The new link would open the page /user/repo/fork + a query string, like:

    https://github.com/sindresorhus/refined-github/fork?rgh-fork=true
    

    That page is exactly the content of the modal box, but we can load it without going through GitHub's AJAX.

    1. Detect the ?rgh-fork=true page load in our init function
    2. Hide the content via hidden attribute on <html> and abort the rest of RGH
    3. When the page is loaded, click our fork (this will either just redirect to the fork or generate the fork)

    Even if technically two pages are loaded, the user won't see the /fork page 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.

  6. hkdobrev commented on Mar 6, 2018

    @hkdobrev
    Contributor

    I'd suggest an alternative approach:

    1. Fork authors would open their fork at some point.
    2. When you visit a fork of your own (have upstream link in the header and settings tab).
    3. We could cache as a map that this upstream repo correspond to your fork.
    4. 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.

  7. fregante commented on Mar 6, 2018

    @fregante
    Member

    The problem with caching forks:

    1. I fork Refined GitHub
    2. I send a PR
    3. I delete the fork and never visit it again
    4. Your link stays there forever?
  8. hkdobrev commented on Mar 6, 2018

    @hkdobrev
    Contributor

    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.
  9. hkdobrev commented on Mar 6, 2018

    @hkdobrev
    Contributor

    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.

  10. fregante commented on Mar 6, 2018

    @fregante
    Member

    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"

  11. fregante commented on Mar 6, 2018

    @fregante
    Member

    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.

  12. 16 remaining items

  13. added a commit that references this issue on May 30, 2019
    9df5008
  14. added 7 commits that reference this issue on Jun 9, 2019
    294d88d
    ddce1a3
    2d79763
    18ef40c
    f3fe624
    e6cea73
    115a8af
  15. issuehunt-oss commented on Jul 3, 2019

    @issuehunt-oss

    @sindresorhus has rewarded $36.00 to @jerone. See it on IssueHunt

    • 💰 Total deposit: $40.00
    • 🎉 Repository reward(0%): $0.00
    • 🔧 Service fee(10%): $4.00
  16. added and removed
    💵 Funded on Issuehunt
    on Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions