From 97c7aef72d4d23ea53bb01739400b809a230d53e Mon Sep 17 00:00:00 2001 From: AustinMroz Date: Wed, 17 Dec 2025 18:52:14 -0800 Subject: [PATCH] Update Search Box IO filters to support multitype (#7542) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It doesn't feel like this further hurts the lackluster responsiveness of the searchbox, but second opinions would be appreciated. | Before | After | | ------ | ----- | | before| after| ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7542-Update-Search-Box-IO-filters-to-support-multitype-2cb6d73d365081ccbeabf1a891351996) by [Unito](https://www.unito.io) --- src/services/nodeSearchService.ts | 7 +++++-- src/utils/fuseUtil.ts | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/services/nodeSearchService.ts b/src/services/nodeSearchService.ts index c29507f2e..d54c97e1f 100644 --- a/src/services/nodeSearchService.ts +++ b/src/services/nodeSearchService.ts @@ -35,7 +35,9 @@ export class NodeSearchService { name: 'Input Type', invokeSequence: 'i', getItemOptions: (node) => - Object.values(node.inputs ?? []).map((input) => input.type), + Object.values(node.inputs ?? []).flatMap((input) => + input.type.split(',') + ), fuseOptions }) @@ -43,7 +45,8 @@ export class NodeSearchService { id: 'output', name: 'Output Type', invokeSequence: 'o', - getItemOptions: (node) => node.outputs.map((output) => output.type), + getItemOptions: (node) => + node.outputs.flatMap((output) => output.type.split(',')), fuseOptions }) diff --git a/src/utils/fuseUtil.ts b/src/utils/fuseUtil.ts index d0b8020d1..6969bbe06 100644 --- a/src/utils/fuseUtil.ts +++ b/src/utils/fuseUtil.ts @@ -62,9 +62,12 @@ export class FuseFilter { return true } const options = this.getItemOptions(item) - return wildcard - ? options.some((option) => option === wildcard) - : options.includes(value) + if (wildcard) return options.some((option) => option === wildcard) + if (typeof value !== 'string' || !value.includes(',')) + return options.includes(value) + const values = value.split(',') + //Alas, typescript doesn't understand string satisfies O + return values.some((v) => options.includes(v as O)) } }