From 8575972a071556e37ad571ca783ce544fe39b52f Mon Sep 17 00:00:00 2001 From: David Kleingeld Date: Thu, 2 Oct 2025 18:17:27 +0200 Subject: [PATCH] Show display name in collab panel (#39384) Release Notes: - Improved Collab panel by showing display names and github handles Co-authored-by: Cole Miller --- crates/collab_ui/src/collab_panel.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index d3190067f303becd749cc494c973f1fa1b6db195..f42c12ac57826625ceff82158da3ebd90b9e2452 100644 --- a/crates/collab_ui/src/collab_panel.rs +++ b/crates/collab_ui/src/collab_panel.rs @@ -922,7 +922,7 @@ impl CollabPanel { ListItem::new(user.github_login.clone()) .start_slot(Avatar::new(user.avatar_uri.clone())) - .child(Label::new(user.github_login.clone())) + .child(render_participant_name_and_handle(user)) .toggle_state(is_selected) .end_slot(if is_pending { Label::new("Calling").color(Color::Muted).into_any_element() @@ -2505,7 +2505,7 @@ impl CollabPanel { h_flex() .w_full() .justify_between() - .child(Label::new(github_login.clone())) + .child(render_participant_name_and_handle(&contact.user)) .when(calling, |el| { el.child(Label::new("Calling").color(Color::Muted)) }) @@ -2940,6 +2940,14 @@ fn render_tree_branch( .h(line_height) } +fn render_participant_name_and_handle(user: &User) -> impl IntoElement { + Label::new(if let Some(ref display_name) = user.name { + format!("{display_name} ({})", user.github_login) + } else { + user.github_login.to_string() + }) +} + impl Render for CollabPanel { fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl IntoElement { v_flex() @@ -3183,7 +3191,7 @@ impl Render for JoinChannelTooltip { h_flex() .gap_2() .child(Avatar::new(participant.avatar_uri.clone())) - .child(Label::new(participant.github_login.clone())) + .child(render_participant_name_and_handle(participant)) })) }) }