From eccb83b6871c3d3b393d5a598d1fc5f99f04be3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sat, 28 Nov 2026 19:17:05 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20in=20a=20direct=20chat=20th?= =?UTF-8?q?e=20header's=20avatar=20and=20name=20open=20the=20person's=20ca?= =?UTF-8?q?rd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui/chat.rs | 76 +++++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 22 deletions(-) diff --git a/crates/client/src/gui/chat.rs b/crates/client/src/gui/chat.rs index 92a76bb..50b2316 100644 --- a/crates/client/src/gui/chat.rs +++ b/crates/client/src/gui/chat.rs @@ -1508,6 +1508,16 @@ impl Yumush { let group = community.is_some_and(|community| matches!(community.kind, CommunityKind::Group)); let voice = self.voice_toggle(entity, palette); + let peer = community.and_then(|community| match &community.kind { + CommunityKind::Direct { peer } => Some(self.chat.author(peer.id).unwrap_or(peer)), + _ => None, + }); + let title = super::parts::words( + name.to_string(), + super::parts::Text::Title, + super::parts::Ink::Paper, + palette.tokens, + ); div() .h(px(size::ROW + space::MD)) @@ -1515,30 +1525,52 @@ impl Yumush { .flex() .items_center() .gap(px(space::SM)) - .children(community.map(|community| { - super::zoomable( + .child(match peer { + Some(peer) => super::profile::profile_popover( + "header_peer", + Anchor::TopLeft, + peer, entity, - "header_picture", - super::community_icon( - palette, - community, - px(size::AVATAR), - super::text(super::style::text::CAPTION), - &self.chat.avatars, - ), - super::Zoom::new( - super::picture_of(community, &self.chat.avatars), - !matches!(community.kind, CommunityKind::Group), - name.to_string(), - ), + div() + .cursor_pointer() + .flex() + .items_center() + .gap(px(space::SM)) + .child(super::avatar( + palette, + peer, + px(size::AVATAR), + super::text(super::style::text::CAPTION), + &self.chat.avatars, + )) + .child(title), ) - })) - .child(super::parts::words( - name.to_string(), - super::parts::Text::Title, - super::parts::Ink::Paper, - palette.tokens, - )) + .into_any_element(), + None => div() + .flex() + .items_center() + .gap(px(space::SM)) + .children(community.map(|community| { + super::zoomable( + entity, + "header_picture", + super::community_icon( + palette, + community, + px(size::AVATAR), + super::text(super::style::text::CAPTION), + &self.chat.avatars, + ), + super::Zoom::new( + super::picture_of(community, &self.chat.avatars), + !matches!(community.kind, CommunityKind::Group), + name.to_string(), + ), + ) + })) + .child(title) + .into_any_element(), + }) .child(div().flex_1()) .children( community