`default-branch-button` does not work with long branch names that are truncated in the UI
See original GitHub issuePlease ensure:
- The bug is caused by Refined GitHub. It doesn’t happen if I disable the extension.
Include in this issue:
- Screenshots/video/gif demonstrating the bug, if it’s visual
- Console errors, if any
Description
The Problem
Press the default-branch-button
in the example url, and it will redirect you to https://github.com/gamemaker1/express-rate-limit/commits/opiniated-impr...
. This is because the branch name is truncated in the #branch-select-menu
div.
Possible Fix
Change the selector in the getDefaultBranch
helper function that retrieves the branch name from the UI:
From:
select('#branch-select-menu [data-menu-button]');
To:
select('#branch-select-menu [data-menu-button]:not(.css-truncate-target)');
So that it makes an API call and gets the default branch instead of using the truncated name from the UI (an alternative would be getting the branch from somewhere else in the DOM).
Not tested, but I think this should work.
Example URL
https://github.com/gamemaker1/test/tree/very-very-long-long-long-long-branch-name
Browser(s) used
Firefox
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Regression in 8.7 with merge request UI - long branch names are ...
With the upgrade to 8.7, the UI is no longer usable in this case since the branch names get truncated. With 8.6 they...
Read more >sluggify and/or truncate branch names to reduce branchName ...
I've transferred this issue into the main Renovate repo and labeled it as a feature request. As you've kind of identified, using more...
Read more >Keep Git Branch Name Untruncated in Shell using p10k (Oh ...
p10k.zs file to turn off git branch name truncating. I've already tried many combinations, including Google searches, and nothing worked.
Read more >How can we increase the branch-name maxlength parameter?
When I create a branch from a Jira issue, there is a 50 characters limitation on branch-name field. Our issues summary fields are...
Read more >Let the branch name do all the talking in git - codeburst
I like and use BEM for CSS, it clearly says all about the code and saves time for developers. And I badly wanted...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this is already fixed in the associated PR.
That’s why it happened. We have a few ways to figure out the default branch and one of them might be reading the truncated value somewhere.
To fix this, we just need to verify all of these ways