Add setting to hide node category in search result (#546)

This commit is contained in:
Chenlei Hu
2024-08-19 21:00:15 -04:00
committed by GitHub
parent 339e201920
commit cfad3cd918
3 changed files with 14 additions and 1 deletions

View File

@@ -36,7 +36,7 @@
:python_module="option.python_module"
/>
</div>
<div class="option-category">
<div v-if="showCategory" class="option-category">
{{ option.category.replaceAll('/', ' > ') }}
</div>
</div>
@@ -70,6 +70,9 @@ const settingStore = useSettingStore()
const enableNodePreview = computed(() =>
settingStore.get('Comfy.NodeSearchBoxImpl.NodePreview')
)
const showCategory = computed(() =>
settingStore.get('Comfy.NodeSearchBoxImpl.ShowCategory')
)
const props = defineProps({
filters: {

View File

@@ -95,6 +95,15 @@ export const useSettingStore = defineStore('setting', {
defaultValue: true
})
app.ui.settings.addSetting({
id: 'Comfy.NodeSearchBoxImpl.ShowCategory',
category: ['Comfy', 'Node Search Box', 'ShowCategory'],
name: 'Show node category in search results',
tooltip: 'Only applies to the default implementation',
type: 'boolean',
defaultValue: true
})
app.ui.settings.addSetting({
id: 'Comfy.Sidebar.Location',
category: ['Comfy', 'Sidebar', 'Location'],

View File

@@ -417,6 +417,7 @@ const zSettings = z.record(z.any()).and(
]),
'Comfy.NodeSearchBoxImpl.NodePreview': z.boolean(),
'Comfy.NodeSearchBoxImpl': z.enum(['default', 'simple']),
'Comfy.NodeSearchBoxImpl.ShowCategory': z.boolean(),
'Comfy.NodeSuggestions.number': z.number(),
'Comfy.PreviewFormat': z.string(),
'Comfy.PromptFilename': z.boolean(),