Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Show display name in collab panel (#39384)
David Kleingeld8575972a0715
diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rsindex d3190067f30..f42c12ac578 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<Self>) -> 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))}))})}