@@ -58,7 +58,8 @@ const viewportObserver = new IntersectionObserver(changes => {
5858} ) ;
5959
6060function showAvatarsOn ( commentReactions : Element ) : void {
61- const avatarLimit = arbitraryAvatarLimit - ( commentReactions . children . length * approximateHeaderLength ) ;
61+ const reactionTypes = select . all ( '.social-reaction-summary-item' , commentReactions ) . length ;
62+ const avatarLimit = arbitraryAvatarLimit - ( reactionTypes * approximateHeaderLength ) ;
6263
6364 const participantByReaction = select
6465 . all ( ':scope > button.social-reaction-summary-item' , commentReactions )
@@ -74,35 +75,30 @@ function showAvatarsOn(commentReactions: Element): void {
7475 }
7576}
7677
77- // TODO [2022-12-18]: Drop `.comment-reactions-options` (GHE)
78- const reactionsSelector = '.has-reactions :is(.js-comment-reactions-options, .comment-reactions-options):not(.rgh-reactions)' ;
79-
8078function observeCommentReactions ( commentReactions : Element ) : void {
81- commentReactions . classList . add ( 'rgh-reactions' ) ;
8279 viewportObserver . observe ( commentReactions ) ;
8380}
8481
8582function init ( signal : AbortSignal ) : void {
86- observe ( reactionsSelector , observeCommentReactions , { signal} ) ;
87- onAbort ( signal , viewportObserver ) ;
88- }
89-
90- function discussionInit ( signal : AbortSignal ) : void {
91- observe ( reactionsSelector , observeCommentReactions , { signal} ) ;
83+ observe ( '.has-reactions .js-comment-reactions-options' , observeCommentReactions , { signal} ) ;
9284 onAbort ( signal , viewportObserver ) ;
9385}
9486
9587void features . add ( import . meta. url , {
9688 include : [
9789 pageDetect . hasComments ,
9890 pageDetect . isReleasesOrTags ,
99- ] ,
100- awaitDomReady : false ,
101- init,
102- } , {
103- include : [
10491 pageDetect . isDiscussion ,
10592 ] ,
10693 awaitDomReady : false ,
107- init : discussionInit ,
94+ init,
10895} ) ;
96+
97+ /*
98+ Test URLs
99+
100+ https://github.com/refined-github/refined-github/pull/4119
101+ https://github.com/parcel-bundler/parcel/discussions/6490
102+ https://github.com/orgs/community/discussions/11202
103+
104+ */
0 commit comments