Skip to content

Add link to forked repo below the source - #2153

Merged
sindresorhus merged 12 commits into
refined-github:masterfrom
jerone:#1129-forked-2
Jul 3, 2019
Merged

sindresorhus merged 12 commits into
refined-github:masterfrom
jerone:#1129-forked-2

Conversation

@jerone

@jerone jerone commented Jun 13, 2019 •

Copy link
Copy Markdown
Contributor

Description

Add links to the forked repos below the original repo. For users and organizations.

Closes

Closes #1129
Supersedes attempt 1 #1108
Supersedes attempt 2 #2105
Supersedes attempt 3 #2141

Screenshots

Original repo:
forked-to

User forked repo:
image

Organization forked repo:
image

Test

  1. Open any repo and click on the Fork button.
  2. Fork the repo.
  3. Go back to the original repo.
  4. Below the repo name, a link to your fork will presented.

@jerone

jerone commented Jun 13, 2019

Copy link
Copy Markdown
Contributor Author

@bfred-it Clean up even more; hope it satisfies. Feel free to edit at your will.

Comment thread source/libs/page-detect.ts Resolved
Comment thread source/features/forked-to.tsx Resolved
@fregante

Copy link
Copy Markdown
Member

Not a good idea to include the full issue number in the branch name, this happens: 😅

Screenshot 2019-06-23 at 15 41 55

@jerone

jerone commented Jun 23, 2019

Copy link
Copy Markdown
Contributor Author

Will try to remember

@sindresorhus

Copy link
Copy Markdown
Member

The implementation looks good to me. Can you mention the feature in the readme with a link to a screenshot?

Comment thread source/features/forked-to.tsx Resolved
@jerone

jerone commented Jul 1, 2019

Copy link
Copy Markdown
Contributor Author

@sindresorhus commented on Jul 1, 2019, 8:46 AM GMT+2:

The implementation looks good to me. Can you mention the feature in the readme with a link to a screenshot?

Done.

Comment thread readme.md Resolved
@sindresorhus
sindresorhus merged commit e90503f into refined-github:master Jul 3, 2019
@sindresorhus

Copy link
Copy Markdown
Member

Thanks for contributing this feature 🙌

sindresorhus pushed a commit that referenced this pull request Jul 3, 2019
@fregante

fregante commented Jul 3, 2019

Copy link
Copy Markdown
Member

<3

@jerone
jerone deleted the #1129-forked-2 branch July 3, 2019 19:25
@eine

eine commented Jul 8, 2019 •

Copy link
Copy Markdown

@jerone, first off, thanks for contributing this feature! ❤️

I'm using Firefox Multi-Account Containers, to handle two different GitHub accounts. However, this new feature ignores 'container isolation'. I.e., if the same repo is cloned in both accounts, I see both of them listed when I visit the original repo. I would expect a single fork to be shown instead, the one that corresponds to the account that is logged in. More precisely:

  • No container: logged in with user_a, which does NOT belong to org.
  • Container Personal: logged in with user_b, which does belong to org.

When visiting orig/repo, I see:

  • forked to user_a/repo
  • forked to org/repo

Instead, I would expect to see forked to user_a/repo only, when browsing in 'No container', and forked to org/repo only when browsing in 'Personal'. This is because following the link to the fork does not change the container. The user needs to explicitly right-click to open it in the corresponding container.

Is this expected by design? Or is it worth a separate issue?

@jerone

jerone commented Jul 8, 2019 •

Copy link
Copy Markdown
Contributor Author

@1138-4eb Interesting issue. You are encountering this issue, because all forks are saved in a cache storage. Cache is used on more features, but those are not account depended, like this feature. The solution would be to use a cache key which also contains the logged-in username.

@bfred-it @sindresorhus Is multiple accounts something we want to support?

@fregante

fregante commented Jul 8, 2019

Copy link
Copy Markdown
Member

@jerone this can probably be solved by including the current username in the cache key itself, e.g. forked-to:<currentuser>:<user>/<repo>

@jerone

jerone commented Jul 8, 2019

Copy link
Copy Markdown
Contributor Author

@bfred-it Yes, exactly like I said 😄

The solution would be to use a cache key which also contains the logged-in username.

@eine

eine commented Jul 8, 2019

Copy link
Copy Markdown

@jerone

jerone commented Jul 8, 2019

Copy link
Copy Markdown
Contributor Author

@1138-4eb Yeah. I'm testing right now. Will send PR soon.

@jerone

jerone commented Jul 8, 2019

Copy link
Copy Markdown
Contributor Author

PR here: #2215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Add link to forked repo below the original

4 participants