MCPcopy Index your code
hub / github.com/refined-github/refined-github / showAvatarsOn

Function showAvatarsOn

source/features/reactions-avatars.tsx:65–92  ·  view source on GitHub ↗
(reactionsContainer: Element)

Source from the content-addressed store, hash-verified

63}
64
65function showAvatarsOn(reactionsContainer: Element): void {
66 const reactions = $$optional([
67 'button[aria-pressed]', // Discussions, releases, PRs, old issues
68 'button[aria-checked]', // React issues
69 ], reactionsContainer)
70 .map(button => getParticipants(button)); // Get all participants for each reaction
71 if (reactions.length === 0) {
72 return;
73 }
74
75 const avatarLimit = arbitraryAvatarLimit - (reactions.length * approximateHeaderLength);
76 const flatParticipants = flatZip(reactions, avatarLimit);
77
78 for (const {button, username, imageUrl} of flatParticipants) {
79 button.append(
80 <span className="avatar-user avatar rgh-reactions-avatar p-0 tmp-p-0 flex-self-center">
81 <img
82 src={imageUrl}
83 className="d-block"
84 width={avatarSize}
85 height={avatarSize}
86 alt={`@${username}`}
87 loading="lazy"
88 />
89 </span>,
90 );
91 }
92}
93
94const viewportObserver = new IntersectionObserver(changes => {
95 for (const change of changes) {

Callers 1

Calls 2

getParticipantsFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected