add keywords support

This commit is contained in:
2026-04-04 14:01:53 -07:00
parent af5f1f21ec
commit 69f1d1bebd
3 changed files with 6 additions and 1 deletions

View File

@@ -106,7 +106,9 @@ export default function ContextMenu({
for (const { className, def } of category.items) {
if (seen.has(className)) continue;
const name = (def.display_name || className).toLowerCase();
if (name.includes(q)) {
const keywords: string[] = Array.isArray(def.keywords) ? def.keywords : [];
const keywordMatch = keywords.some((kw) => String(kw).toLowerCase().includes(q));
if (name.includes(q) || keywordMatch) {
results.push({ className, def });
seen.add(className);
}