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

small-user-avatars showing wrong avatars on commit history/details #7137

Closed
dgw opened this issue Dec 4, 2023 · 6 comments · Fixed by #7139
Closed

small-user-avatars showing wrong avatars on commit history/details #7137

dgw opened this issue Dec 4, 2023 · 6 comments · Fixed by #7139
Labels
bug disabled via hotfix A label to remind us to remove the feature from yolo help wanted

Comments

@dgw
Copy link
Contributor

dgw commented Dec 4, 2023

Description

GitHub appears to have added the user-mention class to commit-author links in places like the commit detail page and commit list. Refined GitHub now adds an incorrect, redundant small avatar if that feature is turned on:

image

In the above example, the avatar for "gw" is shown instead of "dgw". RGH expects a user-mention to start with @ and trims the first character, but the commit-author link type does not include @.

const username = link.textContent.slice(1);

<a class="commit-author user-mention" title="View all commits by dgw" data-hovercard-type="user"
  data-hovercard-url="/users/dgw/hovercard" data-octo-click="hovercard-link-click"
  data-octo-dimensions="link_type:self" href="/sopel-irc/sopel/commits?author=dgw">dgw</a>

How to replicate the issue + URL

I noticed it at sopel-irc/sopel@120477f but this happens anywhere a commit is shown (including /:user/:repo/commits/:refname and at the top of /:user/:repo)

Extension version

23.12.1

Browser(s) used

Chrome 119

@dgw dgw added the bug label Dec 4, 2023
@XDelta
Copy link

XDelta commented Dec 4, 2023

Can confirm I am seeing this as well.
XDelta is being adjusted to Delta and showing an additonal and incorrect user icon
image

@fregante
Copy link
Member

fregante commented Dec 4, 2023

It looks like the added the user-mention class to an element that isn't a mention 😩

I'll hot fix the feature to disable it.

fregante added a commit to refined-github/yolo that referenced this issue Dec 4, 2023
@fregante fregante added help wanted disabled via hotfix A label to remind us to remove the feature from yolo labels Dec 4, 2023
@dgw
Copy link
Contributor Author

dgw commented Dec 4, 2023

It looks like the added the user-mention class to an element that isn't a mention 😩

Yeah, this change to GH's markup makes no sense to me. If RGH has the ability to treat .user-mention and .user-mention.commit-author differently, that could be a way around this. (Does something like .user-mention:not(.commit-author) work with the selector-observer helper?)

@fregante
Copy link
Member

fregante commented Dec 4, 2023

Yes I think that would cover it.

@dgw
Copy link
Contributor Author

dgw commented Dec 4, 2023

Bootstrapped Node locally so I could test the change locally, and opened #7139 with the results. Hope it's helpful! (I just have to figure out linting + fix the code style.)

@dgw dgw changed the title small-user-avatars showing wrong avatars on commit history/details small-user-avatars showing wrong avatars on commit history/details Dec 5, 2023
Copy link

github-actions bot commented Dec 6, 2023

To maintainers: Disable the hotfix by adding 23.12.6 to https://github.com/refined-github/yolo/edit/main/broken-features.csv

fregante added a commit to refined-github/yolo that referenced this issue Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug disabled via hotfix A label to remind us to remove the feature from yolo help wanted
Development

Successfully merging a pull request may close this issue.

3 participants