Repository navigation
Add link to default branch - #1115
Conversation
|
Probably the house icon as in go back to home, the default view. |
|
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” |
|
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 😂). An alternative icon would be the commit icon as it's closest to "branch". I would actually suggest just putting |
I think
Yeah that wouldn't be bad. An alternative perhaps would be a |
|
When looking at the upstream repository 👍 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. |
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.
226dfbd to
d6e971c
Compare
b2e8b91 to
4bc8bdb
Compare
|
Temporary caching in 4bc8bdb enables it on files as well :) |
sindresorhus
left a comment
There was a problem hiding this comment.
This is really useful and seems to work perfectly. 🎉
Needs to be added to the readme.
|
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 <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? |
|
It’s-a-bug and I got you pal #1132 |



Closes #1029
Icon
Edit: check out the comment below #1115 (comment)
I couldn't find a relevant icon for
defaultorHEAD, so I'm using the merge icon asupstream. Can you suggest a better one from here? https://octicons.github.com/Test
The default branch is detected thanks to this information that only appears in folder views on branches.
No icon
https://github.com/sindresorhus/refined-github (already default branch)
https://github.com/sindresorhus/refined-github/tree/master (already default branch)
https://github.com/sindresorhus/refined-github/blob/webpack-4/license (files aren't supported)
https://github.com/sindresorhus/refined-github/tree/1.20.1 (tags aren't supported)
With icon
https://github.com/sindresorhus/refined-github/tree/webpack-4 (branch root)
https://github.com/sindresorhus/refined-github/tree/webpack-4/media (branch folder)