# agent_ui: Fix selection mentions from "Add to Agent Thread" not opening files \(\#61621\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 401a0c7e3dee885c20e61858a0eefe760e4ec7b3

Requested commit: 401a0c7e3dee885c20e61858a0eefe760e4ec7b3

Commit: 401a0c7e3dee885c20e61858a0eefe760e4ec7b3

Tree: 604e787703f44a8ba8403ae21dcf421b8689772d

Author: ᴀᴍᴛᴏᴀᴇʀ

Committer: GitHub

## Message

```
agent_ui: Fix selection mentions from "Add to Agent Thread" not opening files (#61621)

# Objective

Fixes #59333.

Selection mentions created with "Add to Agent Thread" could not be
clicked to open the referenced file, while selection mentions created by
pasting were navigable.

## Solution

The ready selection-mention crease did not receive its `MentionUri` or
`Workspace`, so `MentionCrease` could not install its click handler.
Pass the workspace through the action-completion callback and provide
both values to the shared crease renderer, enabling its existing
navigation behavior.

## Testing

I tested these changes locally.

## 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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

Before:


https://github.com/user-attachments/assets/8dd4a2d0-4b22-4fb3-8777-cf97b6436b91

After:


https://github.com/user-attachments/assets/cff1cdb3-804a-45d8-a9c5-fdd8b35b6f8f


---

Release Notes:

- Fixed selection mentions added with "Add to Agent Thread" not opening
their referenced files.
```

## Parents

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

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