# gpui: Fix bug on \`on_hover\` callbacks \(\#46371\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f18b288fdf06d2b0d66bb4832bb0d9897dc827ba

Requested commit: f18b288fdf06d2b0d66bb4832bb0d9897dc827ba

Commit: f18b288fdf06d2b0d66bb4832bb0d9897dc827ba

Tree: 557bb1c1852d0913def031dc1681602eeaf0eea4

Author: Danilo Leal

Committer: GitHub

## Message

```
gpui: Fix bug on `on_hover` callbacks (#46371)

Tackling this as I noticed a bug in the agent panel where the button to
delete a thread, which appeared only on hover, stopped showing up. PRs
#43324 and #45437 fixed stuff in applying hover styles through
`.hover()` but broke the `.on_hover()` callback. Problem was that both
methods were sharing the same `element_state.hover_state` but running at
different phases. The solution here was to add a new independent state
field for the hover listener (`hover_listener_state`) while the hover
style method keeps using `hover_state`.

Release Notes:

- Agent: Fixed a bug where the button to delete a thread stopped showing
up.
```

## Parents

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

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