fix(tui): reduce noisy MCP autocomplete matches (#33176)
This commit is contained in:
parent
d3bbfff826
commit
f12ac6f234
@ -359,9 +359,8 @@ export function Autocomplete(props: {
|
||||
const width = props.anchor().width - 4
|
||||
|
||||
for (const res of Object.values(sync.data.mcp_resource)) {
|
||||
const text = `${res.name} (${res.uri})`
|
||||
options.push({
|
||||
display: Locale.truncateMiddle(text, width),
|
||||
display: Locale.truncateMiddle(res.name, width),
|
||||
// Match the name only; matching the URI caused unrelated fuzzy hits.
|
||||
value: res.name,
|
||||
description: res.description,
|
||||
@ -497,6 +496,7 @@ export function Autocomplete(props: {
|
||||
...(store.visible === "/" ? ["description" as const] : []),
|
||||
(obj) => obj.aliases?.join(" ") ?? "",
|
||||
],
|
||||
threshold: store.visible === "@" ? 0.5 : 0,
|
||||
limit: 10,
|
||||
scoreFn: (objResults) => {
|
||||
const displayResult = objResults[0]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user