Expand description
@-triggered fuzzy file picker for the composer (grok-build parity).
Detects @ at a word boundary in the input buffer, opens a fuzzy
file-search dropdown above the composer, and inserts the selected
path (optionally with a line range) back into the buffer as plain text.
Design (Option B from the plan): the input buffer stays a plain String.
@path:N-M references are inserted as text; the agent’s read tool
already parses path + line-range from text. No chip model, no forked
TextArea — the dropdown is the only new UI surface.
Structs§
- AtToken
- The parsed
@-reference at the cursor position, if any. Returned byparse_at_cursor— a pure function with no I/O, fully unit-testable. - File
Search Result - One fuzzy-matched file result.
- File
Search State - State for the active file-search dropdown. Stored in
RenderState.file_searchwhile the picker is open.
Constants§
- MAX_
RESULTS - Maximum number of results to show in the dropdown.
Functions§
- build_
index - Walk the workspace and build a file index. Respects
.gitignore,.git/info/exclude, and the global gitignore. Hidden files (dotfiles) are excluded by default and toggled on via the@!gesture. - insertion_
text - Build the text to insert into the buffer when the user accepts a result.
- open
- Open a new file-search state at the given
@offset, building the workspace index. Called from the input thread when@is first detected. - parse_
at_ cursor - Detect an
@-file-reference trigger at the cursor position. - search
- Fuzzy-filter
indexbyquery, returning ranked results.