Skip to content

reactions-avatars - Support new issue view - #7930

Merged
fregante merged 23 commits into
refined-github:mainfrom
kovsu:beta-reactions-avatars
Oct 24, 2024
Merged

fregante merged 23 commits into
refined-github:mainfrom
kovsu:beta-reactions-avatars

Conversation

@kovsu

@kovsu kovsu commented Oct 21, 2024 •

Copy link
Copy Markdown
Member

@fregante

Copy link
Copy Markdown
Member

Don't forget to link the original issue, like:

- part of #7856 

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good other than this

Comment thread source/features/reactions-avatars.tsx Resolved
Comment thread source/features/reactions-avatars.tsx Resolved
@fregante fregante changed the title reactions-avatars - Support new view reactions-avatars - Support new issue view Oct 21, 2024
@fregante fregante added the bug label Oct 21, 2024
@fregante

Copy link
Copy Markdown
Member

This selector needs to be adjusted:

:root .rgh-reactions-avatar:last-of-type {
margin-right: -0.15em !important;

Screenshot 7

@fregante

Copy link
Copy Markdown
Member

Also I'm seeing an error on discussions: https://github.com/orgs/community/discussions/5841

❌ Refined GitHub: reactions-avatars
errors.js:77 📕 0.0.0 → SyntaxError: Failed to execute 'querySelector' on 'Document': '[href="https://github.com/    🚀
            3
" i] img' is not a valid selector.
    at $ (select-dom.js:8:38)
    at getUserAvatar (get-user-avatar.js:8:25)
    at getParticipants (reactions-avatars.js:53:20)
    at reactions-avatars.js:86:19
    at Array.map (<anonymous>)
    at showAvatarsOn (reactions-avatars.js:86:5)
    at IntersectionObserver.rootMargin (reactions-avatars.js:65:4)

Before this PR, the error was there, but different:

❌ Refined GitHub: reactions-avatars
errors.js:77 📕 0.0.0 → TypeError: Cannot read properties of null (reading 'textContent')
    at getParticipants (reactions-avatars.js:24:4)
    at reactions-avatars.js:64:19
    at Array.map (<anonymous>)
    at showAvatarsOn (reactions-avatars.js:64:5)
    at IntersectionObserver.rootMargin (reactions-avatars.js:49:4)

@fregante

Copy link
Copy Markdown
Member

Just to be clear, the new error is specifically because getParticipants is returning bad data, so it ends up in the selector

@kovsu

kovsu commented Oct 23, 2024 •

Copy link
Copy Markdown
Member Author
image image

@fregante

Copy link
Copy Markdown
Member

Sorry I had pointed you in the wrong direction, it was not :last-of-type but the regular margin-right that needed to be increased.

Screenshot 19

Comment thread source/features/reactions-avatars.tsx Resolved
kovsu and others added 2 commits October 23, 2024 21:20
Co-authored-by: fregante <me@fregante.com>
@fregante

Copy link
Copy Markdown
Member

Adjusted, restested, merging…

@fregante
fregante enabled auto-merge (squash) October 24, 2024 06:57
@fregante
fregante merged commit baef3cb into refined-github:main Oct 24, 2024
@kovsu
kovsu deleted the beta-reactions-avatars branch October 24, 2024 09:37
@fregante

fregante commented Oct 26, 2024 •

Copy link
Copy Markdown
Member

This would also be good to address, it's not in the original list of broken features: https://github.com/refined-github/refined-github/blob/db5e00462bdbe398512f223cabb41961e81fc559/source/features/center-reactions-popup.css#

const participantByReaction
= $$(':scope > button.social-reaction-summary-item', commentReactions)
= $$([
':scope > button.social-reaction-summary-item:enabled',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:enabled broke it on locked issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants