Show all users in a PM

AI-generated summary

The discussion revolves around increasing the number of users’ avatars shown in a private message (PM) on a Discourse forum, which currently defaults to 10 users, with additional users represented as “+1”, “+2”, etc. JimPas inquired if this number could be increased using CSS or another method. cocococosti asked for clarification and shared screenshots of their PM, suggesting the number of avatars shown may depend on username length. JimPas provided further clarification and screenshots, explaining that the issue lies with the stationary user list at the upper left corner of the PM.

After investigating the Discourse code, cocococosti found that the maximum number of users shown is hardcoded to 10 and would require complex JavaScript or a custom plugin to change. JimPas accepted this answer, concluding that increasing the number of avatars shown is not feasible.

On another forum (Discourse of course) a question came up as to whether the number of users’ avatars shown in the PM can be increased from the default of 10 users. As it is now, it shows the avatars of the first 10 and then +1. Can this number be increased using css or another method?

I don’t get what you mean, could you share a screenshot please?

This is how it looks on my forum (PM with 11 users):

I’m thinking the number of avatars shown may depend on how long the username is…

I’m talking about at the upper left corner of the PM which continues to show even as one scrolls down though the posts.

image

One user inadvertently invoked Discobot whose avatar was placed first (at the far left) and the 10th user’s avatar was replaced with a “+1”. Next month we expect to have one more user invited to this PM, so we were wondering if there was a way to increase the number of avatars shown at the top left.

I’m not talking about the post that appears at the top of the discussion that shows all the users’ avatars, but what appears at the upper left that is stationary as one scrolls down through the messages. That’s where additional avatars disappear and are replaced with +1, +2, etcetera.

Oh, we did remove Discobot from the list and the 10th user’s avatar now appears again. My guess is that this list is limited to the first 10 users and additional users are included as a “+n” at the end.

I don’t think this can be changed easily with CSS, as you can see here https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/widgets/header-topic-info.js#L156 the maximum number of users shown (when there are no tags in the PM header) is 10, as you guessed.

The avatars to show are set based on this logic https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/widgets/header-topic-info.js#L169

Maybe there is something you could do, but it would require complex Javascript, or a custom plugin.

Okay, thank you. I’ll advise the others it’s a no go. :smiley: