Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different UI when opening master branch and a different branch (with branch diff message) #15

Closed
MrNaif2018 opened this issue Jul 28, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@MrNaif2018
Copy link

Hello! Thank you for quick version 2, and that's me once again telling about bugs (:
This bug appears when opening a branch different from master, the layout changes to something mixed between old and new style (actually it looks not bad :D, but commits link and some other stuff is hidden).
I can't seem to reproduce this on third-party repos, I can only reproduce it only on my repos, so looks like it is caused by "Recent pushes on some branch" message though I don't see it.
Link to the branch if it shows for you too
Version 2.0
Screenshots:
Default branch:
изображение
PR branch:
изображение

@Kir-Antipov
Copy link
Owner

Uh oh
Problem's caused by your branch name, not by "Recent pushes on some branch"

https://github.com/MrNaif2018/bitcart/tree/feature/tor

It's impossible to say where am I by just looking at this link: it can be "tor" folder of "feature"-branch (the most common case) or it can be the root of the "feature/tor"-branch (your case).

At the moment, the script is configured for the most common case, so that no fixes for the repository root are applied to this page.

But don't worry, as always I have an idea how to fix it by few more heuristics :)

@Kir-Antipov Kir-Antipov self-assigned this Jul 28, 2020
@Kir-Antipov Kir-Antipov added the bug Something isn't working label Jul 28, 2020
@MrNaif2018
Copy link
Author

MrNaif2018 commented Jul 28, 2020

Oh, I thought that this branch name might cause problems! But catching rare cases is good too (:
Thank you!
Edit: Actually I found out when this branch name is used, in any project using dependabot, it creates such branch names too
E.g. dependabot/pip/something or dependabot/npm_and_yarn/something

@Kir-Antipov
Copy link
Owner

Kir-Antipov commented Jul 28, 2020

But catching rare cases is good too (:

Jokes on you, of course it is!)
I faced this bug a long time ago, but that time edge-case handling wasn't part of the plans yet, as the script was in its early stage of development. And now when I'm pretty happy with the results, the time has come :)

Well, I can get branches from the branch-button content:

let branches = [...document.querySelectorAll("#ref-list-branches > .SelectMenu-list > a > span:not(.Label)")].map(x => x.innerText.trim());

I hope that at least no one uses the "/" character for tag names xD

@Kir-Antipov
Copy link
Owner

Voila!
Even dependabot/pip/bitcart-async-0.9.0 works fine now :)

fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants