From c44c5fcd6840a1b1a10818de75105af90bbff407 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:28:36 +0300 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20room=20view=20?= =?UTF-8?q?deduplicated:=20title=20=E2=8C=84=20opens=20one=20margin=20(roo?= =?UTF-8?q?m=20actions,=20voice=20lines=20in=20call),=20one=20search=20for?= =?UTF-8?q?=20people=20and=20messages,=20call=20pill=20is=20a=20count,=20f?= =?UTF-8?q?ormat=20joins=20+=20menu,=20one=20mic/send=20slot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/lang/en/chat.txt | 1 - crates/client/lang/en/composer.txt | 1 + crates/client/lang/en/message_actions.txt | 2 + crates/client/lang/tr/chat.txt | 1 - crates/client/lang/tr/composer.txt | 1 + crates/client/lang/tr/message_actions.txt | 2 + crates/client/src/gui.rs | 1 - crates/client/src/gui/chat.rs | 242 ++++++++++++++-------- crates/client/src/gui/community_card.rs | 157 -------------- crates/client/src/gui/composer.rs | 76 +++---- crates/client/src/gui/message_actions.rs | 75 ++++++- 11 files changed, 271 insertions(+), 288 deletions(-) delete mode 100644 crates/client/src/gui/community_card.rs diff --git a/crates/client/lang/en/chat.txt b/crates/client/lang/en/chat.txt index b779b50..2e7e875 100644 --- a/crates/client/lang/en/chat.txt +++ b/crates/client/lang/en/chat.txt @@ -1,7 +1,6 @@ message = Message find = Find find_user = Find user -search_messages = Search messages search = Search... new_password = New password... password = Password... diff --git a/crates/client/lang/en/composer.txt b/crates/client/lang/en/composer.txt index 91c9c67..95dcf44 100644 --- a/crates/client/lang/en/composer.txt +++ b/crates/client/lang/en/composer.txt @@ -10,6 +10,7 @@ option = Option remove_option = Remove option file = File poll = Poll +format = Format hour = 1h day = 1d week = 1w diff --git a/crates/client/lang/en/message_actions.txt b/crates/client/lang/en/message_actions.txt index f5932e5..ca80c37 100644 --- a/crates/client/lang/en/message_actions.txt +++ b/crates/client/lang/en/message_actions.txt @@ -9,3 +9,5 @@ report = Report confirm = Confirm delete = Delete send = Send +people = People +messages = Messages diff --git a/crates/client/lang/tr/chat.txt b/crates/client/lang/tr/chat.txt index 274a373..8989f89 100644 --- a/crates/client/lang/tr/chat.txt +++ b/crates/client/lang/tr/chat.txt @@ -1,7 +1,6 @@ message = Mesaj find = Bul find_user = Kullanıcı bul -search_messages = Mesajlarda ara search = Ara... new_password = Yeni şifre... password = Şifre... diff --git a/crates/client/lang/tr/composer.txt b/crates/client/lang/tr/composer.txt index 9e71aba..fc6083e 100644 --- a/crates/client/lang/tr/composer.txt +++ b/crates/client/lang/tr/composer.txt @@ -10,6 +10,7 @@ option = Seçenek remove_option = Seçeneği kaldır file = Dosya poll = Anket +format = Biçim hour = 1 sa day = 1 gün week = 1 hafta diff --git a/crates/client/lang/tr/message_actions.txt b/crates/client/lang/tr/message_actions.txt index f42ee28..48bad60 100644 --- a/crates/client/lang/tr/message_actions.txt +++ b/crates/client/lang/tr/message_actions.txt @@ -9,3 +9,5 @@ report = Bildir confirm = Onayla delete = Sil send = Gönder +people = Kişiler +messages = Mesajlar diff --git a/crates/client/src/gui.rs b/crates/client/src/gui.rs index 3f86dc5..034f74b 100644 --- a/crates/client/src/gui.rs +++ b/crates/client/src/gui.rs @@ -43,7 +43,6 @@ mod builder; mod call_bar; mod camera_view; mod chat; -mod community_card; mod community_settings; mod composer; mod dock; diff --git a/crates/client/src/gui/chat.rs b/crates/client/src/gui/chat.rs index ff81cd7..2133404 100644 --- a/crates/client/src/gui/chat.rs +++ b/crates/client/src/gui/chat.rs @@ -3,6 +3,7 @@ use super::text; use crate::gui::CLOCK; use crate::gui::glyph::Fill as _; use crate::lang::w; +use crate::marks::Mark; use std::{ collections::{BTreeMap, HashMap, HashSet, VecDeque}, sync::Arc, @@ -106,7 +107,6 @@ enum History { End, } -const FACES: usize = 3; impl History { fn of_page(length: usize) -> Self { @@ -150,7 +150,6 @@ pub struct Chat { pub(super) search_input: Entity, pub(super) friends_open: bool, pub(super) open_calls: HashSet, - pub(super) member_input: Entity, pub(super) community_search: Entity, pub(super) community_hits: Vec, pub(super) found: Option, @@ -347,14 +346,6 @@ impl Chat { ) .detach(); - let member_input = new_input(w().chat.find, window, cx); - cx.subscribe_in(&member_input, window, |_, _, event, _, cx| { - if matches!(event, InputEvent::Change) { - cx.notify(); - } - }) - .detach(); - let search_input = new_input(w().chat.find_user, window, cx); cx.subscribe_in( &search_input, @@ -367,7 +358,7 @@ impl Chat { ) .detach(); - let community_search = new_input(w().chat.search_messages, window, cx); + let community_search = new_input(w().chat.find, window, cx); cx.subscribe_in(&community_search, window, |this, _, event, window, cx| { if matches!(event, InputEvent::PressEnter { .. }) { this.search_community(window, cx); @@ -440,7 +431,6 @@ impl Chat { search_input, friends_open: false, open_calls: HashSet::new(), - member_input, community_search, community_hits: vec![], found: None, @@ -1445,7 +1435,7 @@ impl Yumush { }, } })) - .children(members_column(entity, self, themed, cx)), + .children(members_column(entity, self, themed)), ), None => panel.child(empty_state(palette)), }, @@ -1557,22 +1547,30 @@ impl Yumush { .child(title), ) .into_any_element(), - (None, Some(room)) => super::community_card::community_popover( + (None, Some(room)) => clickable( + "room_title", + palette, + entity_action(entity, |yumush, _, cx| { + yumush.chat.members_open = !yumush.chat.members_open; + cx.notify(); + }), + ) + .tip(w().chat.people) + .flex() + .items_center() + .gap(px(space::SM)) + .child(super::community_icon( + palette, room, - entity, - div() - .cursor_pointer() - .flex() - .items_center() - .gap(px(space::SM)) - .child(super::community_icon( - palette, - room, - px(size::AVATAR), - super::text(super::style::text::CAPTION), - &self.chat.avatars, - )) - .child(title), + px(size::AVATAR), + super::text(super::style::text::CAPTION), + &self.chat.avatars, + )) + .child(title) + .child( + Icon::new(IconName::ChevronDown) + .size(px(size::ICON_SM)) + .text_color(palette.tokens.faint()), ) .into_any_element(), _ => div() @@ -1616,21 +1614,6 @@ impl Yumush { (community.is_some() && !self.chat.pins.is_empty()) .then(|| message_actions::pins_popover(&self.chat, entity, palette)), ) - .children(group.then(|| { - icon_button( - "members_button", - palette, - IconName::Users, - w().chat.people, - entity_action(entity, |yumush, _, cx| { - yumush.chat.members_open = !yumush.chat.members_open; - cx.notify(); - }), - ) - .when(self.chat.members_open, |button| { - button.text_color(palette.text) - }) - })) .children(self.calling_hint(palette)) .children(voice.is_some().then(|| { div() @@ -1881,7 +1864,8 @@ impl Yumush { .into_any_element(); } - let has_text = self.chat.message_input.read(cx).text().len() > 0; + let ready = self.chat.message_input.read(cx).text().len() > 0 + || !self.chat.media.pending.is_empty(); composer::format_actions( &self.chat.message_input, @@ -1910,7 +1894,6 @@ impl Yumush { .items_center() .gap(px(space::SM)) .child(composer::plus_popover(&self.chat, &entity, palette)) - .child(composer::format_popover(palette)) .child(super::glyph::picker_button( "composer_emoji", &entity, @@ -1938,23 +1921,25 @@ impl Yumush { .flex_1() .min_w_0(), ) - .child(voice_note::mic_button(&entity, palette)) - .child( - clickable("send_button", palette, move |window, cx| { - entity.update(cx, |yumush, cx| yumush.submit_composer(&input, window, cx)) - }) - .tip(w().chat.send) - .size(px(size::CONTROL_SM)) - .flex() - .items_center() - .justify_center() - .text_color(if has_text { - palette.text - } else { - palette.muted - }) - .child(Icon::new(IconName::ArrowUp).size(px(size::ICON_SM))), - ), + .when(!ready, |this| { + this.child(voice_note::mic_button(&entity, palette)) + }) + .when(ready, |this| { + this.child( + clickable("send_button", palette, move |window, cx| { + entity.update(cx, |yumush, cx| { + yumush.submit_composer(&input, window, cx) + }) + }) + .tip(w().chat.send) + .size(px(size::CONTROL_SM)) + .flex() + .items_center() + .justify_center() + .text_color(palette.text) + .child(Icon::new(IconName::ArrowUp).size(px(size::ICON_SM))), + ) + }), ) .into_any_element() } @@ -2777,7 +2762,6 @@ impl Yumush { .first() .map(|user| user.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), @@ -2825,24 +2809,12 @@ impl Yumush { .h(px(space::LG)) .child(super::parts::voice_line(bands, voice, t)), ) - .children(users.iter().take(FACES).enumerate().map(|(index, user)| { - avatar( - palette, - user, - px(size::AVATAR), - super::text(super::style::text::CAPTION), - &self.chat.avatars, - ) - .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( + users.len().to_string(), + super::parts::Text::Ui, + super::parts::Ink::Paper, + t, + )) }) .child(super::parts::words(label, super::parts::Text::Ui, ink, t)), ) @@ -3048,7 +3020,6 @@ fn members_column( entity: &Entity, yumush: &Yumush, palette: Palette, - cx: &App, ) -> Option> { let chat = &yumush.chat; let community_id = chat.selected_community_id?; @@ -3059,11 +3030,9 @@ fn members_column( return None; } let voice = chat.voice_ids(community_id); - let query = search_text(&chat.member_input, cx); let members: Vec = chat .members .iter() - .filter(|member| member.user.username.to_lowercase().contains(&query)) .map(|member| MemberRow { user: member.user.clone(), rank: chat.rank_of(&member.user), @@ -3114,18 +3083,13 @@ fn members_column( .gap(px(space::SM)) .child(user.username.clone()) .children(rank_tag(*rank, palette)) - .children(in_voice.then(|| { - Icon::new(IconName::Headphones) - .size(px(size::ICON_SM)) - .text_color(palette.muted) - })) .children(muted.then(|| { Icon::new(IconName::MicOff) .size(px(size::ICON_SM)) .text_color(palette.danger) })), ) - .children((!user.status.is_empty()).then(|| { + .children((!user.status.is_empty() && !in_voice).then(|| { div() .text_size(text(text::CAPTION)) .text_color(palette.muted) @@ -3135,7 +3099,23 @@ fn members_column( super::text(super::style::text::CAPTION), )) })), - ), + ) + .children(in_voice.then(|| { + let speaking = chat.waves.speaking.contains(&user.id); + div() + .w(px(size::CONTROL * 1.5)) + .h(px(space::LG)) + .flex_none() + .child(super::parts::voice_line( + chat.waves.voice(user.id), + if speaking { + super::parts::Voice::Live(palette.tokens.person(user.id)) + } else { + super::parts::Voice::Quiet + }, + palette.tokens, + )) + })), palette, ), ) @@ -3180,13 +3160,91 @@ fn members_column( .gap(px(space::LG)) .border_l_1() .border_color(palette.border) - .child(super::sidebar::input_box(&chat.member_input, palette)) + .child(room_head(yumush, community_id, &entity, palette)) .children(section(w().chat.in_call, in_call)) .children(section(w().chat.online, online)) .children(section(w().chat.offline, offline)), ) } +fn room_head(yumush: &Yumush, id: Id, entity: &Entity, palette: Palette) -> Div { + let chat = &yumush.chat; + let online = chat + .members + .iter() + .filter(|member| yumush.presence_of(member.user.id) != Presence::Offline) + .count(); + let pinned = chat.pinned.contains(&id); + let muted = chat.muted.contains(&id); + let words = &w().sidebar; + let action = |key: &'static str, + icon: IconName, + tip: &'static str, + run: fn(&mut Yumush, Id, &mut Window, &mut Context)| { + icon_button( + key, + palette, + icon, + tip, + entity_action(entity, move |yumush, window, cx| run(yumush, id, window, cx)), + ) + }; + + div() + .px(px(space::SM)) + .flex() + .flex_col() + .gap(px(space::XS)) + .child(super::parts::words( + w().community_card.people(chat.members.len(), online), + super::parts::Text::Caption, + super::parts::Ink::Dim, + palette.tokens, + )) + .child( + div() + .ml(px(-space::SM)) + .flex() + .items_center() + .child(action( + "room_invite", + IconName::UserPlus, + words.invite, + |yumush, id, window, cx| yumush.open_invite(id, window, cx), + )) + .child(action( + "room_mute", + if muted { IconName::BellOff } else { IconName::Bell }, + if muted { words.unmute } else { words.mute }, + |yumush, id, _, cx| yumush.toggle_mark(Mark::Mute, id, cx), + )) + .child( + action( + "room_pin", + IconName::Pin, + if pinned { words.unpin } else { words.pin }, + |yumush, id, _, cx| yumush.toggle_mark(Mark::Pin, id, cx), + ) + .when(pinned, |button| button.text_color(palette.text)), + ) + .child(action( + "room_settings", + IconName::Settings, + words.settings, + |yumush, id, window, cx| yumush.open_community_settings(id, window, cx), + )) + .children(permission::can_leave(yumush.actor_rank()).then(|| { + action( + "room_leave", + IconName::LogOut, + words.leave, + |yumush, id, window, cx| yumush.leave_community(id, window, cx), + ) + .text_color(palette.danger) + })), + ) +} + fn accent_bar(palette: Palette) -> Div { div() .flex() diff --git a/crates/client/src/gui/community_card.rs b/crates/client/src/gui/community_card.rs deleted file mode 100644 index 6e2e32b..0000000 --- a/crates/client/src/gui/community_card.rs +++ /dev/null @@ -1,157 +0,0 @@ -use common::{ - model::{Community, Id, Presence}, - permission, -}; -use gpui_kit::{ - Anchor, Context, Entity, FontWeight, Hsla, IntoElement, ParentElement, Styled, Window, - assets::IconName, component::popover::Popover, div, px, -}; - -use super::parts::{Ink, Text, band, stack, words}; -use super::profile::{menu_icon, menu_row, yumush_action}; -use super::style::{size, space, stroke, text}; -use super::{Trigger, Yumush, text}; -use crate::lang::w; -use crate::marks::Mark; - -pub(super) fn community_popover( - community: &Community, - entity: &Entity, - trigger: impl IntoElement, -) -> Popover { - let community = community.clone(); - let entity = entity.clone(); - - Popover::new("community_card") - .anchor(Anchor::TopLeft) - .appearance(false) - .trigger(Trigger::new(trigger)) - .content(move |_, _, cx| { - let popover = cx.entity(); - let yumush = entity.read(cx); - let palette = super::palette(cx); - let t = palette.tokens; - let id = community.id; - let name = super::community_name(&community).to_string(); - let members = yumush.chat.members.len(); - let online = yumush - .chat - .members - .iter() - .filter(|member| yumush.presence_of(member.user.id) != Presence::Offline) - .count(); - let pinned = yumush.chat.pinned.contains(&id); - let muted = yumush.chat.muted.contains(&id); - let can_leave = permission::can_leave(yumush.actor_rank()); - let words_sidebar = &w().sidebar; - let row = - |key: &'static str, - label: &'static str, - icon: IconName, - color: Hsla, - run: fn(&mut Yumush, Id, &mut Window, &mut Context)| { - menu_row( - key, - label, - menu_icon(icon), - color, - palette, - yumush_action(&entity, &popover, move |yumush, window, cx| { - run(yumush, id, window, cx) - }), - ) - }; - - super::parts::popover(t) - .w(px(size::POPOVER)) - .gap(px(space::LG)) - .child( - band(space::LG) - .child(super::zoomable( - &entity, - "community_picture", - super::community_icon( - palette, - &community, - px(size::AVATAR_LG), - text(text::BODY), - &yumush.chat.avatars, - ), - super::Zoom::new( - super::picture_of(&community, &yumush.chat.avatars), - false, - name.clone(), - ), - )) - .child( - stack(space::XXS) - .flex_1() - .min_w_0() - .child( - words(name, Text::Body, Ink::Paper, t) - .font_weight(FontWeight::MEDIUM) - .truncate(), - ) - .child(words( - w().community_card.people(members, online), - Text::Caption, - Ink::Dim, - t, - )), - ), - ) - .child(div().w_full().h(px(stroke::LINE)).bg(t.thread())) - .child( - stack(space::XS) - .child(row( - "community_invite", - words_sidebar.invite, - IconName::UserPlus, - palette.text, - |yumush, id, window, cx| yumush.open_invite(id, window, cx), - )) - .child(row( - "community_settings", - words_sidebar.settings, - IconName::Settings, - palette.text, - |yumush, id, window, cx| yumush.open_community_settings(id, window, cx), - )) - .child(row( - "community_pin", - if pinned { - words_sidebar.unpin - } else { - words_sidebar.pin - }, - IconName::Pin, - palette.text, - |yumush, id, _, cx| yumush.toggle_mark(Mark::Pin, id, cx), - )) - .child(row( - "community_mute", - if muted { - words_sidebar.unmute - } else { - words_sidebar.mute - }, - if muted { - IconName::Bell - } else { - IconName::BellOff - }, - palette.text, - |yumush, id, _, cx| yumush.toggle_mark(Mark::Mute, id, cx), - )) - .children(can_leave.then(|| { - row( - "community_leave", - words_sidebar.leave, - IconName::LogOut, - palette.danger, - |yumush, id, window, cx| yumush.leave_community(id, window, cx), - ) - })), - ) - }) -} diff --git a/crates/client/src/gui/composer.rs b/crates/client/src/gui/composer.rs index 88218a1..359b164 100644 --- a/crates/client/src/gui/composer.rs +++ b/crates/client/src/gui/composer.rs @@ -541,43 +541,32 @@ pub(super) fn trigger_icon( )) } -pub fn format_popover(palette: Palette) -> impl IntoElement { - Popover::new("format_popover") - .anchor(Anchor::BottomLeft) - .appearance(false) - .trigger(trigger_icon( - "format_trigger", - IconName::Type, - size::CONTROL_SM, - palette, - )) - .content(move |_, _, _| { - panel(palette) - .w(px(size::SHEET)) - .p(px(space::SM)) +fn format_panel(palette: Palette) -> impl IntoElement { + panel(palette) + .w(px(size::SHEET)) + .p(px(space::SM)) + .flex() + .flex_col() + .gap(px(space::SM)) + .text_size(text(text::CAPTION)) + .children(FORMAT_ROWS.map(|(syntax, shortcut)| { + div() .flex() - .flex_col() - .gap(px(space::SM)) - .text_size(text(text::CAPTION)) - .children(FORMAT_ROWS.map(|(syntax, shortcut)| { + .items_center() + .gap(px(space::MD)) + .child( div() - .flex() - .items_center() - .gap(px(space::MD)) - .child( - div() - .w(px(size::THUMB)) - .text_color(palette.muted) - .child(syntax), - ) - .child(div().flex_1().child(TextView::markdown(syntax, syntax))) - .child( - div() - .text_color(palette.muted) - .child(shortcut_label(shortcut)), - ) - })) - }) + .w(px(size::THUMB)) + .text_color(palette.muted) + .child(syntax), + ) + .child(div().flex_1().child(TextView::markdown(syntax, syntax))) + .child( + div() + .text_color(palette.muted) + .child(shortcut_label(shortcut)), + ) + })) } #[derive(Clone, Copy, PartialEq, Eq, Default)] @@ -585,6 +574,7 @@ pub(super) enum PlusMenu { #[default] Menu, Poll, + Format, } fn plus_row( @@ -640,9 +630,13 @@ pub fn plus_popover(chat: &Chat, entity: &Entity, palette: Palette) -> i )) .content(move |_, _, cx| { let popover = cx.entity(); + if entity.read(cx).chat.plus_menu == PlusMenu::Format { + return format_panel(palette).into_any_element(); + } if entity.read(cx).chat.plus_menu == PlusMenu::Menu { let file = entity.clone(); let poll = entity.clone(); + let format = entity.clone(); return panel(palette) .w(px(size::SIDEBAR)) .p(px(space::XS)) @@ -671,6 +665,18 @@ pub fn plus_popover(chat: &Chat, entity: &Entity, palette: Palette) -> i }) }, )) + .child(plus_row( + "plus_format", + IconName::Type, + w().composer.format, + palette, + move |_, cx| { + format.update(cx, |yumush, cx| { + yumush.chat.plus_menu = PlusMenu::Format; + cx.notify(); + }) + }, + )) .into_any_element(); } let toggle = entity.clone(); diff --git a/crates/client/src/gui/message_actions.rs b/crates/client/src/gui/message_actions.rs index b7f008a..309c732 100644 --- a/crates/client/src/gui/message_actions.rs +++ b/crates/client/src/gui/message_actions.rs @@ -27,7 +27,7 @@ use super::{ composer::trigger_icon, entity_action, millis_time, notify_error, primary_button, sidebar, style::{radius, size, space, text}, - widget::{field, icon_button, panel, spawn_done}, + widget::{field, icon_button, panel, search_text, spawn_done}, }; pub fn reactions( @@ -229,6 +229,33 @@ fn jump_row( ) } +fn person_row( + user: &User, + entity: &Entity, + popover: &Entity, + palette: Palette, +) -> Stateful
{ + let entity = entity.clone(); + let popover = popover.clone(); + let user_id = user.id; + + clickable( + format!("search_person_{user_id}"), + palette, + move |window, cx| { + popover.update(cx, |state, cx| state.dismiss(window, cx)); + entity.update(cx, |yumush, cx| yumush.open_direct(user_id, window, cx)); + }, + ) + .flex() + .items_center() + .gap(px(space::SM)) + .px(px(space::SM)) + .py(px(space::XS)) + .rounded(px(radius::MD)) + .text_size(text(text::CAPTION)) +} + pub fn search_popover(chat: &Chat, entity: &Entity, palette: Palette) -> impl IntoElement { let entity = entity.clone(); let input = chat.community_search.clone(); @@ -258,6 +285,22 @@ pub fn search_popover(chat: &Chat, entity: &Entity, palette: Palette) -> )) .content(move |_, _, cx| { let popover = cx.entity(); + let query = search_text(&input, cx); + let yumush = entity.read(cx); + let people: Vec<&User> = if query.is_empty() { + vec![] + } else { + yumush + .chat + .members + .iter() + .map(|member| &member.user) + .filter(|user| { + !yumush.is_me(user.id) && user.username.to_lowercase().contains(&query) + }) + .take(5) + .collect() + }; panel(palette) .w(px(size::POPOVER)) .p(px(space::XS)) @@ -265,6 +308,36 @@ pub fn search_popover(chat: &Chat, entity: &Entity, palette: Palette) -> .flex_col() .gap(px(space::XS)) .child(sidebar::input_box(&input, palette)) + .children((!people.is_empty()).then(|| { + div() + .px(px(space::SM)) + .text_size(text(text::CAPTION)) + .text_color(palette.muted) + .child(w().message_actions.people) + })) + .children(people.iter().map(|user| { + person_row(user, &entity, &popover, palette) + .child(avatar( + palette, + user, + px(size::ICON_SM), + text(text::CAPTION), + &yumush.chat.avatars, + )) + .child( + div() + .flex_shrink_0() + .font_weight(FontWeight::SEMIBOLD) + .child(user.username.clone()), + ) + })) + .children((!query.is_empty() && !hits.is_empty()).then(|| { + div() + .px(px(space::SM)) + .text_size(text(text::CAPTION)) + .text_color(palette.muted) + .child(w().message_actions.messages) + })) .children(hits.iter().map(|hit| { jump_row("search_hit", hit, &entity, &popover, palette) .children(hit.time.as_ref().map(|time| {