# agent_ui: Auto-capture file context on paste \(\#42982\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f6a66301718f7fa745d96fab7a0a7253e5f2a00c

Requested commit: f6a66301718f7fa745d96fab7a0a7253e5f2a00c

Commit: f6a66301718f7fa745d96fab7a0a7253e5f2a00c

Tree: 8781683e05dfaac5b6569fa12cb744e151a5809c

Author: ozzy

Committer: GitHub

## Message

```
agent_ui: Auto-capture file context on paste (#42982)

Closes #42972


https://github.com/user-attachments/assets/98f2d3dc-5682-4670-b636-fa8ea2495c69

Release Notes:

- Added automatic file context detection when pasting code into the AI
agent panel. Pasted code now displays as collapsible badges showing the
file path and line numbers (e.g., "app/layout.tsx (18-25)").

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
```

## Parents

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

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