agent_ui: Auto-capture file context on paste#42982
agent_ui: Auto-capture file context on paste#42982bennetbo merged 9 commits intozed-industries:mainfrom
Conversation
|
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 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 |
|
It's ready! @danilo-leal @JosephTLyons |
bennetbo
left a comment
There was a problem hiding this comment.
Pushed a bunch of fixes & cleanup. Should be good to merge now, thank you!
Closes zed-industries#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>
Closes zed-industries#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>
|
Is it possible to allow users to paste raw strings if they choose? Context is not always needed, so making |
|
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! |
|
Yeah this is kinda dumb, specially considering we have the |
exactly, no idea why this feature would even exist, but introducing it to break existing behavior without an option to disable is just insane |
|
I can see why this feature is kinda cool, but it needs a way to bypass it and I'd be happy with 99% of the time I'm just copying a simple string like a function name (otherwise I'd use As a workaround I'm now copying the string, doing |
|
Hey everyone, I've asked the team to look at this PR again and take your feedback into consideration. Also want to drop a note that while the current deployment may not fit your workflow and that's clearly frustrating some of our users, let's stick with the actionable, honest feedback bits and leave the rest out of it. |
I would do it the exact opposite way. The normal behavior as always with Copy&Paste (Ctrl+V) and when pressing Ctrl+Shift+V you could use this feature - but only if it is activated in the settings. I struggled with this feature all day yesterday and I internally exploded every time I wanted to copy a database field. Please make this feature optional. I can't think of any reason why we need this feature. If I want to give the AI multiple lines, I tell it the function name or simply say 'line 20 to 150'. Additionally, there is the inline assistant that reacts to my marked code. But why lines numbers instead of content are pasted into the agent field is still a complete mystery to me after 2 days of intensive use. What is this feature good for? I find Zed absolutely fantastic, but with actions like this one or the removal of the @-icon when adding files a few months ago, you're really not making it easy for developers to continue using Zed daily. Why don't you make such fundamental interface changes optional? |
It's not (only) a question of user workflow preference. The issue with this change is that we now have no way anymore to copy raw text in the agent panel (the convoluted and horrible workaround of first copying the text in another software doesn't count). So while this PR doesn't add much value IMO (we could already do the same thing with selection) it breaks another basic feature. |
|
Hey all — we're working on a follow-up iteration linked above, but here goes the link again #45254. We'll make it so |
|
Thats awesome to hear @danilo-leal, thanks! Would this cmd-shift-v be remapable? Asking for the people that want paste to just be paste, and will use |
Follow up to #42982 Release Notes: - agent: Allow pasting code without formatting via ctrl/cmd-shift-v. - agent: Fixed an issue where pasting a single line of code would always insert an @mention
|
Yes, you'll be able to remap it normally the same way as any other action 👍 |
Follow up to #42982 Release Notes: - agent: Allow pasting code without formatting via ctrl/cmd-shift-v. - agent: Fixed an issue where pasting a single line of code would always insert an @mention
Follow up to #42982 Release Notes: - agent: Allow pasting code without formatting via ctrl/cmd-shift-v. - agent: Fixed an issue where pasting a single line of code would always insert an @mention
|
Yet another workaround for the Mac until this is live: |
|
We just released new stable/preview versions, in which we adjusted this:
If you'd still like to opt-out of inserting creases for multiline texts, you can rebind cmd/ctrl-v like this: {
"context": "MessageEditor > Editor",
"bindings": {
"cmd-v": "agent::PasteRaw",
}
} |
|
@bennetbo why the default keymap file has I also added |
|
@bennetbo Thanks for getting an update out so quickly. I think the new default behaviour works well. |
Follow up to #42982 Release Notes: - agent: Allow pasting code without formatting via ctrl/cmd-shift-v. - agent: Fixed an issue where pasting a single line of code would always insert an @mention
…tries#45254) Follow up to zed-industries#42982 Release Notes: - agent: Allow pasting code without formatting via ctrl/cmd-shift-v. - agent: Fixed an issue where pasting a single line of code would always insert an @mention
…tries#45254) Follow up to zed-industries#42982 Release Notes: - agent: Allow pasting code without formatting via ctrl/cmd-shift-v. - agent: Fixed an issue where pasting a single line of code would always insert an @mention
…tries#45254) Follow up to zed-industries#42982 Release Notes: - agent: Allow pasting code without formatting via ctrl/cmd-shift-v. - agent: Fixed an issue where pasting a single line of code would always insert an @mention
Closes #42972
Screen.Recording.2025-11-18.at.18.12.20.mov
Release Notes: