From 5f124ad117eff5075d74fdefad6d6177083e6835 Mon Sep 17 00:00:00 2001 From: evykassirer Date: Tue, 12 Nov 2024 21:00:49 -0800 Subject: [PATCH] right_sidebar: Simplify and shorten heading titles. Part of fixing #32268. --- web/src/buddy_list.ts | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/web/src/buddy_list.ts b/web/src/buddy_list.ts index 402daf1482..f69ad48eb6 100644 --- a/web/src/buddy_list.ts +++ b/web/src/buddy_list.ts @@ -440,12 +440,12 @@ export class BuddyList extends BuddyListConf { const {current_sub, total_human_subscribers_count, other_users_count} = this.render_data; $(".buddy-list-subsection-header").empty(); - // If we're in the mode of hiding headers, that means we're only showing the "other users" + // If we're in the mode of hiding headers, that means we're only showing the "others" // section, so hide the other two sections. $("#buddy-list-users-matching-view-container").toggleClass("no-display", hide_headers); // This is the case where every subscriber is in the participants list. In this case, we - // hide the "others in this channel" section. + // hide the "in this channel" section. if ( show_participants_list && total_human_subscribers_count === this.participant_user_ids.length @@ -457,22 +457,15 @@ export class BuddyList extends BuddyListConf { return; } - let header_text; - if (current_sub) { - if (all_participant_ids.size) { - header_text = $t({defaultMessage: "OTHERS IN THIS CHANNEL"}); - } else { - header_text = $t({defaultMessage: "IN THIS CHANNEL"}); - } - } else { - header_text = $t({defaultMessage: "IN THIS CONVERSATION"}); - } + const header_text = current_sub + ? $t({defaultMessage: "THIS CHANNEL"}) + : $t({defaultMessage: "THIS CONVERSATION"}); $("#buddy-list-participants-container .buddy-list-subsection-header").append( $( render_section_header({ id: "buddy-list-participants-section-heading", - header_text: $t({defaultMessage: "IN THIS CONVERSATION"}), + header_text: $t({defaultMessage: "THIS CONVERSATION"}), user_count: get_formatted_sub_count(all_participant_ids.size), is_collapsed: this.participants_is_collapsed, }),