# gpui: Fix list scroll events being reverted by pending scroll \(\#59002\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 7fd5ea4bf3d97826d96fb8e31426d18c459e8eb6

Requested commit: 7fd5ea4bf3d97826d96fb8e31426d18c459e8eb6

Commit: 7fd5ea4bf3d97826d96fb8e31426d18c459e8eb6

Tree: 0fe7ebdef8f07d707fea3543c69d412a9b69375b

Author: Anthony Eid

Committer: GitHub

## Message

```
gpui: Fix list scroll events being reverted by pending scroll (#59002)

This PR fixes some cases where scrolling is choppy due to a user
inputting a scroll event while a list state is going through a
remeasure. Currently, the list state would ignore the user's scroll and
fall back to the pending scroll position, this PR fixes this by rebasing
the pending scroll onto the user's new scroll position.

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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- agent_panel: Improve scroll smoothness while a response is streaming
```

## Parents

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

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