diff --git a/crates/agent/src/active_thread.rs b/crates/agent/src/active_thread.rs index 737822420f..11d48a2c3f 100644 --- a/crates/agent/src/active_thread.rs +++ b/crates/agent/src/active_thread.rs @@ -1014,6 +1014,7 @@ impl ActiveThread { self.push_message(message_id, &message_segments, window, cx); } + self.scroll_to_bottom(cx); self.save_thread(cx); cx.notify(); } @@ -1027,6 +1028,7 @@ impl ActiveThread { self.edited_message(message_id, &message_segments, window, cx); } + self.scroll_to_bottom(cx); self.save_thread(cx); cx.notify(); } @@ -3408,6 +3410,11 @@ impl ActiveThread { .or_insert(true); *is_expanded = !*is_expanded; } + + pub fn scroll_to_bottom(&mut self, cx: &mut Context) { + self.list_state.reset(self.messages.len()); + cx.notify(); + } } pub enum ActiveThreadEvent {