Repository navigation
Add show-open-prs-of-forks feature - #2880
Conversation
|
I think I've addressed all points from the previous review, except one thing: I could not move the Also, besides the suggested simplification of the Also, my question about GHE still needs to be sorted out. |
The reason is that you're using Since |
Co-Authored-By: Federico Brigante <[email protected]>
|
Sorry, I'm a little bit stumped on your last example. To do that ouside the function, we'd need top-level await (which we don't have, do we?) Or are you suggesting to put it into a Promise? const hasSettings = elementReady('settings tab selector'); |
|
It should go inside the |
|
Okay, so that's basically how I had it in the first place. I ultimately outsourced all those checks into the Going to continue working on this tomorrow, it's getting late here and my coding as well as my writing is getting noticeably worse. 😁 |
|
Okay, I've renamed |
- Adds proper support for `nowAndOnAjaxedPages` - Reduces duplication
Good idea! I reorganized the code so "getOpenPullRequestsData" returns the full required data, which is I'm resolving the conflicts |
| return {ownerName, repoName}; | ||
| }; | ||
|
|
||
| export function getForkedRepo(): string | undefined { |
There was a problem hiding this comment.
This is ambiguous. Is it the repo that was forked or the fork itself?
The correct term would be "source repo". Perhaps getForkSourceRepo would be the correct term.
Can you change this name everywhere? Including const forkedRepo = ... (but not isForkedRepo, that's more clear, I think)
There was a problem hiding this comment.
I thought so as well, but I trusted the existing naming (the function existed before, I just moved it to utils).
Yes, I'll take care of it when I'm going to handle #2934.
There was a problem hiding this comment.
Hm, there's already a function with that name in the forked-to feature.
const getForkSourceRepo = (): string => getForkedRepo() ?? getRepoURL();There was a problem hiding this comment.
How about
getParentRepo: only works if there’s a parent)getSourceRepo: always gets the source repo, whether it’s the parent or the current
There was a problem hiding this comment.
Sound's good to me. I'll do some refactoring of these, but I think I'll open a separate PR for that.
| }; | ||
|
|
||
| export function getForkedRepo(): string | undefined { | ||
| return select<HTMLAnchorElement>('.fork-flag a')?.pathname.slice(1); |
There was a problem hiding this comment.
Also you could use the same meta tags I used in the isForkedRepo since they're available earlier on the page:
<meta name="octolytics-dimension-repository_parent_nwo" content="sindresorhus/refined-github" />
| return select<HTMLAnchorElement>('.fork-flag a')?.pathname.slice(1); | |
| return select<HTMLMetaElement>('[name="octolytics-dimension-repository_parent_nwo"]')?.content; |
This PR adds the new
show-open-prs-of-forksfeature. It triggers in all your repositories which are forks. Because of the user-centric nature of this feature, I unfortunately can not provide test links.Repo Headline Hints
This feature adds a hint in the secondary repo headline, linking to your open PRs in the original repo:
Single Pull Request
Multiple Pull Requests
Repo Deletion Warnings
The feature also adds a paragraph to the repo deletion dialog, raising your awareness that there are unmerged outgoing PRs from this repo which you will abandon. (I ran a quick test for this — PRs are not actually deleted when the fork is gone, they're just attributed to an "unknown repo", so the warning will be about the loss of write access to the PR.)
Rules for link targets are the same as in the headline hints layed out above.
Closes #2268
IssueHunt Summary
Referenced issues
This pull request has been submitted to:
IssueHunt has been backed by the following sponsors. Become a sponsor