Enable category-based narrowing and reset to default on search clear (#2071)

Co-authored-by: huchenlei <huchenlei@proton.me>
This commit is contained in:
Yuki Shindo
2024-12-28 08:06:50 +09:00
committed by GitHub
parent 861d559f19
commit 20412f2c74
2 changed files with 72 additions and 29 deletions

View File

@@ -18,6 +18,15 @@ import type { ComfyExtension } from '@/types/comfy'
import { buildTree } from '@/utils/treeUtil'
import { CORE_SETTINGS } from '@/constants/coreSettings'
export const getSettingInfo = (setting: SettingParams) => {
const parts = setting.category || setting.id.split('.')
return {
category: parts[0],
subCategory: parts[1],
name: parts.slice(2).join('.')
}
}
export interface SettingTreeNode extends TreeNode {
data?: SettingParams
}