From ebcf81f58f7a91f51780c83cf1fe67ae2712254a Mon Sep 17 00:00:00 2001 From: markijbema <624143+markijbema@users.noreply.github.com> Date: Wed, 24 Jun 2026 10:03:28 +0000 Subject: [PATCH] fix(vscode): match marketplace display labels in search Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com> --- .../kilo-vscode/tests/unit/marketplace-actions.test.ts | 6 +++++- .../src/components/marketplace/MarketplaceListView.tsx | 6 +++++- .../webview-ui/src/components/marketplace/utils.ts | 8 +++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/kilo-vscode/tests/unit/marketplace-actions.test.ts b/packages/kilo-vscode/tests/unit/marketplace-actions.test.ts index c305e05c04..0a12943fb3 100644 --- a/packages/kilo-vscode/tests/unit/marketplace-actions.test.ts +++ b/packages/kilo-vscode/tests/unit/marketplace-actions.test.ts @@ -95,7 +95,7 @@ describe("Marketplace installation metadata", () => { id: "warehouse", name: "Warehouse", description: "Queries data", - category: "data", + category: "web-automation", url: "https://example.com", content: "{}", }, @@ -114,6 +114,10 @@ describe("Marketplace installation metadata", () => { const metadata = { project: { "mcp:warehouse": { type: "mcp" } }, global: {} } expect(filterItems(items, metadata, "reviewer", "all", [], []).map((item) => item.id)).toEqual(["reviewer"]) + expect(filterItems(items, metadata, "web automation", "all", [], []).map((item) => item.id)).toEqual(["warehouse"]) + expect( + filterItems(items, metadata, "servidor mcp", "all", [], [], { mcp: "Servidor MCP" }).map((item) => item.id), + ).toEqual(["warehouse"]) expect(filterItems(items, metadata, "", "all", ["business"], []).map((item) => item.id)).toEqual([ "campaign-writer", ]) diff --git a/packages/kilo-vscode/webview-ui/src/components/marketplace/MarketplaceListView.tsx b/packages/kilo-vscode/webview-ui/src/components/marketplace/MarketplaceListView.tsx index 6142c6c94e..9fa8788905 100644 --- a/packages/kilo-vscode/webview-ui/src/components/marketplace/MarketplaceListView.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/marketplace/MarketplaceListView.tsx @@ -87,7 +87,11 @@ export const MarketplaceListView = (props: Props) => { } const filtered = createMemo(() => - filterItems(props.items, props.metadata, search(), status().value, categories(), types()), + filterItems(props.items, props.metadata, search(), status().value, categories(), types(), { + agent: typeLabel("agent"), + mcp: typeLabel("mcp"), + skill: typeLabel("skill"), + }), ) return ( diff --git a/packages/kilo-vscode/webview-ui/src/components/marketplace/utils.ts b/packages/kilo-vscode/webview-ui/src/components/marketplace/utils.ts index 6d9e6f0f9c..be2e93948a 100644 --- a/packages/kilo-vscode/webview-ui/src/components/marketplace/utils.ts +++ b/packages/kilo-vscode/webview-ui/src/components/marketplace/utils.ts @@ -20,14 +20,15 @@ export function installedScopes( return scopes } -function matches(item: MarketplaceItem, query: string) { +function matches(item: MarketplaceItem, query: string, labels: Partial>) { const skill = item.type === "skill" ? item : undefined return ( item.id.toLowerCase().includes(query) || item.name.toLowerCase().includes(query) || item.description.toLowerCase().includes(query) || - item.category.toLowerCase().includes(query) || + item.category.replaceAll("-", " ").toLowerCase().includes(query) || item.type.includes(query) || + (labels[item.type]?.toLowerCase().includes(query) ?? false) || (item.author?.toLowerCase().includes(query) ?? false) || (skill?.displayName.toLowerCase().includes(query) ?? false) ) @@ -40,6 +41,7 @@ export function filterItems( status: string, categories: string[], types: MarketplaceItem["type"][], + labels: Partial> = {}, ): MarketplaceItem[] { const query = search.trim().toLowerCase() return items @@ -49,7 +51,7 @@ export function filterItems( if (types.length > 0 && !types.includes(item.type)) return false if (categories.length > 0 && !categories.includes(item.category)) return false if (!query) return true - return matches(item, query) + return matches(item, query, labels) }) .sort((a, b) => a.name.localeCompare(b.name)) }