Skip to content

Chat: @ in the composer completes file paths (#708, D279) - #732

Merged
contursofran merged 7 commits into
mainfrom
agent/708-path-autocomplete
Nov 11, 2026
Merged

contursofran merged 7 commits into
mainfrom
agent/708-path-autocomplete

Conversation

@contursofran

@contursofran contursofran commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Fixes #708

What changed

  • internal/app/chatview/suggest.go: the popup takes a query at the caret (QueryAt) for "/" and "@"; one popup, two sources (Slash, new Path PathSource). Lists are kept per terminal, and for "@" per typed folder. FilterPaths: paths with a part that starts with the text first, then paths that hold it, at most 50. An insert replaces only "@text" up to the caret; a folder goes in as "@dir/" and the popup stays open.
  • internal/app/chatview/composer.go: stores the caret as the field builds.
  • internal/review/tree.go: Repo.KnownFiles (git ls-files --cached --others --exclude-standard, sorted).
  • internal/app/chat.go: pathSource / listPaths read off the UI thread: the git files and their folders, without files deleted in the work tree, with a nested repo listed once; outside git, a plain read of the typed folder (Repo.Entries).
  • Docs: the Path popup section in docs/spec/ChatView.md, and D279.
  • The diff is ~510 lines; about half of that is tests.

Tests

  • Unit: TestQueryAtCaret, TestFilterPathsOrderAndCap, TestAtInsertsAFile, TestAtInsertsAFolderAndStaysOpen, TestInsertKeepsTheTextAfterTheCaret, TestAtWithNoMatchSaysSo, TestListPathsInGit, TestListPathsOutsideGitReadsTheTypedFolder, TestListPathsOfAnEmptyFolder (temp folders only).
  • e2e: go test -tags e2e -run TestChatPathPopup ./cmd/contr passes.
  • see.sh: new fixture chat-paths, Dark and Light checked by eye.

Pre-check

  1. Tests: each test failed with its change undone: prefix-first order and the cap (FilterPaths), no space after a folder (AtInsertsAFolder), text after the caret (InsertKeeps), TextNoPath (AtWithNoMatch), the "@" check (QueryAt), the non-git fallback (ListPathsOutside), deleted-file skip and the nested-repo dedupe (ListPathsInGit).
  2. Plan: every brief item is done.
  3. Contract: label "suggestions" is reused; the new text is "No files match"; D279.
  4. Up to date: main is merged in. No other open PR touches these files (Spawn: a Claude worker gets the PATH of the spawning process (#728, D282) #729 is spawn only).
  5. Diff: read; no debug output left.
  6. Coverage: every acceptance line of Chat: autocomplete file paths with @ in the composer #708 is done.
  7. Duties: suggestOpen became query, which handles "/" the same way (the slash tests pass).
  8. Evidence: the PNGs were taken after the last code commit.

@contursofran
contursofran marked this pull request as ready for review November 11, 2026 18:29
@contursofran
contursofran merged commit b299549 into main Nov 11, 2026
3 checks passed
@contursofran
contursofran deleted the agent/708-path-autocomplete branch November 11, 2026 18:29
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.

Chat: autocomplete file paths with @ in the composer

1 participant