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:
Alexander Brown
2026-01-26 22:12:18 -08:00
parent 2b2a72ffda
commit 83aa879b07
5 changed files with 49 additions and 21 deletions

View File

@@ -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<{

View File

@@ -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>

View 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')

View File

@@ -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()

View 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[]
}