Skip to content

default-branch-button: Button has pink corruption on GHES #7857

Closed

Description

@JakeMerdichAMD

Description

On Github Enterprise Server, the default-branch-button feature causes the branch button to appear with pink corruption.

image

How to replicate the issue + URL

  1. Have access to a GHES server (3.12.7)
  2. Ensure a PAT for the server is added to the extension
  3. Navigate to the equivalent of https://github.com/refined-github/refined-github/tree/sandbox/keep-branch
  4. Observe ugly pink corruption.

Extension version

24.10.1

Browser(s) used

Firefox (130.0 Win64)

Token ⚠️

  • I set a token in the options page. I understand that some features require a token to work.

Activity

  1. added
    enterprise
    on Oct 4, 2024
  2. fregante commented on Oct 4, 2024

    @fregante
    Member

    This is likely due to the lack of new variable names. Presumably this specific commit should be reverted: 11f51bc (#7804)

    @JakeMerdichAMD Can you try those variable names?

    cc @kovsu fuchsia is doing its job 😁

  3. JakeMerdichAMD commented on Oct 4, 2024

    @JakeMerdichAMD
    ContributorAuthor

    With that reverted (ie. using --color-accent-subtle/--color-accent-fg), it looks like this:

    image

  4. fregante commented on Oct 4, 2024

    @fregante
    Member

    It should look like this in the end. Finding the right names for the variables is the challenge.

    image image image image
  5. JakeMerdichAMD commented on Oct 4, 2024

    @JakeMerdichAMD
    ContributorAuthor

    The following works for me. The layout here is very different between GHES and normal github, so I had to do some tweaks to target the dropdown in both without also picking up the expanded menu.

    image

    button.rgh-highlight-non-default-branch, details.rgh-highlight-non-default-branch>summary  {
    	background-color: var(--bgColor-accent-muted, var(--color-accent-subtle, fuchsia)) !important ;
    	color: var(--fgColor-accent, var(--color-accent-fg, fuchsia)) !important;
    	border-color: var(--fgColor-accent, var(--color-accent-fg, fuchsia)) !important;
    }
    
    button.rgh-highlight-non-default-branch svg, details.rgh-highlight-non-default-branch>summary svg {
    	color: var(--fgColor-accent, var(--color-accent-fg, fuchsia)) !important;
    }
  6. fregante commented on Oct 4, 2024

    @fregante
    Member

    Great! How does that exact CSS look on the light theme?

  7. JakeMerdichAMD commented on Oct 4, 2024

    @JakeMerdichAMD
    ContributorAuthor

    Just like your image, as far as I can tell.

    GHES:
    image
    image

    Cloud:
    image
    image

    Also see menu does not get incorrect colors on GHES, which I only noticed while testing the CSS:
    image
    Before:
    image

  8. fregante commented on Oct 4, 2024

    @fregante
    Member

    Just like your image, as far as I can tell.

    Thank you! If you have time, I'd accept a PR. Or I'll fix it at some point.

    I'll probably hotfix it too in https://github.com/refined-github/yolo

    Also see menu does not get incorrect colors on GHES, which I only noticed while testing the CSS:

    That's just because of your selector, it just needs to be .rgh-highlight-non-default-branch and .rgh-highlight-non-default-branch svg respectively

  9. JakeMerdichAMD commented on Oct 4, 2024

    @JakeMerdichAMD
    ContributorAuthor

    That's just because of your selector, it just needs to be .rgh-highlight-non-default-branch and .rgh-highlight-non-default-branch svg respectively

    Unfortunately, that does not work-- it's what I showed in the plain revert (though also the menu turns blue instead of pink).

    The specifiers are different because in GHES but not cloud:

    • The full menu is a child of the button, so random parts of it inherit the highlighted color. In cloud, it's not a child.
    • There's a summary.btn child that re-applies the normal background and border color instead of inheriting the highlight from the parent (details.rgh-highlight-non-default-branch). In cloud, they don't use details/summary so the color is not overridden.

    I'm not sure if it makes more sense to modify the javascript parts to tweak where the class is applied instead?

  10. fregante commented on Oct 4, 2024

    @fregante
    Member

    I think we can just publish some CSS to hide the pink areas and leave the rest as "progressive enhancement". You'll start seeing the correct colors once your GHE version is updated

    However I don't know how to do that while also preserving the fuchsia for the future.

    The second best bet would be to use your suggested code, but with more specific selectors so that they don't leak into the dropdown. No JS changes needed/desired.

  11. added a commit that references this issue on Oct 4, 2024
    674d79f
  12. JakeMerdichAMD commented on Oct 4, 2024

    @JakeMerdichAMD
    ContributorAuthor

    I think we can just publish some CSS to hide the pink areas and leave the rest as "progressive enhancement".

    I'm not sure what you mean by this-- I'll just put up the PR as-is for now.

  13. busches commented on Oct 4, 2024

    @busches
    Member

    Not sure what version of GHE OP is using, but I can confirm it's happening on 3.13, which is one minor version behind the latest.

  14. JakeMerdichAMD commented on Oct 4, 2024

    @JakeMerdichAMD
    ContributorAuthor

    3.12.7 here.

  15. added a commit that references this issue on Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedbugenterprise

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions