Skip to content

fix(vscode): move "Browse files..." to end of @-mention dropdown#12183

Open
AmariahAK wants to merge 1 commit into
Kilo-Org:mainfrom
AmariahAK:main
Open

fix(vscode): move "Browse files..." to end of @-mention dropdown#12183
AmariahAK wants to merge 1 commit into
Kilo-Org:mainfrom
AmariahAK:main

Conversation

@AmariahAK

Copy link
Copy Markdown

Fixes #12182

Issue

When using @-mention in the VS Code prompt, the "Browse files..." option was always the default selection instead of the closest matching file. Pressing Enter would open the native file picker rather than inserting the matched file.

Context

This regression was introduced in v7.4.7 alongside the "Browse files..." feature. The FILE_PICKER_RESULT entry was placed before the actual file matches in the results array, so it occupied index 0 and became the default selection.

Implementation

One-line swap in buildMentionResults — moved FILE_PICKER_RESULT from before ...results to after. Actual file matches now sit at index 0, making them the default selection. "Browse files..." remains always available at the bottom of the dropdown list.
This approach was chosen over alternatives:

  • Changing mentionIndex to start at 1 — fragile when terminal/git-changes entries are also present
  • Filtering out the file picker — reduces discoverability of a useful feature
    Files changed:
  • packages/kilo-vscode/webview-ui/src/hooks/file-mention-utils.ts — swapped order
  • packages/kilo-vscode/tests/unit/file-mention-utils.test.ts — updated 7 assertions to match
  • .changeset/file-picker-default-selection.md — patch changeset for kilo-code

How to Test

Manual/local verification

  • Launch the extension: bun run extension from repo root
  • In the prompt input, type @ followed by a partial filename
  • Press Enter — the closest matching file is selected, not the file picker
  • Arrow down still reaches "Browse files..." at the bottom of the list

Reviewer test steps

  1. cd packages/kilo-vscode
  2. bun test ./tests/unit/file-mention-utils.test.ts — 67 pass, 0 fail
  3. bun run typecheck — clean
  4. Optional: bun run extension and test @-mention manually as described above

Checklist

  • Issue linked above
  • Tests/verification described
  • Screenshots/video N/A — purely behavioral fix (no visual UI change)
  • Changeset added
  • I personally reviewed the diff and can explain the changes

When using @-mention in the VS Code prompt, the "Browse files..."
option was always the default selection instead of the closest matching
file. This happened because FILE_PICKER_RESULT was placed before the
actual file results in buildMentionResults.

Move FILE_PICKER_RESULT after the file results so the closest matching
file is the default selection. "Browse files..." remains always
available at the bottom of the list.

Fixes Kilo-Org#12182

Co-authored-by: atlarix-agent <agent@atlarix.dev>
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

@atlarix-agent is attempting to deploy a commit to the Kilo Code Team on Vercel.

A member of the Team first needs to authorize it.

@kilo-code-bot

kilo-code-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .changeset/file-picker-default-selection.md
  • packages/kilo-vscode/tests/unit/file-mention-utils.test.ts
  • packages/kilo-vscode/webview-ui/src/hooks/file-mention-utils.ts

Reviewed by gpt-5.6-sol · Input: 53.8K · Output: 4.9K · Cached: 253.2K

Review guidance: REVIEW.md from base branch main

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.

The new "Browse files..." option should not be the default selection

2 participants