Skip to content

Add more context when attaching context #4

@FallDownTheSystem

Description

@FallDownTheSystem

Is your feature request related to a problem? Please describe.

Chat attachments only include the element's tag and CSS classes. With utility-first CSS (Tailwind, etc.), this produces labels like:

button.inline-flex.cursor-pointer.items-center.justify-center.gap-2.whitespace-nowrap.rounded-md.text-sm.font-medium.transition-colors...

When I attached a button and asked "Which button is this?", the agent had to grep the codebase, read the Button component's variant definitions, and cross-reference styles to eventually figure out it was the "Hide Element" button on the page. That whole search shouldn't be necessary.

Describe the solution you'd like

Add more context to the attachment object:

  1. textContent — the element's visible text (e.g. "Hide Element"). This alone would solve most cases.
  2. path — DOM ancestry, like style changes already include (e.g. section > div > button).
  3. attributes — useful attributes like id, data-*, aria-label, type, href.

The class-based label is still useful, but text content + position in the tree would let the agent identify the element immediately instead of searching the codebase for it.

Describe alternatives you've considered

I think the source field in React dev mode already solves this for React, but it's not available for Vue?

Additional context

Style changes already have a path field with ancestor selectors. Chat attachments could follow the same pattern for consistency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions