From 1823be56781cfa9ec8d6e809ff6cf2987da6dfa0 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Mon, 6 Apr 2026 16:19:00 -0300 Subject: [PATCH] agent_ui: Fix "scroll to" buttons (#53232) Follow-up to https://github.com/zed-industries/zed/pull/53101 In the process of fixing the thread view's scroll experience, we for got to turn off the follow state tail for functions that power the scroll buttons in the agent panel. Release Notes: - N/A --- crates/gpui/src/elements/list.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/gpui/src/elements/list.rs b/crates/gpui/src/elements/list.rs index 5525f5c17d2ad33e1ce9696afded1cea5447020c..5a88d81c18db5e790b7bbed0fb9def23bc973e14 100644 --- a/crates/gpui/src/elements/list.rs +++ b/crates/gpui/src/elements/list.rs @@ -462,6 +462,13 @@ impl ListState { let current_offset = self.logical_scroll_top(); let state = &mut *self.0.borrow_mut(); + + if distance < px(0.) { + if let FollowState::Tail { is_following } = &mut state.follow_state { + *is_following = false; + } + } + let mut cursor = state.items.cursor::(()); cursor.seek(&Count(current_offset.item_ix), Bias::Right); @@ -536,6 +543,12 @@ impl ListState { scroll_top.offset_in_item = px(0.); } + if scroll_top.item_ix < item_count { + if let FollowState::Tail { is_following } = &mut state.follow_state { + *is_following = false; + } + } + state.logical_scroll_top = Some(scroll_top); }