From bf79e32622fddd2a6fc126610b70903be3e35f59 Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Tue, 31 Mar 2026 11:01:05 -0700 Subject: [PATCH] Scroll to bottom when reloading ACP agent threads (#52843) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When reopening an ACP agent thread (e.g. after restarting Zed) that has no saved scroll position, the conversation now starts scrolled to the bottom so the user sees the latest messages instead of starting at the top. Uses `set_follow_tail(true)` rather than a one-shot `scroll_to_end()` so the scroll position is re-anchored on every layout pass — ensuring it lands at the true bottom even when list items haven't been measured yet. The follow-tail mode automatically disengages as soon as the user scrolls up. Release Notes: - Fixed agent threads starting scrolled to the top when reopened after restarting Zed. --- crates/agent_ui/src/conversation_view.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/agent_ui/src/conversation_view.rs b/crates/agent_ui/src/conversation_view.rs index c13b6d29f92c273b36b948c90f5f5c6f1b659970..2231f421bc2af0d8038c002a72c226f551f243cc 100644 --- a/crates/agent_ui/src/conversation_view.rs +++ b/crates/agent_ui/src/conversation_view.rs @@ -840,6 +840,8 @@ impl ConversationView { if let Some(scroll_position) = thread.read(cx).ui_scroll_position() { list_state.scroll_to(scroll_position); + } else { + list_state.set_follow_tail(true); } AgentDiff::set_active_thread(&self.workspace, thread.clone(), window, cx);