Skip to content

feat: add @-mention file attachment in agent chat composer (Refs: beans-uk55)#172

Merged
hmans merged 3 commits intomainfrom
beans/faithful-lark-kgm6
Mar 21, 2026
Merged

feat: add @-mention file attachment in agent chat composer (Refs: beans-uk55)#172
hmans merged 3 commits intomainfrom
beans/faithful-lark-kgm6

Conversation

@hmans
Copy link
Copy Markdown
Owner

@hmans hmans commented Mar 21, 2026

Summary

  • Add @-mention file attachment in the agent chat composer — type @ + 2 characters to fuzzy-search project files (via git ls-files), select to insert an inline pill
  • File mentions render as styled inline pills both in the TipTap composer and in the message history (using {{file:path}} markers)
  • Attachments are passed to the backend separately and injected as context hints in the Claude stdin message only (not stored in conversation text)
  • Add listFiles GraphQL query with case-insensitive multi-term substring matching
  • Add attachments field to AgentMessage for persistence and display
  • File list is fetched once per @ session, then filtered client-side for instant results

Test plan

  • All 60 e2e tests pass
  • All Go unit tests pass (including new TestListFiles suite)
  • Frontend builds with zero warnings
  • Manual: type @ in agent chat, verify dropdown appears after 2 chars
  • Manual: select a file, verify inline pill appears in editor
  • Manual: send message, verify pill appears inline at correct position in message history
  • Manual: verify keyboard navigation (arrows, Enter/Tab to select, Escape to close)
  • Manual: verify scroll-into-view when navigating long file lists

…ns-uk55)

- Add `listFiles` GraphQL query with case-insensitive substring matching
  across all git-tracked files (space-separated terms, all must match)
- Extend `sendAgentMessage` mutation with optional `attachments` parameter;
  attached paths are prepended as context hints in the user message
- Add @-detection in composer textarea with debounced autocomplete dropdown
- Keyboard navigation (arrows, Enter/Tab to select, Escape to close) with
  scroll-into-view for selected items
- Selected files shown as removable pills below the textarea
- Add `FileEntry` type, `FileAttachmentInput` input, and `ListFiles` query
  to GraphQL schema with codegen
- Add unit tests for ListFiles resolver
@hmans hmans force-pushed the beans/faithful-lark-kgm6 branch from 6415b77 to 1ac5fe2 Compare March 21, 2026 13:34
hmans added 2 commits March 21, 2026 15:41
…efs: beans-uk55)

- Replace prefix-only directory browsing with fuzzy substring matching
  across all git-tracked files (space-separated terms, case-insensitive)
- Add FileMention TipTap node extension for inline atom pills in the
  composer (non-editable, deletable via backspace)
- Serialize mentions as {{file:path}} markers in message text so they
  render inline at the correct position in the chat history
- Add attachments field to Message struct, JSONL persistence, and
  GraphQL AgentMessage type for structured attachment data
- Move context prefix injection from resolver to agent manager so the
  stored/displayed message stays clean (prefix only goes to Claude stdin)
- Share .file-mention-pill CSS class between composer and message display
- Add scroll-into-view on keyboard navigation in autocomplete dropdown
- Use smaller font (text-xs) for dropdown items and pills
…s: beans-uk55)

- Update listFiles query description to reflect substring matching behavior
- Remove isDir from FileEntry type (always false after directory browsing removal)
- Remove isDir references from frontend composer and operations
@hmans hmans merged commit db0ab13 into main Mar 21, 2026
1 check passed
@hmans hmans deleted the beans/faithful-lark-kgm6 branch March 21, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant