From a4b71d1737f104860ffc8bad8eb9b788680b7ca4 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 07:21:31 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20collapsed=20rail=2056?= =?UTF-8?q?=20px=20with=20a=2034=20px=20logo=20and=20avatar,=20logo=20mark?= =?UTF-8?q?=20cropped=20to=20the=20needle=20so=20it=20fills=20its=20box?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/design/tokens.toml | 1 + crates/client/src/gui/sidebar.rs | 19 ++++++++++--------- crates/client/src/logo.rs | 7 ++++--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/crates/client/design/tokens.toml b/crates/client/design/tokens.toml index 1f6365a..57196b1 100644 --- a/crates/client/design/tokens.toml +++ b/crates/client/design/tokens.toml @@ -65,6 +65,7 @@ control_sm = 26 control = 34 row = 44 avatar = 26 +rail = 56 avatar_lg = 64 thumb = 120 sidebar = 230 diff --git a/crates/client/src/gui/sidebar.rs b/crates/client/src/gui/sidebar.rs index 31296a7..1c571a8 100644 --- a/crates/client/src/gui/sidebar.rs +++ b/crates/client/src/gui/sidebar.rs @@ -32,7 +32,6 @@ use super::{ widget::{bare_input, compact_frame, icon_button}, }; -const RAIL: f32 = size::AVATAR + space::XS * 2.; const SLIDE: std::time::Duration = std::time::Duration::from_millis(320); fn slide() -> gpui_kit::Animation { @@ -43,9 +42,9 @@ impl Yumush { pub(super) fn sidebar(&self, entity: &Entity, palette: Palette) -> impl IntoElement { let collapsed = self.chat.sidebar_collapsed; let (from, to, id) = if collapsed { - (size::SIDEBAR, RAIL, "sidebar_collapsing") + (size::SIDEBAR, size::RAIL, "sidebar_collapsing") } else { - (RAIL, size::SIDEBAR, "sidebar_expanding") + (size::RAIL, size::SIDEBAR, "sidebar_expanding") }; let content = if collapsed { self.collapsed_sidebar(entity, palette).into_any_element() @@ -71,7 +70,7 @@ impl Yumush { fn collapsed_sidebar(&self, entity: &Entity, palette: Palette) -> Div { div() .h_full() - .w(px(RAIL)) + .w(px(size::RAIL)) .flex() .flex_col() .items_center() @@ -83,7 +82,7 @@ impl Yumush { .flex_col() .items_center() .gap(px(space::MD)) - .child(logo_mark(palette)) + .child(logo_mark(palette).size(px(size::CONTROL))) .child(self.collapse_button(entity, palette)), ) .child( @@ -999,6 +998,7 @@ impl Yumush { named: bool, palette: Palette, ) -> impl IntoElement { + let face = if named { size::AVATAR } else { size::CONTROL }; profile_popover( "account_profile", Anchor::BottomLeft, @@ -1009,20 +1009,21 @@ impl Yumush { div() .flex() .items_center() - .h(px(size::CONTROL)) + .when(named, |trigger| trigger.h(px(size::CONTROL))) .gap(px(space::SM)) - .px(px(if named { space::SM } else { space::XXS })) + .p(px(if named { 0. } else { space::XXS })) + .when(named, |trigger| trigger.px(px(space::SM))) .rounded(px(radius::MD)) .child(presence_avatar( avatar( palette, user, - px(size::AVATAR), + px(face), text(text::CAPTION), &self.chat.avatars, ), self.presence_of(user.id), - px(size::AVATAR), + px(face), palette, )) .when(named, |trigger| { diff --git a/crates/client/src/logo.rs b/crates/client/src/logo.rs index f7176dc..a322a3c 100644 --- a/crates/client/src/logo.rs +++ b/crates/client/src/logo.rs @@ -4,18 +4,19 @@ use gpui_kit::{AssetSource, SharedString, assets::AllAssets}; pub const PATH: &str = "yumush/logo.svg"; -fn svg(background: &str, needle: &str, thread: &str) -> String { +fn svg(view: &str, background: &str, needle: &str, thread: &str) -> String { format!( - r##"{background}"## + r##"{background}"## ) } pub fn mark() -> String { - svg("", "#000", "#000") + svg("14 12 76 76", "", "#000", "#000") } pub fn icon() -> String { svg( + "0 0 100 100", r##""##, "#ece5d8", "#ffb36b",