Repository navigation
fix(app): search for files on a bare @ in the composer menu - #298
Merged
Merged
Conversation
#289 reordered the @ menu's groups so files lead, but the resolver short-circuited an empty query to the fixed entries plus open tabs and never searched — so with no tabs open the menu held no files to order, which is what users saw. Search on every query. Also drop fff's worktree-root entry, which an empty query now surfaces as a leading bare '/' that names no file; the ripgrep fallback never emitted it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
#289 was my change, and it did not deliver what it claimed. It reordered the
@menu's groups so files rank ahead of agents and references — but on a bare@the menu contained no files to reorder:The resolver answered an empty query from the fixed entries (references, agents, MCP resources) plus open editor tabs, without ever calling
searchContextFiles. With no tabs open there were no files at all — exactly what the screenshot shows:@offering only@exploreand@general.This is the same empty-query gap #56 fixed for the TUI and the
codev runfooter. I ported that PR's ordering to the V2 composer and missed its fetch, so the reorder was invisible.Fix
Search on every query, empty included. Verified the backend already answers a bare query — the default fff-backed search returns its top-ranked entries for an empty needle:
Plus one thing that empty queries exposed: fff ranks the worktree root itself into an empty-query result, so
/— a mention naming no file — would have led every list. The ripgrep fallback never emits it, sofffLayernow drops it and both layers answer the same way. That fixes the TUI's bare@too.Verification
I did not want to hand you another "it should work now", so this one is verified in a real browser.
prompt-at-menu-files.spec.ts): drives Chromium, types@, asserts the empty query reaches the search backend and thatsrc/index.tsappears before the agents. Passes with the fix, fails without it (confirmed by reinstating the short-circuit and re-running).test-browser/prompt-at-menu.test.ts): the resolver searches on a bare@, and open tabs still lead without being listed twice. Also confirmed failing against the old behavior./find/file, plain string paths), not the v2/api/fs/findroute returningEntryobjects. My first mock returned entries and crashed the app withinput.startsWith is not a function. Corrected; no production code was involved.bun run test:unit690 pass,test:browser117 pass, typecheck clean inapp,core,session-ui; core search suite 7 pass.Mock-server change: an
agentsconfig field (defaulting to today's single primary agent) so a spec can supply subagents — the@menu hides primary agents, so the default list left nothing to rank files against.DIVERGENCES: the #289 row amended to record the empty-query fetch (its ordering claim alone was incomplete), plus a new row for the root-entry filter and the mock field. CHANGELOG entry under Desktop / Web UI.
🤖 Generated with Claude Code