Skip to content

Feature: @file completion with frecency ranking in the TUI #837

Description

@alecuba16

Summary

Add @file mention completion to the TUI prompt: typing @ triggers a file-path picker backed by a two-layer index (git ls-files + lazy ignored-directory scan), ranked by frecency, with file-chip-aware deletion.

Problem

Referencing a file in a prompt today means typing or pasting its path manually. There is no tab-completion or fuzzy picker for files from the prompt input, so users waste keystrokes and make typos on long paths.

Proposal

  • @ in the prompt opens a completion popup with workspace files.
  • Two-layer path index: git ls-files for tracked files + lazy scan of ignored directories (refreshed with an adaptive TTL based on workspace size).
  • Frecency ranking (frequency + recency) so recently/frequently used files surface first.
  • Search history cache to avoid re-indexing on every keystroke.
  • File-chip-aware deletion: backspace on a completed @file chip removes the whole chip, not one character.

Implementation

A working implementation is ready for review on the select_files branch (rebased onto latest master, 3104 insertions across 32 files, jcode-tui + jcode-app-core build, file_mention + char_bag + accept_completion tests pass).

@1jehuang would be great if you could take a look.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions