add essentials

This commit is contained in:
pythongosssss
2026-02-13 08:50:23 -08:00
parent ca86212d66
commit f88a42619e
2 changed files with 31 additions and 3 deletions

View File

@@ -163,6 +163,29 @@ describe('NodeSearchContent', () => {
expect(items[0].text()).toContain('Custom Node')
})
it('should show only essential nodes when Essentials is selected', async () => {
useNodeDefStore().updateNodeDefs([
createMockNodeDef({
name: 'EssentialNode',
display_name: 'Essential Node',
essentials_category: 'basic'
}),
createMockNodeDef({
name: 'RegularNode',
display_name: 'Regular Node'
})
])
await nextTick()
const wrapper = await createWrapper()
await wrapper.find('[data-testid="category-essentials"]').trigger('click')
await nextTick()
const items = getNodeItems(wrapper)
expect(items).toHaveLength(1)
expect(items[0].text()).toContain('Essential Node')
})
it('should include subcategory nodes when parent category is selected', async () => {
useNodeDefStore().updateNodeDefs([
createMockNodeDef({

View File

@@ -74,7 +74,7 @@
:node-def="node"
:current-query="searchQuery"
show-description
show-source-badge
:show-source-badge="selectedCategory !== 'essentials'"
:hide-bookmark-icon="selectedCategory === 'favorites'"
/>
</div>
@@ -208,10 +208,15 @@ const displayedResults = computed<ComfyNodeDefImpl[]>(() => {
results = allNodes.filter((n) => nodeBookmarkStore.isBookmarked(n))
break
case 'essentials':
return []
results = allNodes.filter(
(n) => n.nodeSource.type === NodeSourceType.Essentials
)
break
case 'custom':
results = allNodes.filter(
(n) => n.nodeSource.type !== NodeSourceType.Core
(n) =>
n.nodeSource.type !== NodeSourceType.Core &&
n.nodeSource.type !== NodeSourceType.Essentials
)
break
default: