Skip to content

feat(composer): pick a project file from an @ menu - #449

Merged
edenreich merged 3 commits into
mainfrom
feat/composer-file-menu
Nov 7, 2026
Merged

edenreich merged 3 commits into
mainfrom
feat/composer-file-menu

Conversation

@edenreich

@edenreich edenreich commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #440

Summary

Typing @ in the composer opens a menu of the project's files, the same menu the infer chat TUI offers. Picking one inserts @<path> , which the CLI's worker already expands into the file's content before the run (inference-gateway/cli#1717, infer v0.246.0).

Changes

  • backend/src/composer.rs (new): a list_files Tauri command. It sends {"type":"list_files","project_dir":...} for the chat's project dir through exchange() and returns the files reply. Any failure answers an empty list, and an infer that never answers the frame times out after 15 s in the background. DESKTOP_MOCK answers four fixed paths.
  • frontend/lib/mentions.ts (new): finds the @ token before the cursor (only at the start or after whitespace, so an email address opens nothing), filters the files (at most 50 rows), inserts the pick, and maps the menu keys.
  • frontend/components/Composer.tsx: the @ menu, with ArrowUp/ArrowDown, Enter and Escape like the slash menu. The file list is fetched once per project and cleared when the project changes. The textarea and the DOM contract are unchanged.
  • frontend/lib/tauri.ts: listFiles.
  • Tests: frontend/lib/mentions.test.ts (token detection, filtering, insertion, keys), Rust parser tests, and e2e/tests/composer-file-menu.yaml.

Verification

  • The pre-commit hook ran on every commit: prettier, bun run build, cargo fmt --check, cargo clippy -- -D warnings, cargo check, cargo test.
  • bun test 209 passed, cargo test -p desktop-e2e passes.
  • macOS e2e: composer-file-menu.yaml 7/7, plus history-recall.yaml, bash-mode.yaml and next-step-suggestion.yaml for the composer keys around it.

Notes for review

  • The e2e runs in DESKTOP_MOCK, so it shows the menu over the mock list. The frame matches the "Project files" section of inference-gateway/cli docs/browser-extension-protocol.md and is covered by the Rust tests.
  • The e2e driver has no bare Enter keypress, so the test picks a row with type, which presses Return. Arrow-key navigation is covered by bun test.
  • The slash and !! menus keep their own key handling. Moving them onto menuKey is a follow-up that would delete code.
  • The # issue menu ([FEATURE] Pick an open GitHub issue from a # menu in the composer #441) is stacked on this branch.

Docs ticket

inference-gateway/docs#1118

A list_files command sends the frame for the chat's project dir through
exchange() and answers the paths the worker offers for @<path> expansion.
It answers an empty list on any failure, so an infer without the frame
offers nothing, and fixed paths in DESKTOP_MOCK.
Typing @ in the composer opens a menu of the project's files, filtered by
the text after it. The arrows move, Enter inserts @<path> and Escape
closes, as in the slash menu. The list is fetched once per project.
Token detection, filtering and the menu keys live in lib/mentions.
@edenreich
edenreich marked this pull request as ready for review November 7, 2026 17:45
@edenreich
edenreich merged commit b3e45da into main Nov 7, 2026
1 check passed
@edenreich
edenreich deleted the feat/composer-file-menu branch November 7, 2026 18:31
@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.55.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-maintainer inference-gateway-maintainer Bot added the released Shipped in a release label Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Pick a project file from an @ menu in the composer

1 participant