zed icon indicating copy to clipboard operation
zed copied to clipboard

agent_ui: Auto-capture file context on paste

Open ddoemonn opened this issue 1 month ago • 3 comments

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)").

ddoemonn avatar Nov 18 '25 15:11 ddoemonn

Hey, thank you for the PR @ddoemonn. Would you be able to look at the failing tests? If you need help, someone on the pr review team should be sweeping through at some point, but not sure when.

JosephTLyons avatar Nov 20 '25 13:11 JosephTLyons

@JosephTLyons I'm so sorry for late response I was busy about git issues assigned to me in Zed.

I will look at failing tests as soon as possible

ddoemonn avatar Nov 21 '25 15:11 ddoemonn

It's ready! @danilo-leal @JosephTLyons

ddoemonn avatar Nov 22 '25 13:11 ddoemonn

Is it possible to allow users to paste raw strings if they choose? Context is not always needed, so making Ctrl+Shift+V / Cmd+Shift+V paste raw strings would be useful.

apcamargo avatar Dec 17 '25 14:12 apcamargo

How can I deactivate this feature again? I can no longer see what I copied into the agent field. For me, it's often just words, db-fields or short sentences, and I don't want it to display only lines 1-20 or something similar. Please let us toggle it on or off through the settings. This feature is disrupting my entire development process. Let users decide whether they want to activate it or not.

Addendum: This is the most idiotic feature I've seen here so far. I want to copy a field name, an attribute, a database field, or something similar into the agent input, and I only get a 'file.php (123:129)'. Please turn this off immediately!

admtech avatar Dec 17 '25 22:12 admtech

Yeah this is kinda dumb, specially considering we have the @Selection feature in the agent chat for this exact use case.

joaqo avatar Dec 18 '25 00:12 joaqo

Yeah this is kinda dumb, specially considering we have the @Selection feature in the agent chat for this exact use case.

exactly, no idea why this feature would even exist, but introducing it to break existing behavior without an option to disable is just insane

makscee avatar Dec 18 '25 07:12 makscee