From 3e523d506c93aa276e129c48e5ee953478fbdddd Mon Sep 17 00:00:00 2001 From: Shoubhit Dash Date: Sun, 14 Jun 2026 15:11:01 +0200 Subject: [PATCH] fix(tui): match @ mention items by name, not description or uri (#32309) --- packages/tui/src/component/prompt/autocomplete.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/tui/src/component/prompt/autocomplete.tsx b/packages/tui/src/component/prompt/autocomplete.tsx index 19875c2d4..6fae556fc 100644 --- a/packages/tui/src/component/prompt/autocomplete.tsx +++ b/packages/tui/src/component/prompt/autocomplete.tsx @@ -362,7 +362,8 @@ export function Autocomplete(props: { const text = `${res.name} (${res.uri})` options.push({ display: Locale.truncateMiddle(text, width), - value: text, + // Match the name only; matching the URI caused unrelated fuzzy hits. + value: res.name, description: res.description, onSelect: () => { insertPart(res.name, { @@ -492,7 +493,8 @@ export function Autocomplete(props: { .go(removeLineRange(searchValue), nonFileOptions, { keys: [ (obj) => removeLineRange((obj.value ?? obj.display).trimEnd()), - "description", + // Match description for slash commands only; for "@" it surfaced unrelated items. + ...(store.visible === "/" ? ["description" as const] : []), (obj) => obj.aliases?.join(" ") ?? "", ], limit: 10,