From 51367a5af0d47e831713855918f7be93ce0bff41 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 23:56:07 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20grid=20view=20keeps=20the?= =?UTF-8?q?=20chat:=20right=20column=20holds=20members=20(capped=2040%,=20?= =?UTF-8?q?own=20scroll)=20over=20messages=20and=20composer,=20widened=20t?= =?UTF-8?q?o=20size::MARGIN=5FCHAT?= 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/chat.rs | 96 +++++++++++++++++++++++--------- 2 files changed, 70 insertions(+), 27 deletions(-) diff --git a/crates/client/design/tokens.toml b/crates/client/design/tokens.toml index 0153778..8a26d0a 100644 --- a/crates/client/design/tokens.toml +++ b/crates/client/design/tokens.toml @@ -70,6 +70,7 @@ avatar_lg = 64 thumb = 120 sidebar = 230 margin = 280 +margin_chat = 360 index = 200 talk = 300 popover = 300 diff --git a/crates/client/src/gui/chat.rs b/crates/client/src/gui/chat.rs index 7020a51..af2e99c 100644 --- a/crates/client/src/gui/chat.rs +++ b/crates/client/src/gui/chat.rs @@ -1414,29 +1414,76 @@ impl Yumush { panel.child(self.community_settings_page(entity, palette, cx)) } View::Chat => match self.chat.selected_community_id { - Some(_) => panel - .child(self.header(entity, themed)) - .children(self.stage_strip(entity, themed)) - .children(self.unread_bar(entity, themed)) - .children(self.poll_banner(entity, themed)) - .child( - div() - .flex_1() - .min_h_0() - .flex() - .child(div().flex_1().min_w_0().flex().flex_col().map(|panel| { - match self.inline_viewer(entity, themed) { - Some(viewer) => panel.child(viewer), - None => match self.stage_grid(entity, themed, cx) { - Some(grid) => panel.child(grid), - None => panel - .child(self.message_area(entity, themed)) - .child(self.composer(entity, themed, cx)), + Some(_) => { + let viewer = self.inline_viewer(entity, themed); + let grid = viewer + .is_none() + .then(|| self.stage_grid(entity, themed, cx)) + .flatten(); + let side_chat = grid.is_some(); + panel + .child(self.header(entity, themed)) + .children(self.stage_strip(entity, themed)) + .children(self.unread_bar(entity, themed)) + .children(self.poll_banner(entity, themed)) + .child( + div() + .flex_1() + .min_h_0() + .flex() + .child(div().flex_1().min_w_0().flex().flex_col().map( + |panel| { + match (viewer, grid) { + (Some(viewer), _) => panel.child(viewer), + (None, Some(grid)) => panel.child(grid), + (None, None) => panel + .child(self.message_area(entity, themed)) + .child(self.composer(entity, themed, cx)), + } }, - } - })) - .children(members_column(entity, self, themed)), - ), + )) + .children(members_column(entity, self, themed).map( + |members| { + div() + .w(px(if side_chat { + size::MARGIN_CHAT + } else { + size::MARGIN + })) + .flex_none() + .h_full() + .flex() + .flex_col() + .border_l_1() + .border_color(palette.border) + .child(if side_chat { + members + .flex_none() + .max_h(gpui_kit::relative(0.4)) + } else { + members.flex_1().min_h_0() + }) + .when(side_chat, |column| { + column.child( + div() + .flex_1() + .min_h_0() + .flex() + .flex_col() + .border_t_1() + .border_color(palette.border) + .child( + self.message_area(entity, themed), + ) + .child( + self.composer(entity, themed, cx), + ), + ) + }) + }, + )), + ) + } None => panel.child(empty_state(palette)), }, }) @@ -3191,17 +3238,12 @@ fn members_column( Some( div() .id("members_column") - .w(px(size::MARGIN)) - .flex_none() - .h_full() .overflow_y_scroll() .px(px(space::SM)) .py(px(space::MD)) .flex() .flex_col() .gap(px(space::LG)) - .border_l_1() - .border_color(palette.border) .child(room_head(yumush, palette)) .children(call) .children(section(