From 71407181c00f615df440a4e1ef12d376dd49d918 Mon Sep 17 00:00:00 2001 From: faumaray Date: Wed, 28 Oct 2026 10:42:01 +0300 Subject: [PATCH] voelin-gpui: the voice page's larger stage scrolls when its rows outgrow the page A channel of fifty people wraps into ten rows of large avatars, which pushed the call bar off the page (found with a test of 45 people: the bar was 600 pixels under the page). The people shrink to what the header and the call bar leave and scroll with the wheel; the smaller stage's row scrolls sideways (GPUI turns a vertical wheel into a sideways one for a container that scrolls only that way). Co-Authored-By: Claude Sonnet 5.5 --- crates/voelin-gpui/src/shell/voice.rs | 6 ++++- crates/voelin-gpui/src/view/voice_tests.rs | 29 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/crates/voelin-gpui/src/shell/voice.rs b/crates/voelin-gpui/src/shell/voice.rs index 1ac5ebf..868d479 100644 --- a/crates/voelin-gpui/src/shell/voice.rs +++ b/crates/voelin-gpui/src/shell/voice.rs @@ -616,7 +616,11 @@ impl Render for VoicePage { .id("voice-people") .debug_selector(|| "voice-people".into()) .w_full() - .flex_none() + // Rows taller than the page scroll; the header and the call bar keep + // their places. + .flex_shrink(1.0) + .min_h_0() + .overflow_y_scroll() .flex() .flex_row() .flex_wrap() diff --git a/crates/voelin-gpui/src/view/voice_tests.rs b/crates/voelin-gpui/src/view/voice_tests.rs index 5de8e3b..9928146 100644 --- a/crates/voelin-gpui/src/view/voice_tests.rs +++ b/crates/voelin-gpui/src/view/voice_tests.rs @@ -683,3 +683,32 @@ fn a_person_whose_sound_is_off_has_the_deafen_mark(cx: &mut TestAppContext) { frame(cx); assert!(at(cx, "voice-speaking-3").is_some() && at(cx, "voice-off-3").is_none()); } + +/// A channel with many people: the larger stage wraps them into rows and, when +/// the rows are taller than the page, scrolls them (the page's other parts stay +/// where they are: the header on top, the call bar under the people). +#[gpui::test] +fn many_people_scroll_and_the_call_bar_stays_on_the_page(cx: &mut TestAppContext) { + let (shell, cx) = on_the_voice_page(cx, Switches::default()); + shell + .events + .send(sample_presence!(p => { + for id in 100..140u16 { + let mut person = p.clients[&1].clone(); + person.id = id; + person.nickname = format!("Guest {id}"); + person.uid = Some(format!("guest-{id}")); + p.clients.insert(id, person); + } + })) + .unwrap(); + frame(cx); + assert_eq!(people(&shell, cx).len(), 45); + let page = at(cx, "voice-page").expect("the page"); + let bar = at(cx, "voice-callbar").expect("the call bar is still on the page"); + let stage = at(cx, "voice-people").expect("the people"); + assert!(bar.bottom() <= page.bottom(), "{bar:?} is inside {page:?}"); + assert!(stage.bottom() <= bar.top(), "the people end where the call bar begins"); + let header = at(cx, "voice-header").expect("the header"); + assert!(header.bottom() <= stage.top(), "the header stays on top"); +}