From 7b463bab0bfdd941ce94091eb296b61e477f6865 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 21:26:55 +0300 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20one=20floating?= =?UTF-8?q?=20surface=20(parts::surface:=20raise,=20thread=20border,=20sha?= =?UTF-8?q?dow,=20occludes)=20behind=20popovers,=20panels,=20Ctrl+K=20and?= =?UTF-8?q?=20the=20stats=20sheet;=20stats=20sheet=20no=20longer=20lets=20?= =?UTF-8?q?clicks=20through?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui/chat.rs | 7 +------ crates/client/src/gui/jump.rs | 8 +------- crates/client/src/gui/parts.rs | 12 ++++++++++-- crates/client/src/gui/widget.rs | 4 ++-- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/crates/client/src/gui/chat.rs b/crates/client/src/gui/chat.rs index 4ae346d..e4352dc 100644 --- a/crates/client/src/gui/chat.rs +++ b/crates/client/src/gui/chat.rs @@ -1449,7 +1449,7 @@ impl Yumush { .stats_at .filter(|_| self.chat.voice_community().is_some())?; Some( - div() + super::parts::surface(palette.tokens) .id("stats_sheet") .absolute() .right(px(space::LG)) @@ -1464,11 +1464,6 @@ impl Yumush { StatsAt::Header => space::XL, StatsAt::Dock => space::LG, })) - .rounded(px(radius::LG)) - .border_1() - .border_color(palette.border) - .bg(palette.tokens.raise()) - .shadow_lg() .child(voice_stats::stats_panel( &self.chat.stats, &|id| self.chat.name_of(id), diff --git a/crates/client/src/gui/jump.rs b/crates/client/src/gui/jump.rs index 880d783..355d8c2 100644 --- a/crates/client/src/gui/jump.rs +++ b/crates/client/src/gui/jump.rs @@ -504,17 +504,11 @@ impl Yumush { .on_click(cx.listener(|this, _, window, cx| this.close_jump(window, cx))), ) .child( - div() + super::parts::surface(t) .w(px(size::SHEET + size::THUMB)) .flex() .flex_col() .overflow_hidden() - .bg(t.raise()) - .rounded(px(radius::LG)) - .border_1() - .border_color(t.thread()) - .shadow_lg() - .occlude() .capture_action(cx.listener( |this, _: &gpui_kit::component::input::Escape, window, cx| { this.close_jump(window, cx); diff --git a/crates/client/src/gui/parts.rs b/crates/client/src/gui/parts.rs index fe4579c..1b4ee05 100644 --- a/crates/client/src/gui/parts.rs +++ b/crates/client/src/gui/parts.rs @@ -334,13 +334,21 @@ pub fn chevron( .on_click(move |_, window, cx| on_click(window, cx)) } -pub fn popover(t: Tokens) -> Div { - column() +pub fn surface(t: Tokens) -> Div { + div() .bg(t.raise()) .rounded(px(radius::LG)) .border_1() .border_color(t.thread()) .shadow_lg() + .occlude() +} + +pub fn popover(t: Tokens) -> Div { + surface(t) + .flex() + .flex_col() + .min_w_0() .px(px(space::XL - 4.)) .py(px(space::LG + 2.)) } diff --git a/crates/client/src/gui/widget.rs b/crates/client/src/gui/widget.rs index 1633365..60ef349 100644 --- a/crates/client/src/gui/widget.rs +++ b/crates/client/src/gui/widget.rs @@ -10,7 +10,7 @@ use gpui_kit::{ use super::{ Palette, Tooltip as _, Yumush, clickable, notify_error, - style::{radius, size, space}, + style::{size, space}, }; pub(super) fn icon_button( @@ -33,7 +33,7 @@ pub(super) fn icon_button( } pub(super) fn panel(palette: Palette) -> Div { - div().rounded(px(radius::LG)).bg(palette.field) + super::parts::surface(palette.tokens) } pub(super) fn field(palette: Palette, input: &Entity) -> Div {