Skip to content

Typing a chat context with # should automatically add it to the context bar #243222

Closed

Description

When I reference context via the prompt, automatically add it to the 📎 bar:

Image

If I remove it from there, it could remove it from the prompt, or alternatively we do not allow to remove these.

//cc Isidor Nikolic (@isidorn) Benjamin Christopher Simmonds (@benibenj)

Activity

  1. added
    ux
    on Mar 11, 2025
  2. benibenj commented on Mar 11, 2025

    @benibenj
    Contributor

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

  3. roblourens commented on Mar 12, 2025

    @roblourens
    Member

    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

  4. bpasero commented on Mar 12, 2025

    @bpasero
    ContributorAuthor

    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)

  5. hawkticehurst commented on Mar 12, 2025

    @hawkticehurst
    Member

    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.

  6. hawkticehurst commented on Mar 12, 2025

    @hawkticehurst
    Member

    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.

    Image

    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.

  7. roblourens commented on Mar 12, 2025

    @roblourens
    Member

    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.

  8. hawkticehurst commented on Mar 12, 2025

    @hawkticehurst
    Member

    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.

  9. bpasero commented on Mar 13, 2025

    @bpasero
    ContributorAuthor

    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.

  10. hawkticehurst commented on Mar 13, 2025

    @hawkticehurst
    Member

    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.

  11. added
    feature-request
    on Apr 9, 2025
  12. jrieken commented on Apr 15, 2025

    @jrieken
    Contributor

    This is now done

  13. added
    on-release-notes
    on May 5, 2025
  14. locked and limited conversation to collaborators on May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

chat-inputfeature-requeston-release-noteson-testplanux

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions