Add description to group cards

Continuing the discussion from Usercard for groups:

In our case, it’d be very helpful to have the description on the user card. I think it’d be fine to cut it off with an ellipsis after some number of characters. Showing a partial description would offer greater affordance to seek out the full description.

And I think folks would learn quickly and/or could be nudged to put the important bits at the top of their description so they are more likely to make the cut.

9 Likes

Sure, I think description makes sense there @featheredtoast

2 Likes

Sure, if it makes sense to have, I’ll see what I can do here to add it.

4 Likes

Alrighty - I’ve added group descriptions, and just simply capped the description height and allowed overflows when descriptions get large: https://github.com/discourse/discourse/commit/9738025bb2847e398b5fda36abb419ec0291d58d

Hope that looks better to you @mcwumbly

I’m personally on the fence about the overflows - On one hand, scroll bars are never very pretty, but you do get all the description text on the card without it clipping strangely.

2 Likes

Sure, @awesomerobot will you have time to help with styling here? I’m not happy with the way this looks at the moment, and I think it should generally mimic the user card a bit more.

4 Likes

Yes, definitely on it within the next day or two.

4 Likes

I’m very much liking the group cards! I noticed two oddities - see screenshot. The owners are not listed next to the word “Owner” as I would have expected. This particular group has two owners, so should we not be seeing “Owners” (multiple) and their avatars next to it? Also, longish group name get cut off instead of wrapping onto two lines.

41%20AM

3 Likes

Owner in this case means the person whose user card you expanded is the owner of that group, doesn’t it? Maybe @featheredtoast can clarify. Not entirely sure what I’m seeing here.

Hm, this seems to be a bug - It is supposed to show as “owner” when the currently logged in user is the owner of the group, and “member” when the current user is a member… but it seems to show “owner” for everyone regardless of membership. Will fix.

EDIT: I see what’s happening, and it isn’t as bad as I feared, actually. The display logic is checking if the current user is a group owner, which includes all admins. The display here should still display the correct membership on the card, admin or no - thanks for catching this. :tomato:

https://github.com/discourse/discourse/commit/3d1ff8e0ad63aac76519c0e3b47d5dee64653a77

4 Likes

To address your other point, this was intentional to keep the card compact, and looking good by default for any content. It can be changed around with CSS to allow for wraps:

#group-card h2 {
    white-space: normal;
}
4 Likes