You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Typing a chat context with # should automatically add it to the context bar #243222
Another idea could be to hide the remove action (x) when an attachment was added sue to a reference and instead show a reference action which when clicked removes the reference from the prompt and then shows the remove attachment action (x).
This has been debated and personally I don't like duplicating a reference between the input and those pills. It's redundant and how you keep them in sync seems confusing
Oh lol I've actually already opened an issue on this exact topic.
I feel very strongly that context added via # command should be reflected in the context bar above.
Currently, the mismatch gives the impression that these are two different types of context attachments when they are in fact the same. Ensuring context is reflected in both places would add meaningful clarity/consistency to the conceptual model of attaching files/context.
Open Q: Should the reflection of context attachment go one way or both ways?
When I opened that issue I was thinking this "reflection" of context should only go one way where the "source of truth" is fundamentally the context bar.
Attaching context via # commands is rendered as both the inline blue pill and as a file attachment in the context bar, but when context is attached via the context bar it is not rendered inline.
Since then, I had a meeting with Isidor Nikolic (@isidorn) where he briefly mentioned the problem of prompts (and specifically prompt context) not being "portable." If you attach context via the context bar, copy your prompt, and enter it in a new chat session you must manually re-add the context.
If context "reflection" went both ways it would solve that portability problem because context would always be inserted inline.
Okay thought about it a bit more and I have a slightly adjusted opinion.
Inline context attachments should never be visually rendered inline. It should still be added inline, but should just be visually hidden.
Instead, the visual representation of attached context should always be rendered in the context bar.
Why?
As I mentioned above if we reflect context both ways, this solves the problem of prompt/prompt context portability.
But rendering all of your context inline would quickly become an issue (i.e. imagine 20+ pieces of context rendered inline). It would make prompts hard to parse/read and continue to add to a visually dense area of UI that we've actively been trying to simplify.
I think it's still very valuable to have the context reflected in both places, but what if we just didn't visually render the inline context? What if we just silently appended context to prompt text whenever it's copied? On the other end of this UX flow, any inline context pasted into the chat box would just be automatically rendered in the context bar.
This would be the best version of a UX for attaching context imo. The context bar is the definitive source of truth, it continues to simplify the UI, and massively simplifies the mental model of how/where context is attached/lives.
*Note: For the purposes of implementation, inline prompt context doesn't have to literally be visually hidden. You could just rely on whatever data structure(s) exists that keeps track of context and only when the prompt text is copied do you append inline versions of the context to the prompt text.
One nice thing about having the context in the actual prompt is that you can use it in a sentence. For example, copy the example from #file:abc.ts and apply it to #file:xyz.ts. Do people often use this capability, I don't know, but it works.
One nice thing about having the context in the actual prompt is that you can use it in a sentence. For example, copy the example from #file:abc.ts and apply it to #file:xyz.ts. Do people often use this capability, I don't know, but it works.
Ooh thank you for calling that one out! Regardless of how many people do this, should 100% amend my suggestion to handle that kind of edge case cause automatically removing files/context written into the middle of a sentence would be a proper bug as far as I'm concerned.
Initial thoughts:
We could re-render instances of #file:{file-name} as just plain text {file-name}
Pros: Fixes this bug and retains context bar as visual source of truth
Cons: What about the copy-paste UX/implementation? Does this solution mean we have to parse the prompt, match file names to stored context, and re-insert #file: to the copied text? Ew...
Go back to a UX/UI where context is rendered inline as a blue pill (and of course still rendered in context bar)
Pros: Fixes this bug and avoids copy-paste issue of potentially parsing, matching, and re-inserting #file:
Cons: What to do about context/files that are added via the context bar? I don't think we should reflect them in the text field (i.e. avoid cluttered UI), but now we're right back to the spot where there's a mismatch between what's rendered in text field vs context bar (although now in the reverse direction)
Genuinely not sure what the correct trade off is here. I'll think about it more tonight, let others respond with thoughts, and circle back tomorrow.
When I talked with Isi about this, we felt that the #... text should NOT be removed from the prompt, esp. to allow writing prompts such as copy the example from #file:abc.ts and apply it to #file:xyz.ts. In addition, a context spelled out in the prompt could not be removed from the context bar above, since its explicitly spelled out in the prompt.
When I talked with Isi about this, we felt that the #... text should NOT be removed from the prompt
Yep, I can get behind the rationale for not removing #.
Also per your comment in the other thread, I agree, let's bring this to UX Sync next week. I can take on the work of prepping/mocking up the various options.
Activity
benibenj commentedon Mar 11, 2025
Another idea could be to hide the remove action (
x) when an attachment was added sue to a reference and instead show a reference action which when clicked removes the reference from the prompt and then shows the remove attachment action (x).roblourens commentedon Mar 12, 2025
This has been debated and personally I don't like duplicating a reference between the input and those pills. It's redundant and how you keep them in sync seems confusing
bpasero commentedon Mar 12, 2025
This seems controversial at least, so I would suggest a UX discussion and some more guidance.
I find it confusing that as a user there are 2 ways how to add context to the prompt that are represented differently.
//cc Kaitlin Brooks (@kkbrooks) Hawk Ticehurst (@hawkticehurst)
hawkticehurst commentedon Mar 12, 2025
Oh lol I've actually already opened an issue on this exact topic.
I feel very strongly that context added via
#command should be reflected in the context bar above.Currently, the mismatch gives the impression that these are two different types of context attachments when they are in fact the same. Ensuring context is reflected in both places would add meaningful clarity/consistency to the conceptual model of attaching files/context.
Open Q: Should the reflection of context attachment go one way or both ways?
When I opened that issue I was thinking this "reflection" of context should only go one way where the "source of truth" is fundamentally the context bar.
Attaching context via
#commands is rendered as both the inline blue pill and as a file attachment in the context bar, but when context is attached via the context bar it is not rendered inline.Since then, I had a meeting with Isidor Nikolic (@isidorn) where he briefly mentioned the problem of prompts (and specifically prompt context) not being "portable." If you attach context via the context bar, copy your prompt, and enter it in a new chat session you must manually re-add the context.
If context "reflection" went both ways it would solve that portability problem because context would always be inserted inline.
hawkticehurst commentedon Mar 12, 2025
Okay thought about it a bit more and I have a slightly adjusted opinion.
Inline context attachments should never be visually rendered inline. It should still be added inline, but should just be visually hidden.
Instead, the visual representation of attached context should always be rendered in the context bar.
Why?
As I mentioned above if we reflect context both ways, this solves the problem of prompt/prompt context portability.
But rendering all of your context inline would quickly become an issue (i.e. imagine 20+ pieces of context rendered inline). It would make prompts hard to parse/read and continue to add to a visually dense area of UI that we've actively been trying to simplify.
I think it's still very valuable to have the context reflected in both places, but what if we just didn't visually render the inline context? What if we just silently appended context to prompt text whenever it's copied? On the other end of this UX flow, any inline context pasted into the chat box would just be automatically rendered in the context bar.
This would be the best version of a UX for attaching context imo. The context bar is the definitive source of truth, it continues to simplify the UI, and massively simplifies the mental model of how/where context is attached/lives.
*Note: For the purposes of implementation, inline prompt context doesn't have to literally be visually hidden. You could just rely on whatever data structure(s) exists that keeps track of context and only when the prompt text is copied do you append inline versions of the context to the prompt text.
roblourens commentedon Mar 12, 2025
One nice thing about having the context in the actual prompt is that you can use it in a sentence. For example,
copy the example from #file:abc.ts and apply it to #file:xyz.ts. Do people often use this capability, I don't know, but it works.hawkticehurst commentedon Mar 12, 2025
Ooh thank you for calling that one out! Regardless of how many people do this, should 100% amend my suggestion to handle that kind of edge case cause automatically removing files/context written into the middle of a sentence would be a proper bug as far as I'm concerned.
Initial thoughts:
#file:{file-name}as just plain text{file-name}#file:to the copied text? Ew...#file:Genuinely not sure what the correct trade off is here. I'll think about it more tonight, let others respond with thoughts, and circle back tomorrow.
bpasero commentedon Mar 13, 2025
When I talked with Isi about this, we felt that the
#...text should NOT be removed from the prompt, esp. to allow writing prompts such ascopy the example from #file:abc.ts and apply it to #file:xyz.ts. In addition, a context spelled out in the prompt could not be removed from the context bar above, since its explicitly spelled out in the prompt.hawkticehurst commentedon Mar 13, 2025
Yep, I can get behind the rationale for not removing
#.Also per your comment in the other thread, I agree, let's bring this to UX Sync next week. I can take on the work of prepping/mocking up the various options.
jrieken commentedon Apr 15, 2025
This is now done