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
This commit is contained in:
1 parent
dee42503c7
commit
1823be5678
1 file changed
+13
@@ -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::<ListItemSummary>(());
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user