Skip to content

Commit

Permalink
Revert "recent: Remove participant avatars from PM rows."
Browse files Browse the repository at this point in the history
This reverts commit 7e1fe7e.
  • Loading branch information
amanagr authored and timabbott committed Dec 6, 2022
1 parent 1890b6e commit d1085c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
18 changes: 9 additions & 9 deletions static/js/recent_topics_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,15 +424,9 @@ function format_conversation(conversation_data) {
context.pm_url = last_msg.pm_with_url;
context.is_group = last_msg.display_recipient.length > 2;

// Don't show participant avatars for PMs.
// "Participants" column on "Recent topics" does not provide accurate information for PM conversations.
// In particular, it duplicates the PM recipients list under "Topics"
// (with the addition of the current user), but does not depend on who sent messages to the thread.
// TODO: https://github.com/zulip/zulip/issues/23563
all_senders = [];
senders = [];
extra_sender_ids = [];
displayed_other_senders = [];
// Display in most recent sender first order
all_senders = last_msg.display_recipient;
senders = all_senders.slice(-MAX_AVATAR).map((sender) => sender.id);

if (!context.is_group) {
const user_id = Number.parseInt(last_msg.to_user_ids, 10);
Expand All @@ -445,6 +439,12 @@ function format_conversation(conversation_data) {
context.user_circle_class = buddy_data.get_user_circle_class(user_id);
}
}

// Collect extra senders fullname for tooltip.
extra_sender_ids = all_senders.slice(0, -MAX_AVATAR);
displayed_other_senders = extra_sender_ids
.slice(-MAX_EXTRA_SENDERS)
.map((sender) => sender.id);
}

context.senders = people.sender_info_for_recent_topics_row(senders);
Expand Down
3 changes: 0 additions & 3 deletions static/templates/recent_topic_row.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@
</td>
<td class='recent_topic_users'>
<ul class="recent_topics_participants">
{{#if is_private}}
{{else}}
{{#if other_senders_count}}
<li class="recent_topics_participant_item tippy-zulip-tooltip" data-tooltip-template-id="recent_topics_participant_overflow_tooltip:{{conversation_key}}">
<span class="recent_topics_participant_overflow">+{{other_senders_count}}</span>
Expand All @@ -89,7 +87,6 @@
</li>
{{/if}}
{{/each}}
{{/if}}
</ul>
</td>
<td class="recent_topic_timestamp">
Expand Down

0 comments on commit d1085c0

Please sign in to comment.