Kir-Antipov / GitHub-Defreshed

:octocat: Classical GitHub at its finest
MIT License
83 stars 3 forks source link

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

Closed MrNaif2018 closed 4 years ago

MrNaif2018 commented 4 years ago

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 commented 4 years ago

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 :)

MrNaif2018 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

fix