# agent_ui: Fix delete icon event in history panel \(\#43796\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 8abf1d35be368ac257f1edf76d5f53f7a9c64b98

Requested commit: 8abf1d35be368ac257f1edf76d5f53f7a9c64b98

Commit: 8abf1d35be368ac257f1edf76d5f53f7a9c64b98

Tree: 273e927d09f4bb6fd0ba2537ce873afd7b6a9a83

Author: Aero

Committer: GitHub

## Message

```
agent_ui: Fix delete icon event in history panel (#43796)

Summary

Fixed the thread deletion issue by:

1. Click handler conflict between the trash icon and the main ListItem
2. Added `cx.stop_propagation()` to prevent the click event from
bubbling up to the parent ListItem's click handler
3. Followed the established `cx.stop_propagation()` pattern used
throughout the codebase

Now when you click the trash icon to delete a thread:
- ✅ The thread deletion happens immediately on the first click
- ✅ No race condition between deletion and activation
- ✅ No double-clicking required

The fix is minimal, follows established patterns, and addresses the
exact root cause of the issue.

- Stop event propagation in thread removal handler

Release Notes:

- agent: Improved delete thread action in the history view by preventing
it from also triggering the thread activation.
```

## Parents

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

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