From 4d11f0d95a6283428cc1c5d39e3e1609129579fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sun, 29 Nov 2026 07:07:14 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20join=20voice=20is=20one?= =?UTF-8?q?=20pill=20below=20the=20In=20voice=20list=20(or=20alone=20when?= =?UTF-8?q?=20empty);=20section=20header=20no=20longer=20carries=20an=20ac?= =?UTF-8?q?tion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui/chat.rs | 43 ++++++++++++----------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/crates/client/src/gui/chat.rs b/crates/client/src/gui/chat.rs index 750a999..0b0fd4c 100644 --- a/crates/client/src/gui/chat.rs +++ b/crates/client/src/gui/chat.rs @@ -3181,10 +3181,7 @@ fn members_column( .children(watch(Kind::Camera)) .children(watch(Kind::Screen)) }; - let section = |title: &'static str, - rows: Vec<&MemberRow>, - cap: usize, - action: Option>| { + let section = |title: &'static str, rows: Vec<&MemberRow>, cap: usize| { (!rows.is_empty()).then(|| { let total = rows.len(); let more = total.saturating_sub(cap); @@ -3193,11 +3190,7 @@ fn members_column( .flex_col() .child( super::parts::caption_head(format!("{title} ยท {total}"), palette.tokens) - .pb(px(space::XS)) - .flex() - .items_center() - .justify_between() - .children(action), + .pb(px(space::XS)), ) .children(rows.into_iter().take(cap).map(row)) .when(more > 0, |this| { @@ -3228,24 +3221,22 @@ fn members_column( let action = entity_action(&entity, move |yumush, window, cx| { yumush.toggle_voice(community_id, window, cx) }); - let empty = in_call.is_empty(); - let pill = super::parts::pill("margin_join", palette.tokens, action) + super::parts::pill("margin_join", palette.tokens, action) .self_start() .gap(px(space::SM)) .text_color(palette.tokens.ground()) .font_weight(FontWeight::SEMIBOLD) - .child(super::parts::small_icon(IconName::Headphones)); - if empty { - pill.child(w().chat.join_voice) - } else { - pill.h(px(size::CHIP)).px(px(space::SM)).child(w().chat.join) - } + .child(super::parts::small_icon(IconName::Headphones)) + .child(w().chat.join_voice) + }); + let call = (!in_call.is_empty() || join.is_some()).then(|| { + div() + .flex() + .flex_col() + .gap(px(space::SM)) + .children(section(w().chat.in_voice, in_call, usize::MAX)) + .children(join) }); - let call = if in_call.is_empty() { - join.map(|join| div().child(join)) - } else { - section(w().chat.in_voice, in_call, usize::MAX, join) - }; let online = members .iter() .filter(|row| !row.in_voice && row.presence != Presence::Offline) @@ -3266,12 +3257,7 @@ fn members_column( .gap(px(space::LG)) .child(room_head(yumush, palette)) .children(call) - .children(section( - w().common.presence_online, - online, - usize::MAX, - None, - )) + .children(section(w().common.presence_online, online, usize::MAX)) .children(section( w().common.presence_offline, offline, @@ -3280,7 +3266,6 @@ fn members_column( } else { OFFLINE }, - None, )), ) }