From 56c130b1a4656ecbf46e47a630500fcc753cbaa0 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:03:28 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20saved=20accounts=20list?= =?UTF-8?q?=20is=20a=203-row=20scroll=20(find=20field=20past=203)=20on=20l?= =?UTF-8?q?ogin=20and=20the=20switcher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui/account_list.rs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/crates/client/src/gui/account_list.rs b/crates/client/src/gui/account_list.rs index 878b873..4aebb91 100644 --- a/crates/client/src/gui/account_list.rs +++ b/crates/client/src/gui/account_list.rs @@ -1,6 +1,7 @@ use gpui_kit::{ - AnyElement, App, Div, Entity, IntoElement, ParentElement, StatefulInteractiveElement, Styled, - assets::IconName, component::popover::PopoverState, div, px, + AnyElement, App, Div, Entity, InteractiveElement, IntoElement, ParentElement, + StatefulInteractiveElement, Styled, assets::IconName, component::popover::PopoverState, div, + px, }; use super::{ @@ -12,7 +13,7 @@ use super::{ use crate::accounts::Account; use crate::lang::w; -const CAP: usize = 5; +const SHOWN: f32 = 3.; pub(super) fn account_list( yumush: &Yumush, @@ -26,12 +27,11 @@ pub(super) fn account_list( if skip_active { accounts.retain(|account| Some(account.user_id) != yumush.accounts.active); } - let filtered = accounts.len() > CAP; + let filtered = accounts.len() > SHOWN as usize; let query = super::widget::search_text(&yumush.account_filter, cx); let rows: Vec = accounts .into_iter() .filter(|account| !filtered || account.username.to_lowercase().contains(query.as_str())) - .take(CAP) .map(|account| row(account, entity, popover.clone(), palette)) .collect(); @@ -40,7 +40,16 @@ pub(super) fn account_list( .flex_col() .gap(px(space::XXS)) .children(filtered.then(|| input_box(&yumush.account_filter, palette))) - .children(rows) + .child( + div() + .id("account_rows") + .max_h(px(SHOWN * size::CONTROL + (SHOWN - 1.) * space::XXS)) + .overflow_y_scroll() + .flex() + .flex_col() + .gap(px(space::XXS)) + .children(rows), + ) } fn row( @@ -57,6 +66,7 @@ fn row( format!("saved_{user_id}"), div() .h(px(size::CONTROL)) + .flex_none() .px(px(space::SM)) .flex() .items_center()