kilocode icon indicating copy to clipboard operation
kilocode copied to clipboard

[FEATURE]: VSCode, group context attachments as pills above the chat input (files, folders, and pasted links)

Open ehudc opened this issue 4 months ago • 9 comments

Feature hasn't been suggested before.

  • [x] I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem

When I add context to Kilo, it goes inline into the chat text. That bloats the input, mixes attachment metadata with what I'm actually typing, and gets worse the more context I add. Two specific pain points:

  1. Context files aren't grouped. Other tools keep attached files/folders as compact "pills" in a row above the input, visually separated from the prompt text. Kilo doesn't, so the input area gets noisy as soon as I attach a few things.
  2. Pasting a long external link dumps the whole URL into the input. When I'm investigating an issue I'll often paste a long web search / docs URL (query strings can be hundreds of chars). The full URL takes over the chat window instead of collapsing to something readable.

Both are the same underlying idea: context should be represented as pills either outside or inline to the prompt text, not as full content paths.

Image

What other tools do

  • Copilot in VSCode groups attached files as removable pills in a row above the input, with a + button to add more.
Image
  • Cursor does the same for folders, files, and pasted links — a long URL becomes a truncated pill (www.google.com/search?hl=en&…) instead of filling the window.
Image

Proposed behavior

  1. Pill row above the input. Render each attached file/folder/link as a compact pill in a dedicated row above the chat text area, each with an × to remove. Keep the prompt text area clean.
  2. + add-context button. A simple + (or paperclip) affordance above/beside the input to attach new context files, feeding into the same pill row — no need to type @-mentions inline if you don't want to.
  3. Truncate pasted links into pills. When a URL is pasted (especially long ones), collapse it into a truncated, hover-to-expand pill rather than inserting the full string into the prompt. The full URL is still sent as context; only the display is truncated.

Why

Pure QoL, but it compounds: cleaner input, easier to see/remove what context is attached, and long links stop hijacking the chat window during investigation work. It also brings Kilo to parity with the attachment UX people are used to from Copilot/Cursor.

ehudc avatar Aug 03 '26 20:08 ehudc

Hey, ill add a row above the prompt input that expands as context is attached and also show compact links, gonna post a pr very soon!

tazsq avatar Aug 05 '26 06:08 tazsq

Thanks @tazsq, if it's not too much trouble while you're implementing the request, I noticed one more pill type to suggest: Specific lines of a file.

You can see in Kilo today when you select a few lines and right-click to "Add to context" it places it directly in the chat window, another form of chat bloat.

Image Image

Compare this to other editors that add it as another pill to the rest

Image

Feasibility

This could be a small, localized change, however you're going to implement for the other changes, to deliver the selected range through pill-seeding path vs raw appendChatBoxMessage.

A quick investigation appears that there's some representation in the composer; "Add to Context" just doesn't route through it.

  1. The action builds its text from a single template — filePath:startLine-endLine followed by a fenced code block of the raw selection: ADD_TO_CONTEXT template.
  2. The kilo-code.new.addToContext command posts that whole string to the webview via appendChatBoxMessage: register-code-actions.ts.
  3. The composer's appendChatBoxMessage handler just concatenates that raw string into the textarea — no pill/mention seeding: PromptInput.tsx.

ehudc avatar Aug 05 '26 21:08 ehudc

No worries, let me know if more changes are needed, ill open a pr soon!

tazsq avatar Aug 07 '26 13:08 tazsq

All good, I linked another separate but related / same category but still different. Appreciate your time taking on this request!

ehudc avatar Aug 07 '26 15:08 ehudc

hey been working on this lately, just a suggestion i want - should the inline @ mentions or pasted links disappear from the prompt input box and appear only as pills? or both? im thinking that the add context button should open a file picker like the copilot one in vscode, let me know if that sounds good, this will take time though.

tazsq avatar Aug 09 '26 08:08 tazsq

I'm most familiar with Cursor's method, where they convert every reference into the same pill style with different "logos" prepending the pill (for folder, file (with logo for type like JS or Ruby etc but that's a bit fancy), link, etc). But yes your suggestion makes the most simple sense for the best quality of both worlds.

I think you can sort of see this in the screenshots above.

In my mind if you use a file picker then those get added on top. And if you @- reference in the chat box then it's just a styled pill inline without the long file path or full url.

ehudc avatar Aug 09 '26 10:08 ehudc

inline pills make sense but would be an overkill for now IG. I'll make a pr with the basic features first!

tazsq avatar Aug 11 '26 17:08 tazsq

Well I still think "inline @ mentions or pasted links" could be shortened for QoL UI, but thanks and will take a look when you get a branch open, I could try to review.

ehudc avatar Aug 11 '26 21:08 ehudc

To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please reopen it or create a fresh new one.

github-actions[bot] avatar Oct 11 '26 06:10 github-actions[bot]