# gpui: Fix follow_tail not re-engaging after scrollbar drag \(\#54570\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/2f445d405947542ddfe9121f0a0d8010afa40787)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 2f445d405947542ddfe9121f0a0d8010afa40787

Requested commit: 2f445d405947542ddfe9121f0a0d8010afa40787

Commit: 2f445d405947542ddfe9121f0a0d8010afa40787

Tree: d61ec0225c52e40f4bc32a55520c3b4479b3a04e

Author: Tim Vermeulen

Committer: GitHub

## Message

```
gpui: Fix follow_tail not re-engaging after scrollbar drag (#54570)

Fixes an inconsistency with the way scrolling interacts with the
`follow_tail` GPUI list feature:
- Scrolling normally sets `follow_state` to `FollowState::Tail {
is_following: false }`, so later scrolling to the bottom re-engages
`follow_tail`
- Scrolling by dragging the scrollbar previously set `follow_state` to
`FollowState::Normal`, preventing `follow_tail` from re-engaging after
scrolling to the bottom

As far as I can tell this behavior was unintentional, despite there
being a test that exercised this exact behavior that `follow_tail`
doesn't re-engage after dragging the scrollbar — my best guess is that
that test was derived from the bugged scrollbar handler logic, and not
based on any actual intent for scrollbar drags to prevent `follow_tail`
from re-engaging.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed agent panel auto-scroll not re-engaging after interacting with
the scrollbar

---------

Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
```

## Parents

- [0ab64d64148cb8a45152b59e83af670a21f56696](https://git.cafe/gitcafe/zed/commit/0ab64d64148cb8a45152b59e83af670a21f56696?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/2f445d405947542ddfe9121f0a0d8010afa40787?format=markdown)
