Skip to content

Commit ca312fd

Browse files
[refactor] Improve workflow domain organization (#5584)
* [refactor] move workflow domain to its own folder * [refactor] Fix workflow platform architecture organization - Move workflow rendering functionality to renderer/thumbnail domain - Rename ui folder to management for better semantic clarity - Update all import paths to reflect proper domain boundaries - Fix test imports to use new structure Architecture improvements: - rendering → renderer/thumbnail (belongs with other rendering logic) - ui → management (better name for state management and UI integration) This ensures proper separation of concerns and domain boundaries. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * [fix] Resolve circular dependency between nodeDefStore and subgraphStore * [fix] Update browser test imports to use new workflow platform paths --------- Co-authored-by: Claude <[email protected]>
1 parent bbff9c8 commit ca312fd

File tree

101 files changed

+251
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+251
-213
lines changed

browser_tests/fixtures/ComfyPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import dotenv from 'dotenv'
55
import * as fs from 'fs'
66

77
import type { LGraphNode } from '../../src/lib/litegraph/src/litegraph'
8-
import type { NodeId } from '../../src/schemas/comfyWorkflowSchema'
8+
import type { NodeId } from '../../src/platform/workflow/validation/schemas/workflowSchema'
99
import type { KeyCombo } from '../../src/schemas/keyBindingSchema'
1010
import type { useWorkspaceStore } from '../../src/stores/workspaceStore'
1111
import { NodeBadgeMode } from '../../src/types/nodeSource'

browser_tests/fixtures/utils/litegraphUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Page } from '@playwright/test'
22

3-
import type { NodeId } from '../../../src/schemas/comfyWorkflowSchema'
3+
import type { NodeId } from '../../../src/platform/workflow/validation/schemas/workflowSchema'
44
import { ManageGroupNode } from '../../helpers/manageGroupNode'
55
import type { ComfyPage } from '../ComfyPage'
66
import type { Position, Size } from '../types'

browser_tests/helpers/templates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path from 'path'
44
import {
55
TemplateInfo,
66
WorkflowTemplates
7-
} from '../../src/types/workflowTemplateTypes'
7+
} from '../../src/platform/workflow/templates/types/template'
88

99
export class ComfyTemplates {
1010
readonly content: Locator

scripts/generate-json-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { zodToJsonSchema } from 'zod-to-json-schema'
55
import {
66
zComfyWorkflow,
77
zComfyWorkflow1
8-
} from '../src/schemas/comfyWorkflowSchema'
8+
} from '../src/platform/workflow/validation/schemas/workflowSchema'
99
import { zComfyNodeDef as zComfyNodeDefV2 } from '../src/schemas/nodeDef/nodeDefSchemaV2'
1010
import { zComfyNodeDef as zComfyNodeDefV1 } from '../src/schemas/nodeDefSchema'
1111

src/components/breadcrumb/SubgraphBreadcrumb.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ import { computed, onUpdated, ref, watch } from 'vue'
3838
3939
import SubgraphBreadcrumbItem from '@/components/breadcrumb/SubgraphBreadcrumbItem.vue'
4040
import { useOverflowObserver } from '@/composables/element/useOverflowObserver'
41+
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
4142
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
4243
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
4344
import { useSubgraphStore } from '@/stores/subgraphStore'
44-
import { useWorkflowStore } from '@/stores/workflowStore'
4545
import { forEachSubgraphNode } from '@/utils/graphTraversalUtil'
4646
4747
const MIN_WIDTH = 28

src/components/breadcrumb/SubgraphBreadcrumbItem.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,14 @@ import Tag from 'primevue/tag'
5353
import { computed, nextTick, ref } from 'vue'
5454
import { useI18n } from 'vue-i18n'
5555
56+
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
57+
import {
58+
ComfyWorkflow,
59+
useWorkflowStore
60+
} from '@/platform/workflow/management/stores/workflowStore'
5661
import { useDialogService } from '@/services/dialogService'
57-
import { useWorkflowService } from '@/services/workflowService'
5862
import { useCommandStore } from '@/stores/commandStore'
5963
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
60-
import { ComfyWorkflow, useWorkflowStore } from '@/stores/workflowStore'
6164
import { appendJsonExt } from '@/utils/formatUtil'
6265
6366
interface Props {

src/components/dialog/UnloadWindowConfirmDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<script setup lang="ts">
1313
import { onBeforeUnmount, onMounted } from 'vue'
1414
15+
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
1516
import { useSettingStore } from '@/stores/settingStore'
16-
import { useWorkflowStore } from '@/stores/workflowStore'
1717
1818
const settingStore = useSettingStore()
1919
const workflowStore = useWorkflowStore()

src/components/dialog/footer/ManagerProgressFooter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ import { useI18n } from 'vue-i18n'
7575
7676
import DotSpinner from '@/components/common/DotSpinner.vue'
7777
import { useConflictDetection } from '@/composables/useConflictDetection'
78+
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
7879
import { api } from '@/scripts/api'
7980
import { useComfyManagerService } from '@/services/comfyManagerService'
80-
import { useWorkflowService } from '@/services/workflowService'
8181
import {
8282
useComfyManagerStore,
8383
useManagerProgressDialogStore

src/components/graph/GraphCanvas.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,13 @@ import { useGlobalLitegraph } from '@/composables/useGlobalLitegraph'
107107
import { useLitegraphSettings } from '@/composables/useLitegraphSettings'
108108
import { usePaste } from '@/composables/usePaste'
109109
import { useVueFeatureFlags } from '@/composables/useVueFeatureFlags'
110-
import { useWorkflowAutoSave } from '@/composables/useWorkflowAutoSave'
111-
import { useWorkflowPersistence } from '@/composables/useWorkflowPersistence'
112110
import { CORE_SETTINGS } from '@/constants/coreSettings'
113111
import { i18n, t } from '@/i18n'
114112
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
113+
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
114+
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
115+
import { useWorkflowAutoSave } from '@/platform/workflow/persistence/composables/useWorkflowAutoSave'
116+
import { useWorkflowPersistence } from '@/platform/workflow/persistence/composables/useWorkflowPersistence'
115117
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
116118
import { SelectedNodeIdsKey } from '@/renderer/core/canvas/injectionKeys'
117119
import TransformPane from '@/renderer/core/layout/transform/TransformPane.vue'
@@ -125,13 +127,11 @@ import { ChangeTracker } from '@/scripts/changeTracker'
125127
import { IS_CONTROL_WIDGET, updateControlWidgetLabel } from '@/scripts/widgets'
126128
import { useColorPaletteService } from '@/services/colorPaletteService'
127129
import { newUserService } from '@/services/newUserService'
128-
import { useWorkflowService } from '@/services/workflowService'
129130
import { useCommandStore } from '@/stores/commandStore'
130131
import { useExecutionStore } from '@/stores/executionStore'
131132
import { useNodeDefStore } from '@/stores/nodeDefStore'
132133
import { useSettingStore } from '@/stores/settingStore'
133134
import { useToastStore } from '@/stores/toastStore'
134-
import { useWorkflowStore } from '@/stores/workflowStore'
135135
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
136136
import { useSearchBoxStore } from '@/stores/workspace/searchBoxStore'
137137
import { useWorkspaceStore } from '@/stores/workspaceStore'

src/components/graph/selectionToolbox/ColorPickerButton.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { createI18n } from 'vue-i18n'
77

88
// Import after mocks
99
import ColorPickerButton from '@/components/graph/selectionToolbox/ColorPickerButton.vue'
10+
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
1011
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
11-
import { useWorkflowStore } from '@/stores/workflowStore'
1212

1313
// Mock the litegraph module
1414
vi.mock('@/lib/litegraph/src/litegraph', async () => {

0 commit comments

Comments
 (0)