From b1995a064e1df74063b4d10ca32fb549333ca5e8 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 20:17:24 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20room=20header=20voice?= =?UTF-8?q?=20pill=20puts=20whoever=20is=20speaking=20first=20and=20shows?= =?UTF-8?q?=20+N=20past=20three=20faces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui/chat.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/crates/client/src/gui/chat.rs b/crates/client/src/gui/chat.rs index 8885d22..ff81cd7 100644 --- a/crates/client/src/gui/chat.rs +++ b/crates/client/src/gui/chat.rs @@ -106,6 +106,8 @@ enum History { End, } +const FACES: usize = 3; + impl History { fn of_page(length: usize) -> Self { if length < MESSAGE_PAGE_LIMIT { @@ -2769,11 +2771,13 @@ impl Yumush { } let t = palette.tokens; - let users = self.voice_users(community_id); + let mut users = self.voice_users(community_id); + users.sort_by_key(|user| !self.chat.waves.speaking.contains(&user.id)); let speaker = users - .iter() + .first() .map(|user| user.id) - .find(|id| self.chat.waves.speaking.contains(id)); + .filter(|id| self.chat.waves.speaking.contains(id)); + let more = users.len().saturating_sub(FACES); let (icon, label) = match (direct, in_voice) { (true, false) => (IconName::Phone, w().chat.call), (true, true) => (IconName::PhoneOff, w().chat.hang_up), @@ -2821,7 +2825,7 @@ impl Yumush { .h(px(space::LG)) .child(super::parts::voice_line(bands, voice, t)), ) - .children(users.iter().take(3).enumerate().map(|(index, user)| { + .children(users.iter().take(FACES).enumerate().map(|(index, user)| { avatar( palette, user, @@ -2831,6 +2835,14 @@ impl Yumush { ) .when(index > 0, |avatar| avatar.ml(px(-space::XS))) })) + .when(more > 0, |this| { + this.child(super::parts::words( + format!("+{more}"), + super::parts::Text::Caption, + super::parts::Ink::Dim, + t, + )) + }) }) .child(super::parts::words(label, super::parts::Text::Ui, ink, t)), )