buddy_list: Add clarity around not showing user links when searching.

Follow-up to https://github.com/zulip/zulip/pull/34677#discussion_r2112962338
This commit is contained in:
Evy Kassirer
2025-05-28 17:32:01 -07:00
committed by Tim Abbott
parent fd6b70e1ca
commit fdb17ebaf0

View File

@@ -368,9 +368,7 @@ export class BuddyList extends BuddyListConf {
// This must happen after `fill_screen_with_content` // This must happen after `fill_screen_with_content`
$("#buddy-list-users-matching-view-container .view-all-subscribers-link").remove(); $("#buddy-list-users-matching-view-container .view-all-subscribers-link").remove();
$("#buddy-list-other-users-container .view-all-users-link").remove(); $("#buddy-list-other-users-container .view-all-users-link").remove();
if (!buddy_data.get_is_searching_users()) {
void this.render_view_user_list_links(); void this.render_view_user_list_links();
}
this.display_or_hide_sections(); this.display_or_hide_sections();
void this.update_empty_list_placeholders(); void this.update_empty_list_placeholders();
@@ -709,6 +707,14 @@ export class BuddyList extends BuddyListConf {
} }
async render_view_user_list_links(): Promise<void> { async render_view_user_list_links(): Promise<void> {
// We don't show the "view user" links when searching, because
// these links are meant to reduce confusion about the list
// being incomplete, and it's obvious why it's incomplete during
// search.
if (buddy_data.get_is_searching_users()) {
return;
}
const {current_sub, other_users_count} = this.render_data; const {current_sub, other_users_count} = this.render_data;
const non_participant_users_matching_view_count = const non_participant_users_matching_view_count =
await this.non_participant_users_matching_view_count(); await this.non_participant_users_matching_view_count();
@@ -723,7 +729,7 @@ export class BuddyList extends BuddyListConf {
// After the `await`, we might have changed to a different channel view. // After the `await`, we might have changed to a different channel view.
// If so, we shouldn't update the DOM anymore, and should let the newer `populate` // If so, we shouldn't update the DOM anymore, and should let the newer `populate`
// call set things up with fresh data. We also want to make sure not to show // call set things up with fresh data. We also want to ensure we're still not showing
// the links when searching users, which might have changed since fetching data. // the links when searching users, which might have changed since fetching data.
if (current_sub !== this.render_data.current_sub || buddy_data.get_is_searching_users()) { if (current_sub !== this.render_data.current_sub || buddy_data.get_is_searching_users()) {
return; return;