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 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-28 10:42:01 +03:00
1 parent 373805984c
commit 71407181c0
2 files changed
+34 -1

No files matched your search

+5 -1
View File
@@ -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()
@@ -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");
}