fix: include keywords in search filter + show service name in tool operations

This commit is contained in:
waleed
2026-01-28 00:24:55 -08:00
parent fe72c69d44
commit 6901b15260
2 changed files with 10 additions and 3 deletions

View File

@@ -207,9 +207,9 @@ export function SearchModal({
const showToolOperations = isOnWorkflowPage && toolOperations.length > 0
const showDocs = isOnWorkflowPage && docs.length > 0
const customFilter = useCallback((value: string, search: string) => {
const valueLower = value.toLowerCase()
const customFilter = useCallback((value: string, search: string, keywords?: string[]) => {
const searchLower = search.toLowerCase()
const valueLower = value.toLowerCase()
if (valueLower === searchLower) return 1
if (valueLower.startsWith(searchLower)) return 0.8
@@ -219,6 +219,13 @@ export function SearchModal({
const allWordsMatch = searchWords.every((word) => valueLower.includes(word))
if (allWordsMatch && searchWords.length > 0) return 0.4
if (keywords?.length) {
const keywordsLower = keywords.join(' ').toLowerCase()
if (keywordsLower.includes(searchLower)) return 0.3
const keywordWordsMatch = searchWords.every((word) => keywordsLower.includes(word))
if (keywordWordsMatch && searchWords.length > 0) return 0.2
}
return 0
}, [])

View File

@@ -129,7 +129,7 @@ export const useSearchModalStore = create<SearchModalState>()(
.filter((op) => allowedBlockTypes.has(op.blockType))
.map((op) => ({
id: op.id,
name: op.operationName,
name: `${op.serviceName}: ${op.operationName}`,
searchValue: `${op.serviceName} ${op.operationName}`,
icon: op.icon,
bgColor: op.bgColor,