Skip to content

Add link to default branch - #1115

Merged
fregante merged 6 commits into
masterfrom
link-to-default-branch
Mar 5, 2018
Merged

fregante merged 6 commits into
masterfrom
link-to-default-branch

Conversation

@fregante

@fregante fregante commented Feb 23, 2018 •

Copy link
Copy Markdown
Member

@hkdobrev

Copy link
Copy Markdown
Contributor

Probably the house icon as in go back to home, the default view.

@fregante

Copy link
Copy Markdown
Member Author

I thought about that but “home” feels like the root, but it could just be a sub folder of a different branch, still not “home”

@hkdobrev

Copy link
Copy Markdown
Contributor

Well, yeah, but at the same, there are two big problems with the current icon:

It does not represent upstream. This is the icon for merging from the GitHub Flow (it's on my T-shirt 😂).
Even if there was an icon for upstream, it doesn't relate to changing the branch.

An alternative icon would be the commit icon as it's closest to "branch".

I would actually suggest just putting HEAD there instead of an icon.

@fregante

fregante commented Feb 24, 2018 •

Copy link
Copy Markdown
Member Author

I would actually suggest just putting HEAD there instead of an icon.

I think HEAD is actually just whatever you're looking at now, you're always on HEAD

An alternative icon would be the commit icon as it's closest to "branch".

Yeah that wouldn't be bad. An alternative perhaps would be a left or up arrow, kinda like "go back to main".

@fregante

fregante commented Feb 25, 2018 •

Copy link
Copy Markdown
Member Author

back

How about a simple back chevron?

@hkdobrev

Copy link
Copy Markdown
Contributor

When looking at the upstream repository refs/remotes/origin/HEAD would be the main branch, not the upstream branch of your currently checked out branch locally.


👍 for the chevron as well. However, it would move the branch selector from its default position when present if it's on the left side.

@fregante

Copy link
Copy Markdown
Member Author

it would move the branch selector from its default position when present if it's on the left side.

True, but I think it's not a big deal since the branch selector is very wide and the movement is of about 30px. What do you say? I think it's less nice on the right side pointing back to the current branch.

I'll guess that we will always have the link to the default branch in the selector.
@fregante
fregante force-pushed the link-to-default-branch branch from 226dfbd to d6e971c Compare February 25, 2018 18:17
@fregante
fregante force-pushed the link-to-default-branch branch from b2e8b91 to 4bc8bdb Compare February 26, 2018 20:38
@fregante

Copy link
Copy Markdown
Member Author

Temporary caching in 4bc8bdb enables it on files as well :)

files

@sindresorhus sindresorhus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is really useful and seems to work perfectly. 🎉

Needs to be added to the readme.

@fregante

fregante commented Mar 5, 2018

Copy link
Copy Markdown
Member Author

screen shot for readme

@fregante
fregante merged commit 2126a2b into master Mar 5, 2018
@fregante
fregante deleted the link-to-default-branch branch March 5, 2018 07:24
@niklashigi

niklashigi commented Mar 9, 2018 •

Copy link
Copy Markdown
Contributor

When I'm on a forked repository and hover over the button a tooltip suggesting that it would link to the origin's respective branch appears. However, the link doesn't lead there. It leads to the branch on the current repository (often the same page).

Example from my refined-github fork, I expect the button to link to /sindresorhus/refined-github:

<a
  class="btn btn-sm tooltipped tooltipped-ne BtnGroup-item"
  href="/shroudedcode/refined-github"
  aria-label="Visit the default branch (sindresorhus:master)"
> ... </a>

That's confusing and not what's supposed to happen, right?

@fregante

fregante commented Mar 9, 2018

Copy link
Copy Markdown
Member Author

It’s-a-bug and I got you pal #1132

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.

4 participants