Skip to content

Commit 66eebe7

Browse files
nexxelndavidgut1982
authored andcommitted
fix(tui): match @ mention items by name, not description or uri (anomalyco#32309)
1 parent 01d637c commit 66eebe7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/tui/src/component/prompt/autocomplete.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ export function Autocomplete(props: {
362362
const text = `${res.name} (${res.uri})`
363363
options.push({
364364
display: Locale.truncateMiddle(text, width),
365-
value: text,
365+
// Match the name only; matching the URI caused unrelated fuzzy hits.
366+
value: res.name,
366367
description: res.description,
367368
onSelect: () => {
368369
insertPart(res.name, {
@@ -492,7 +493,8 @@ export function Autocomplete(props: {
492493
.go(removeLineRange(searchValue), nonFileOptions, {
493494
keys: [
494495
(obj) => removeLineRange((obj.value ?? obj.display).trimEnd()),
495-
"description",
496+
// Match description for slash commands only; for "@" it surfaced unrelated items.
497+
...(store.visible === "/" ? ["description" as const] : []),
496498
(obj) => obj.aliases?.join(" ") ?? "",
497499
],
498500
limit: 10,

0 commit comments

Comments
 (0)