Skip to content

Highlight the non-default branch in files/folder views #7679

Closed

Description

@fregante

Description

If you visit this page it's not immediately clear that it's not the default branch. You might wander a bit until you realize you're looking at an old commit.

Screenshot 4

I think we should alter default-branch-button or add a new feature like highlight-non-default-base-branch.

Note that we already do this in clean-conversation-headers in PRs

Screenshot

const isDefaultBranch = baseBranch === await getDefaultBranch();
if (!isDefaultBranch && !wasDefaultBranch) {
base.classList.add('rgh-clean-conversation-headers-non-default-branch');
}

Maybe something like this?

Screenshot 7

or something more explicit

Screenshot 8

Example URLs

https://github.com/refined-github/refined-github/tree/lint
https://github.com/refined-github/refined-github/commits/test/bun

Activity

  1. Andrew6rant commented on Aug 18, 2024

    @Andrew6rant
    Contributor

    Maybe add the name of the default branch to the default-branch-button and highlight the current branch?

    Here's how it'll look using the colors of the right sidebar's topics bubbles:

    background: var(--bgColor-accent-muted, var(--color-accent-subtle));
    color: var(--fgColor-accent, var(--color-accent-fg));

    refined-github-fork-highlight

  2. fregante commented on Aug 18, 2024

    @fregante
    MemberAuthor

    I like that color! But we can’t add the branch name because space is always limited there, unless we limit it to:

    • large displays
    • only some pages (this button also appears in the sidebar and in the sticky header on files like this)
  3. Andrew6rant commented on Aug 19, 2024

    @Andrew6rant
    Contributor

    Thanks! But I'm not quite sure what you mean with the crossed-out text, the default branch name (or a truncated default branch name) should be able to fit on any screen size.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions