# gpui: Add item_is_above_viewport and item_is_below_viewport APIs to ListState \(\#58061\) · gitcafe/zed

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

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

Visibility: public

Requested revision: a1d2ef651426ebc66f558727694b460e823042dc

Requested commit: a1d2ef651426ebc66f558727694b460e823042dc

Commit: a1d2ef651426ebc66f558727694b460e823042dc

Tree: f55658b24d45c36447b6ec5c1258d770396ea045

Author: Smit Barmase

Committer: GitHub

## Message

```
gpui: Add item_is_above_viewport and item_is_below_viewport APIs to ListState (#58061)

In prep for handling the above-viewport case in
https://github.com/zed-industries/zed/pull/57632, which currently only
handles below case.

This PR adds `ListState::item_is_above_viewport` and
`ListState::item_is_below_viewport` methods, which report whether a
given list item is entirely outside the current viewport. Both return
`None` when the list has not measured enough layout to answer.

Release Notes:

- N/A
```

## Parents

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

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