Repository navigation
Draw one comment shield when another extension inserts beside the name - #161
Merged
Merged
Conversation
Refined GitHub's show-names span lands between the author's name and gh-prism's shield, so the next-sibling guard missed the shield and drew a second one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Kind: bug fix
What changed
With Refined GitHub installed, every shielded comment author showed two code-owner shields. One sat after the login, and a second after the
(Full Name)that Refined GitHub's show-names feature adds. Code owners and team membership had nothing to do with it.gh-prism draws its shield right after the author's name. Show-names then inserts its
(Full Name)span right after the same name, which pushes the shield one place along. When the page changed next, gh-prism's dedupe check only looked at the name's next sibling. It found the span instead of the shield, so it drew a second shield.addAuthorShieldsnow skips a name whose header already holds gh-prism's shield anywhere among the name's siblings. Each layout's name parent (the classic<strong>'s parent, the Overview and new Files changedTitleContainer) holds a single comment author. A new test in the comment-authordescribe.eachputs a span after each name once the shields settle. It failed in all four layouts before the fix, with two shields per header, and passes now.Screenshots
Taken on excessive-dev/gh-prism-codeowners-sandbox#1, which now has example comments by a code owner:
docs/andapi/;docs/thread;web/.Refined GitHub's show-names skips the signed-in viewer's own comments, and every sandbox comment is mine. So the capture script replays its insertion instead: the same
(Full Name)span, added after the author link (or after its<strong>in the classic layout) once gh-prism's shield is in the header. That is the order the bug needs. Shields per header, before → after:Overview: 2 → 1 on all 6 headers.
Classic Conversation: 2 → 1 on all 7 headers.
Files changed, comments panel: 2 → 1 on all 4 headers.
What to test
(Full Name). Check:mise run test reviewer-filespasses, including "keeps one shield when another extension inserts beside the name".