Skip to content

repo-header-info - Add link to source of fork - #9678

Merged
fregante merged 5 commits into
mainfrom
link-fork
Jun 7, 2026
Merged

fregante merged 5 commits into
mainfrom
link-fork

Conversation

@fregante fregante changed the title Linkify fork repo-header-info - Add link to source of fork Jun 2, 2026
@fregante

fregante commented Jun 2, 2026

Copy link
Copy Markdown
Member Author

cc @mbtools

I'm not totally convinced that this link is worth the extra ~10px of width of the header, I'll keep an eye out on #9433 this week and will revert this PR if I see additional issues.

As for the "link to own fork", I guess that's not happening as it would be ~45px extra pixels in your mockup.

@mbtools

mbtools commented Jun 2, 2026

Copy link
Copy Markdown

Guess I'm lucky to have a wide screen but I can see how space becomes an issue. Lgtm 🙏

@fregante

fregante commented Jun 2, 2026

Copy link
Copy Markdown
Member Author

Until we had that issue, we had no problem adding and removing items from the screen, even if they were to be hidden on small screens. The problem is mostly due to GitHub's code being self-contained and unaware of our elements, so any addition inevitably causes issues and this depends on the user/repo length as well.

}

// GitHub may already show this icon natively, so we match its position
if (forked) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Moved because we have two link.after() calls; order matters

repoLink.append(
appendBefore(
repoLink,
'.octicon-repo-forked',

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Shuffle them to keep the fork on the right side

Comment on lines -49 to -50
// GitHub may already show this icon natively, so we match its position
if (isFork && !elementExists('.octicon-repo-forked', repoLink)) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We added this code two years ago, I can't find a repo without a fork icon. The private icon on the other hand is missing from "private forks", most likely because in their opinion it should show "max 1 icon"

@fregante
fregante requested review from kidonng and yakov116 June 3, 2026 20:05
@fregante
fregante merged commit 2543686 into main Jun 7, 2026
13 checks passed
@fregante
fregante deleted the link-fork branch June 7, 2026 07:34
@fregante fregante mentioned this pull request Jun 12, 2026
1 task done
@fregante

Copy link
Copy Markdown
Member Author

any addition inevitably causes issues

🥲

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.

Easily switch between fork and upstream

2 participants