From 9e7fb6d366738fbbbbe9f472fce57f1d1dbd512a 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 00:11:44 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20grid=20view=20split=20tak?= =?UTF-8?q?es=20the=20space=20under=20the=20header=20so=20the=20side=20com?= =?UTF-8?q?poser=20fits;=20drop=20the=20members/chat=20swap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui/chat.rs | 84 +++++++++++++---------------------- 1 file changed, 32 insertions(+), 52 deletions(-) diff --git a/crates/client/src/gui/chat.rs b/crates/client/src/gui/chat.rs index 54618a9..ead6c90 100644 --- a/crates/client/src/gui/chat.rs +++ b/crates/client/src/gui/chat.rs @@ -282,7 +282,6 @@ pub struct Chat { pub(super) camera_task: Option>, pub(super) stage: Stage, pub(super) grid_size: (f32, f32), - pub(super) chat_on_top: bool, pub(super) typing: HashMap>, pub(super) typing_sent: HashMap, } @@ -580,7 +579,6 @@ impl Chat { camera_task: None, stage: Stage::Strip, grid_size: (1280., 720.), - chat_on_top: false, composer: Composer::Compose { reply: None }, } } @@ -1458,51 +1456,41 @@ impl Yumush { }; let members = members_column(entity, self, palette); match (viewer, grid, members) { - (None, Some(grid), Some(members)) => h_resizable("stage_split") - .child( - resizable_panel() - .size_range(px(size::PAGE)..gpui_kit::Pixels::MAX) - .child(div().size_full().flex().flex_col().child(grid)), - ) + (None, Some(grid), Some(members)) => div() + .flex_1() + .min_h_0() .child( - resizable_panel() - .size(px(size::MARGIN_CHAT)) - .size_range(px(size::MARGIN)..px(size::MARGIN * 2.)) - .fixed() - .child({ - let members = resizable_panel() - .size(px(size::THUMB * 2.)) - .size_range(px(size::ROW * 2.)..gpui_kit::Pixels::MAX) + h_resizable("stage_split") + .child( + resizable_panel() + .size_range(px(size::PAGE)..gpui_kit::Pixels::MAX) + .child(div().size_full().flex().flex_col().child(grid)), + ) + .child( + resizable_panel() + .size(px(size::MARGIN_CHAT)) + .size_range(px(size::MARGIN)..px(size::MARGIN * 2.)) .fixed() .child( - members - .size_full() - .on_drag(SideSwap, |_, _, _, cx| cx.new(|_| SideSwap)), - ); - let swap = entity.clone(); - let hover = palette.tokens.hov(); - let chat = resizable_panel() - .size_range(px(size::THUMB * 2.)..gpui_kit::Pixels::MAX) - .child( - chat() - .drag_over::(move |style, _, _, _| { - style.bg(hover) - }) - .on_drop(move |_: &SideSwap, _, cx| { - swap.update(cx, |yumush, cx| { - yumush.chat.chat_on_top = !yumush.chat.chat_on_top; - cx.notify(); - }) - }), - ); - if self.chat.chat_on_top { - v_resizable("side_split_chat_top") - .child(chat) - .child(members) - } else { - v_resizable("side_split").child(members).child(chat) - } - }), + v_resizable("side_split") + .child( + resizable_panel() + .size(px(size::THUMB * 2.)) + .size_range( + px(size::ROW * 2.)..gpui_kit::Pixels::MAX, + ) + .fixed() + .child(members.size_full()), + ) + .child( + resizable_panel() + .size_range( + px(size::THUMB * 2.)..gpui_kit::Pixels::MAX, + ) + .child(chat()), + ), + ), + ), ) .into_any_element(), (viewer, grid, members) => div() @@ -3783,11 +3771,3 @@ fn stage_button( }) .child(super::parts::small_icon(icon)) } - -struct SideSwap; - -impl gpui_kit::Render for SideSwap { - fn render(&mut self, _: &mut Window, _: &mut Context) -> impl IntoElement { - div() - } -}