diff --git a/crates/collab_ui/src/collab_panel/channel_modal.rs b/crates/collab_ui/src/collab_panel/channel_modal.rs index 7ce830b22f87cbecd6ff193319f96d88c58527ac..09be3798a6037bc2c9acb18c47acaac0a9f044d5 100644 --- a/crates/collab_ui/src/collab_panel/channel_modal.rs +++ b/crates/collab_ui/src/collab_panel/channel_modal.rs @@ -534,7 +534,7 @@ impl ChannelModalDelegate { this.selected_index = this .selected_index - .min(this.matching_member_indices.len() - 1); + .min(this.matching_member_indices.len().saturating_sub(1)); cx.focus_self(); cx.notify(); diff --git a/crates/collab_ui/src/face_pile.rs b/crates/collab_ui/src/face_pile.rs index 30fcb9750678b24ecb949341d9209e6489ff21e4..b6047614888e4bbe59d9860b8831108e3822e239 100644 --- a/crates/collab_ui/src/face_pile.rs +++ b/crates/collab_ui/src/face_pile.rs @@ -37,12 +37,18 @@ impl Element for FacePile { debug_assert!(constraint.max_along(Axis::Horizontal) == f32::INFINITY); let mut width = 0.; + let mut max_height = 0.; for face in &mut self.faces { - width += face.layout(constraint, view, cx).x(); + let layout = face.layout(constraint, view, cx); + width += layout.x(); + max_height = f32::max(max_height, layout.y()); } width -= self.overlap * self.faces.len().saturating_sub(1) as f32; - (Vector2F::new(width, constraint.max.y()), ()) + ( + Vector2F::new(width, max_height.clamp(1., constraint.max.y())), + (), + ) } fn paint(