mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-06 08:00:05 +00:00
refactor: extract dialog types to break circular dependencies
- Create src/services/dialogTypes.ts with ConfirmationDialogType and ExecutionErrorDialogInput - Update ConfirmationDialogContent.vue to import from dialogTypes - Update useJobErrorReporting.ts to import from dialogTypes - Re-export types from dialogService for backward compatibility Part of Phase 1 circular dependency fixes. Amp-Thread-ID: https://ampcode.com/threads/T-019bfe05-7da5-736f-bff0-34743c003b34 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -99,7 +99,7 @@ import { useI18n } from 'vue-i18n'
|
||||
|
||||
import Button from '@/components/ui/button/Button.vue'
|
||||
import { useSettingStore } from '@/platform/settings/settingStore'
|
||||
import type { ConfirmationDialogType } from '@/services/dialogService'
|
||||
import type { ConfirmationDialogType } from '@/services/dialogTypes'
|
||||
import { useDialogStore } from '@/stores/dialogStore'
|
||||
|
||||
const props = defineProps<{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { computed } from 'vue'
|
||||
import type { ComputedRef } from 'vue'
|
||||
|
||||
import type { ExecutionErrorDialogInput } from '@/services/dialogService'
|
||||
import type { ExecutionErrorDialogInput } from '@/services/dialogTypes'
|
||||
import type { TaskItemImpl } from '@/stores/queueStore'
|
||||
|
||||
type CopyHandler = (value: string) => void | Promise<void>
|
||||
|
||||
14
src/lib/litegraph/constants.ts
Normal file
14
src/lib/litegraph/constants.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Symbols used for widget configuration in litegraph nodes.
|
||||
* Extracted to break circular dependencies between litegraphService and extensions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Symbol used to access the config object on a widget.
|
||||
*/
|
||||
export const CONFIG = Symbol('CONFIG')
|
||||
|
||||
/**
|
||||
* Symbol used to access the config getter function on a widget.
|
||||
*/
|
||||
export const GET_CONFIG = Symbol('GET_CONFIG')
|
||||
@@ -34,26 +34,15 @@ import NodeConflictHeader from '@/workbench/extensions/manager/components/manage
|
||||
import type { ConflictDetectionResult } from '@/workbench/extensions/manager/types/conflictDetectionTypes'
|
||||
import type { ComponentAttrs } from 'vue-component-type-helpers'
|
||||
|
||||
export type ConfirmationDialogType =
|
||||
| 'default'
|
||||
| 'overwrite'
|
||||
| 'overwriteBlueprint'
|
||||
| 'delete'
|
||||
| 'dirtyClose'
|
||||
| 'reinstall'
|
||||
| 'info'
|
||||
import type {
|
||||
ConfirmationDialogType,
|
||||
ExecutionErrorDialogInput
|
||||
} from './dialogTypes'
|
||||
|
||||
/**
|
||||
* Minimal interface for execution error dialogs.
|
||||
* Satisfied by both ExecutionErrorWsMessage (WebSocket) and ExecutionError (Jobs API).
|
||||
*/
|
||||
export interface ExecutionErrorDialogInput {
|
||||
exception_type: string
|
||||
exception_message: string
|
||||
node_id: string | number
|
||||
node_type: string
|
||||
traceback: string[]
|
||||
}
|
||||
export type {
|
||||
ConfirmationDialogType,
|
||||
ExecutionErrorDialogInput
|
||||
} from './dialogTypes'
|
||||
|
||||
export const useDialogService = () => {
|
||||
const dialogStore = useDialogStore()
|
||||
|
||||
25
src/services/dialogTypes.ts
Normal file
25
src/services/dialogTypes.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Type definitions for dialog service.
|
||||
* Extracted to break circular dependencies between dialogService and dialog components.
|
||||
*/
|
||||
|
||||
export type ConfirmationDialogType =
|
||||
| 'default'
|
||||
| 'overwrite'
|
||||
| 'overwriteBlueprint'
|
||||
| 'delete'
|
||||
| 'dirtyClose'
|
||||
| 'reinstall'
|
||||
| 'info'
|
||||
|
||||
/**
|
||||
* Minimal interface for execution error dialogs.
|
||||
* Satisfied by both ExecutionErrorWsMessage (WebSocket) and ExecutionError (Jobs API).
|
||||
*/
|
||||
export interface ExecutionErrorDialogInput {
|
||||
exception_type: string
|
||||
exception_message: string
|
||||
node_id: string | number
|
||||
node_type: string
|
||||
traceback: string[]
|
||||
}
|
||||
Reference in New Issue
Block a user