mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-13 17:10:06 +00:00
feat: show missing node packs in Errors Tab with install support (#9213)
## Summary Surfaces missing node pack information in the Errors Tab, grouped by registry pack, with one-click install support via ComfyUI Manager. ## Changes - **What**: Errors Tab now groups missing nodes by their registry pack and shows a `MissingPackGroupRow` with pack name, node/pack counts, and an Install button that triggers Manager installation. A `MissingNodeCard` shows individual unresolvable nodes that have no associated pack. `useErrorGroups` was extended to resolve missing node types to their registry packs using the `/api/workflow/missing_nodes` endpoint. `executionErrorStore` was refactored to track missing node types separately from execution errors and expose them reactively. - **Breaking**: None ## Review Focus - `useErrorGroups.ts` — the new `resolveMissingNodePacks` logic fetches pack metadata and maps node types to pack IDs; edge cases around partial resolution (some nodes have a pack, some don't) produce both `MissingPackGroupRow` and `MissingNodeCard` entries - `executionErrorStore.ts` — the store now separates `missingNodeTypes` state from `errors`; the deferred-warnings path in `app.ts` now calls `setMissingNodeTypes` so the Errors Tab is populated even when a workflow loads without executing ## Screenshots (if applicable) https://github.com/user-attachments/assets/97f8d009-0cac-4739-8740-fd3333b5a85b ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9213-feat-show-missing-node-packs-in-Errors-Tab-with-install-support-3126d73d36508197bc4bf8ebfd2125c8) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -345,3 +345,100 @@ describe('useExecutionErrorStore - Node Error Lookups', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('useExecutionErrorStore - setMissingNodeTypes', () => {
|
||||
let store: ReturnType<typeof useExecutionErrorStore>
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
setActivePinia(createTestingPinia({ stubActions: false }))
|
||||
store = useExecutionErrorStore()
|
||||
})
|
||||
|
||||
it('clears missingNodesError when called with an empty array', () => {
|
||||
store.setMissingNodeTypes([{ type: 'NodeA' }])
|
||||
store.setMissingNodeTypes([])
|
||||
expect(store.missingNodesError).toBeNull()
|
||||
})
|
||||
|
||||
it('hasMissingNodes is false when error is null', () => {
|
||||
store.setMissingNodeTypes([])
|
||||
expect(store.hasMissingNodes).toBe(false)
|
||||
})
|
||||
|
||||
it('hasMissingNodes is true after setting non-empty types', () => {
|
||||
store.setMissingNodeTypes([{ type: 'NodeA' }])
|
||||
expect(store.hasMissingNodes).toBe(true)
|
||||
})
|
||||
|
||||
it('deduplicates string entries by value', () => {
|
||||
store.setMissingNodeTypes(['GroupNode', 'GroupNode', 'OtherGroup'])
|
||||
expect(store.missingNodesError?.nodeTypes).toHaveLength(2)
|
||||
expect(store.missingNodesError?.nodeTypes).toEqual([
|
||||
'GroupNode',
|
||||
'OtherGroup'
|
||||
])
|
||||
})
|
||||
|
||||
it('keeps a single string entry unchanged', () => {
|
||||
store.setMissingNodeTypes(['GroupNode'])
|
||||
expect(store.missingNodesError?.nodeTypes).toHaveLength(1)
|
||||
})
|
||||
|
||||
it('deduplicates object entries with the same nodeId', () => {
|
||||
store.setMissingNodeTypes([
|
||||
{ type: 'NodeA', nodeId: 1 },
|
||||
{ type: 'NodeA', nodeId: 1 }
|
||||
])
|
||||
expect(store.missingNodesError?.nodeTypes).toHaveLength(1)
|
||||
})
|
||||
|
||||
it('keeps object entries with different nodeIds even if same type', () => {
|
||||
store.setMissingNodeTypes([
|
||||
{ type: 'NodeA', nodeId: 1 },
|
||||
{ type: 'NodeA', nodeId: 2 }
|
||||
])
|
||||
expect(store.missingNodesError?.nodeTypes).toHaveLength(2)
|
||||
})
|
||||
|
||||
it('deduplicates object entries by type when nodeId is absent', () => {
|
||||
store.setMissingNodeTypes([{ type: 'NodeB' }, { type: 'NodeB' }])
|
||||
expect(store.missingNodesError?.nodeTypes).toHaveLength(1)
|
||||
})
|
||||
|
||||
it('keeps distinct types when nodeId is absent', () => {
|
||||
store.setMissingNodeTypes([{ type: 'NodeB' }, { type: 'NodeC' }])
|
||||
expect(store.missingNodesError?.nodeTypes).toHaveLength(2)
|
||||
})
|
||||
|
||||
it('treats absent nodeId the same as type-only key (falls back to type)', () => {
|
||||
store.setMissingNodeTypes([{ type: 'NodeD' }, { type: 'NodeD' }])
|
||||
expect(store.missingNodesError?.nodeTypes).toHaveLength(1)
|
||||
})
|
||||
|
||||
it('handles a mix of string and object entries correctly', () => {
|
||||
store.setMissingNodeTypes([
|
||||
'GroupNode',
|
||||
'GroupNode', // string dup
|
||||
{ type: 'NodeA', nodeId: 1 },
|
||||
{ type: 'NodeA', nodeId: 1 }, // object dup by nodeId
|
||||
{ type: 'NodeA', nodeId: 2 }, // same type, different nodeId → kept
|
||||
{ type: 'NodeB' },
|
||||
{ type: 'NodeB' } // object dup by type
|
||||
])
|
||||
// Unique: 'GroupNode', {NodeA,1}, {NodeA,2}, {NodeB} → 4
|
||||
expect(store.missingNodesError?.nodeTypes).toHaveLength(4)
|
||||
})
|
||||
|
||||
it('stores a non-empty message string in missingNodesError', () => {
|
||||
store.setMissingNodeTypes([{ type: 'NodeA' }])
|
||||
expect(typeof store.missingNodesError?.message).toBe('string')
|
||||
expect(store.missingNodesError!.message.length).toBeGreaterThan(0)
|
||||
})
|
||||
|
||||
it('stores the deduplicated nodeTypes array in missingNodesError', () => {
|
||||
const input = [{ type: 'NodeA' }, { type: 'NodeB' }]
|
||||
store.setMissingNodeTypes(input)
|
||||
expect(store.missingNodesError?.nodeTypes).toEqual(input)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user