diff --git a/src/App.vue b/src/App.vue index 5e183c430..0a8ec51c3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,8 +17,8 @@ import { computed, onMounted } from 'vue' import GlobalDialog from '@/components/dialog/GlobalDialog.vue' import config from '@/config' import { useWorkspaceStore } from '@/stores/workspaceStore' +import { useConflictDetection } from '@/workbench/extensions/manager/composables/useConflictDetection' -import { useConflictDetection } from './composables/useConflictDetection' import { electronAPI, isElectron } from './utils/envUtil' const workspaceStore = useWorkspaceStore() diff --git a/src/components/dialog/content/LoadWorkflowWarning.vue b/src/components/dialog/content/LoadWorkflowWarning.vue index a89c94981..17c38c29b 100644 --- a/src/components/dialog/content/LoadWorkflowWarning.vue +++ b/src/components/dialog/content/LoadWorkflowWarning.vue @@ -58,11 +58,11 @@ import { useI18n } from 'vue-i18n' import NoResultsPlaceholder from '@/components/common/NoResultsPlaceholder.vue' import MissingCoreNodesMessage from '@/components/dialog/content/MissingCoreNodesMessage.vue' -import { useMissingNodes } from '@/composables/nodePack/useMissingNodes' import { useToastStore } from '@/platform/updates/common/toastStore' import { useDialogStore } from '@/stores/dialogStore' import type { MissingNodeType } from '@/types/comfy' import PackInstallButton from '@/workbench/extensions/manager/components/manager/button/PackInstallButton.vue' +import { useMissingNodes } from '@/workbench/extensions/manager/composables/nodePack/useMissingNodes' import { useManagerState } from '@/workbench/extensions/manager/composables/useManagerState' import { useComfyManagerStore } from '@/workbench/extensions/manager/stores/comfyManagerStore' import { ManagerTab } from '@/workbench/extensions/manager/types/comfyManagerTypes' diff --git a/src/components/helpcenter/HelpCenterMenuContent.vue b/src/components/helpcenter/HelpCenterMenuContent.vue index e9f24d108..708d9f905 100644 --- a/src/components/helpcenter/HelpCenterMenuContent.vue +++ b/src/components/helpcenter/HelpCenterMenuContent.vue @@ -141,13 +141,13 @@ import { import { useI18n } from 'vue-i18n' import PuzzleIcon from '@/components/icons/PuzzleIcon.vue' -import { useConflictAcknowledgment } from '@/composables/useConflictAcknowledgment' import { useSettingStore } from '@/platform/settings/settingStore' import type { ReleaseNote } from '@/platform/updates/common/releaseService' import { useReleaseStore } from '@/platform/updates/common/releaseStore' import { useCommandStore } from '@/stores/commandStore' import { electronAPI, isElectron } from '@/utils/envUtil' import { formatVersionAnchor } from '@/utils/formatUtil' +import { useConflictAcknowledgment } from '@/workbench/extensions/manager/composables/useConflictAcknowledgment' import { useManagerState } from '@/workbench/extensions/manager/composables/useManagerState' import { ManagerTab } from '@/workbench/extensions/manager/types/comfyManagerTypes' diff --git a/src/components/sidebar/SidebarHelpCenterIcon.vue b/src/components/sidebar/SidebarHelpCenterIcon.vue index 04589a551..e72389022 100644 --- a/src/components/sidebar/SidebarHelpCenterIcon.vue +++ b/src/components/sidebar/SidebarHelpCenterIcon.vue @@ -62,14 +62,14 @@ import { storeToRefs } from 'pinia' import { computed, onMounted } from 'vue' import HelpCenterMenuContent from '@/components/helpcenter/HelpCenterMenuContent.vue' -import { useConflictAcknowledgment } from '@/composables/useConflictAcknowledgment' -import { useConflictDetection } from '@/composables/useConflictDetection' import { useSettingStore } from '@/platform/settings/settingStore' import { useReleaseStore } from '@/platform/updates/common/releaseStore' import ReleaseNotificationToast from '@/platform/updates/components/ReleaseNotificationToast.vue' import WhatsNewPopup from '@/platform/updates/components/WhatsNewPopup.vue' import { useDialogService } from '@/services/dialogService' import { useHelpCenterStore } from '@/stores/helpCenterStore' +import { useConflictAcknowledgment } from '@/workbench/extensions/manager/composables/useConflictAcknowledgment' +import { useConflictDetection } from '@/workbench/extensions/manager/composables/useConflictDetection' import SidebarIcon from './SidebarIcon.vue' diff --git a/src/composables/README.md b/src/composables/README.md index 34fb011f0..9bf9a4635 100644 --- a/src/composables/README.md +++ b/src/composables/README.md @@ -103,14 +103,22 @@ Utility composables for common patterns: | `useChainCallback` | Chains multiple callbacks together | ### Manager -Composables for ComfyUI Manager integration: +Composables for ComfyUI Manager integration (located in +`@/workbench/extensions/manager/composables`): | Composable | Description | |------------|-------------| | `useManagerStatePersistence` | Persists manager UI state | +| `useManagerState` | Determines availability of manager UI modes | +| `useManagerQueue` | Handles manager task queue state | +| `useConflictAcknowledgment` | Tracks conflict dismissal state | +| `useConflictDetection` | Orchestrates conflict detection workflow | +| `useImportFailedDetection` | Handles import-failed conflict dialogs | +| `useRegistrySearch` | Manages registry search UI state | -### Node Pack -Composables for node package management: +#### Node Pack +Node package helpers live under +`@/workbench/extensions/manager/composables/nodePack`: | Composable | Description | |------------|-------------| @@ -118,6 +126,9 @@ Composables for node package management: | `useMissingNodes` | Detects and handles missing nodes | | `useNodePacks` | Core node package functionality | | `usePackUpdateStatus` | Tracks package update availability | +| `usePacksSelection` | Provides selection helpers for pack lists | +| `usePacksStatus` | Aggregates status across multiple packs | +| `useUpdateAvailableNodes` | Detects available updates for nodes | | `useWorkflowPacks` | Manages packages used in workflows | ### Node @@ -408,4 +419,4 @@ export function useFetchData(url) { } ``` -For more information on Vue composables, refer to the [Vue.js Composition API documentation](https://vuejs.org/guide/reusability/composables.html) and the [VueUse documentation](https://vueuse.org/). \ No newline at end of file +For more information on Vue composables, refer to the [Vue.js Composition API documentation](https://vuejs.org/guide/reusability/composables.html) and the [VueUse documentation](https://vueuse.org/). diff --git a/src/workbench/extensions/manager/components/ManagerProgressFooter.vue b/src/workbench/extensions/manager/components/ManagerProgressFooter.vue index 392310721..2d71d4a2c 100644 --- a/src/workbench/extensions/manager/components/ManagerProgressFooter.vue +++ b/src/workbench/extensions/manager/components/ManagerProgressFooter.vue @@ -74,12 +74,12 @@ import { computed, ref } from 'vue' import { useI18n } from 'vue-i18n' import DotSpinner from '@/components/common/DotSpinner.vue' -import { useConflictDetection } from '@/composables/useConflictDetection' import { useSettingStore } from '@/platform/settings/settingStore' import { useWorkflowService } from '@/platform/workflow/core/services/workflowService' import { api } from '@/scripts/api' import { useCommandStore } from '@/stores/commandStore' import { useDialogStore } from '@/stores/dialogStore' +import { useConflictDetection } from '@/workbench/extensions/manager/composables/useConflictDetection' import { useComfyManagerService } from '@/workbench/extensions/manager/services/comfyManagerService' import { useComfyManagerStore, diff --git a/src/workbench/extensions/manager/components/manager/ManagerDialogContent.vue b/src/workbench/extensions/manager/components/manager/ManagerDialogContent.vue index f6c290d30..61047c8b4 100644 --- a/src/workbench/extensions/manager/components/manager/ManagerDialogContent.vue +++ b/src/workbench/extensions/manager/components/manager/ManagerDialogContent.vue @@ -144,11 +144,6 @@ import ContentDivider from '@/components/common/ContentDivider.vue' import NoResultsPlaceholder from '@/components/common/NoResultsPlaceholder.vue' import VirtualGrid from '@/components/common/VirtualGrid.vue' import { useResponsiveCollapse } from '@/composables/element/useResponsiveCollapse' -import { useInstalledPacks } from '@/composables/nodePack/useInstalledPacks' -import { usePackUpdateStatus } from '@/composables/nodePack/usePackUpdateStatus' -import { useWorkflowPacks } from '@/composables/nodePack/useWorkflowPacks' -import { useConflictAcknowledgment } from '@/composables/useConflictAcknowledgment' -import { useRegistrySearch } from '@/composables/useRegistrySearch' import { useComfyRegistryStore } from '@/stores/comfyRegistryStore' import type { components } from '@/types/comfyRegistryTypes' import ManagerNavSidebar from '@/workbench/extensions/manager/components/manager/ManagerNavSidebar.vue' @@ -157,7 +152,12 @@ import InfoPanelMultiItem from '@/workbench/extensions/manager/components/manage import PackCard from '@/workbench/extensions/manager/components/manager/packCard/PackCard.vue' import RegistrySearchBar from '@/workbench/extensions/manager/components/manager/registrySearchBar/RegistrySearchBar.vue' import GridSkeleton from '@/workbench/extensions/manager/components/manager/skeleton/GridSkeleton.vue' +import { useInstalledPacks } from '@/workbench/extensions/manager/composables/nodePack/useInstalledPacks' +import { usePackUpdateStatus } from '@/workbench/extensions/manager/composables/nodePack/usePackUpdateStatus' +import { useWorkflowPacks } from '@/workbench/extensions/manager/composables/nodePack/useWorkflowPacks' +import { useConflictAcknowledgment } from '@/workbench/extensions/manager/composables/useConflictAcknowledgment' import { useManagerStatePersistence } from '@/workbench/extensions/manager/composables/useManagerStatePersistence' +import { useRegistrySearch } from '@/workbench/extensions/manager/composables/useRegistrySearch' import { useComfyManagerStore } from '@/workbench/extensions/manager/stores/comfyManagerStore' import type { TabItem } from '@/workbench/extensions/manager/types/comfyManagerTypes' import { ManagerTab } from '@/workbench/extensions/manager/types/comfyManagerTypes' diff --git a/src/workbench/extensions/manager/components/manager/NodeConflictDialogContent.vue b/src/workbench/extensions/manager/components/manager/NodeConflictDialogContent.vue index b6cd70a70..b1fa4884a 100644 --- a/src/workbench/extensions/manager/components/manager/NodeConflictDialogContent.vue +++ b/src/workbench/extensions/manager/components/manager/NodeConflictDialogContent.vue @@ -168,12 +168,12 @@ import { computed, ref } from 'vue' import { useI18n } from 'vue-i18n' import ContentDivider from '@/components/common/ContentDivider.vue' -import { useConflictDetection } from '@/composables/useConflictDetection' import type { ConflictDetail, ConflictDetectionResult } from '@/types/conflictDetectionTypes' import { getConflictMessage } from '@/utils/conflictMessageUtil' +import { useConflictDetection } from '@/workbench/extensions/manager/composables/useConflictDetection' const { showAfterWhatsNew = false, conflictedPackages } = defineProps<{ showAfterWhatsNew?: boolean diff --git a/src/workbench/extensions/manager/components/manager/PackVersionBadge.test.ts b/src/workbench/extensions/manager/components/manager/PackVersionBadge.test.ts index e4eca3016..0b34788ad 100644 --- a/src/workbench/extensions/manager/components/manager/PackVersionBadge.test.ts +++ b/src/workbench/extensions/manager/components/manager/PackVersionBadge.test.ts @@ -44,11 +44,14 @@ vi.mock('@/workbench/extensions/manager/stores/comfyManagerStore', () => ({ })) })) -vi.mock('@/composables/nodePack/usePackUpdateStatus', () => ({ - usePackUpdateStatus: vi.fn(() => ({ - isUpdateAvailable: false - })) -})) +vi.mock( + '@/workbench/extensions/manager/composables/nodePack/usePackUpdateStatus', + () => ({ + usePackUpdateStatus: vi.fn(() => ({ + isUpdateAvailable: false + })) + }) +) const mockToggle = vi.fn() const mockHide = vi.fn() diff --git a/src/workbench/extensions/manager/components/manager/PackVersionBadge.vue b/src/workbench/extensions/manager/components/manager/PackVersionBadge.vue index 204b2a78e..551468861 100644 --- a/src/workbench/extensions/manager/components/manager/PackVersionBadge.vue +++ b/src/workbench/extensions/manager/components/manager/PackVersionBadge.vue @@ -46,9 +46,9 @@ import Popover from 'primevue/popover' import { valid as validSemver } from 'semver' import { computed, ref, watch } from 'vue' -import { usePackUpdateStatus } from '@/composables/nodePack/usePackUpdateStatus' import type { components } from '@/types/comfyRegistryTypes' import PackVersionSelectorPopover from '@/workbench/extensions/manager/components/manager/PackVersionSelectorPopover.vue' +import { usePackUpdateStatus } from '@/workbench/extensions/manager/composables/nodePack/usePackUpdateStatus' import { useComfyManagerStore } from '@/workbench/extensions/manager/stores/comfyManagerStore' const TRUNCATED_HASH_LENGTH = 7 diff --git a/src/workbench/extensions/manager/components/manager/PackVersionSelectorPopover.test.ts b/src/workbench/extensions/manager/components/manager/PackVersionSelectorPopover.test.ts index eaed449b9..4dfab9bc9 100644 --- a/src/workbench/extensions/manager/components/manager/PackVersionSelectorPopover.test.ts +++ b/src/workbench/extensions/manager/components/manager/PackVersionSelectorPopover.test.ts @@ -76,11 +76,14 @@ vi.mock('@/workbench/extensions/manager/stores/comfyManagerStore', () => ({ })) // Mock the conflict detection composable -vi.mock('@/composables/useConflictDetection', () => ({ - useConflictDetection: vi.fn(() => ({ - checkNodeCompatibility: mockCheckNodeCompatibility - })) -})) +vi.mock( + '@/workbench/extensions/manager/composables/useConflictDetection', + () => ({ + useConflictDetection: vi.fn(() => ({ + checkNodeCompatibility: mockCheckNodeCompatibility + })) + }) +) const waitForPromises = async () => { await new Promise((resolve) => setTimeout(resolve, 16)) diff --git a/src/workbench/extensions/manager/components/manager/PackVersionSelectorPopover.vue b/src/workbench/extensions/manager/components/manager/PackVersionSelectorPopover.vue index fc1271eed..2737bed88 100644 --- a/src/workbench/extensions/manager/components/manager/PackVersionSelectorPopover.vue +++ b/src/workbench/extensions/manager/components/manager/PackVersionSelectorPopover.vue @@ -91,10 +91,10 @@ import { useI18n } from 'vue-i18n' import ContentDivider from '@/components/common/ContentDivider.vue' import NoResultsPlaceholder from '@/components/common/NoResultsPlaceholder.vue' import VerifiedIcon from '@/components/icons/VerifiedIcon.vue' -import { useConflictDetection } from '@/composables/useConflictDetection' import { useComfyRegistryService } from '@/services/comfyRegistryService' import type { components } from '@/types/comfyRegistryTypes' import { getJoinedConflictMessages } from '@/utils/conflictMessageUtil' +import { useConflictDetection } from '@/workbench/extensions/manager/composables/useConflictDetection' import { useComfyManagerStore } from '@/workbench/extensions/manager/stores/comfyManagerStore' import type { components as ManagerComponents } from '@/workbench/extensions/manager/types/generatedManagerTypes' diff --git a/src/workbench/extensions/manager/components/manager/button/PackEnableToggle.vue b/src/workbench/extensions/manager/components/manager/button/PackEnableToggle.vue index 18786757d..f95af0c0b 100644 --- a/src/workbench/extensions/manager/components/manager/button/PackEnableToggle.vue +++ b/src/workbench/extensions/manager/components/manager/button/PackEnableToggle.vue @@ -34,11 +34,11 @@ import ToggleSwitch from 'primevue/toggleswitch' import { computed, ref } from 'vue' import { useI18n } from 'vue-i18n' -import { useConflictAcknowledgment } from '@/composables/useConflictAcknowledgment' import { useDialogService } from '@/services/dialogService' -import { useConflictDetectionStore } from '@/stores/conflictDetectionStore' import type { components } from '@/types/comfyRegistryTypes' +import { useConflictAcknowledgment } from '@/workbench/extensions/manager/composables/useConflictAcknowledgment' import { useComfyManagerStore } from '@/workbench/extensions/manager/stores/comfyManagerStore' +import { useConflictDetectionStore } from '@/workbench/extensions/manager/stores/conflictDetectionStore' import type { components as ManagerComponents } from '@/workbench/extensions/manager/types/generatedManagerTypes' const TOGGLE_DEBOUNCE_MS = 256 diff --git a/src/workbench/extensions/manager/components/manager/button/PackInstallButton.vue b/src/workbench/extensions/manager/components/manager/button/PackInstallButton.vue index 939bd34da..1d1d75526 100644 --- a/src/workbench/extensions/manager/components/manager/button/PackInstallButton.vue +++ b/src/workbench/extensions/manager/components/manager/button/PackInstallButton.vue @@ -27,13 +27,13 @@ import { computed } from 'vue' import IconTextButton from '@/components/button/IconTextButton.vue' import DotSpinner from '@/components/common/DotSpinner.vue' -import { useConflictDetection } from '@/composables/useConflictDetection' import { t } from '@/i18n' import { useDialogService } from '@/services/dialogService' import type { ButtonSize } from '@/types/buttonTypes' import type { components } from '@/types/comfyRegistryTypes' import type { ConflictDetectionResult } from '@/types/conflictDetectionTypes' import type { ConflictDetail } from '@/types/conflictDetectionTypes' +import { useConflictDetection } from '@/workbench/extensions/manager/composables/useConflictDetection' import { useComfyManagerStore } from '@/workbench/extensions/manager/stores/comfyManagerStore' import type { components as ManagerComponents } from '@/workbench/extensions/manager/types/generatedManagerTypes' diff --git a/src/workbench/extensions/manager/components/manager/infoPanel/InfoPanel.vue b/src/workbench/extensions/manager/components/manager/infoPanel/InfoPanel.vue index 46d48cfb6..f3e8175a4 100644 --- a/src/workbench/extensions/manager/components/manager/infoPanel/InfoPanel.vue +++ b/src/workbench/extensions/manager/components/manager/infoPanel/InfoPanel.vue @@ -64,9 +64,6 @@ import { useScroll, whenever } from '@vueuse/core' import { computed, provide, ref } from 'vue' import { useI18n } from 'vue-i18n' -import { useConflictDetection } from '@/composables/useConflictDetection' -import { useImportFailedDetection } from '@/composables/useImportFailedDetection' -import { useConflictDetectionStore } from '@/stores/conflictDetectionStore' import type { components } from '@/types/comfyRegistryTypes' import type { ConflictDetectionResult } from '@/types/conflictDetectionTypes' import { ImportFailedKey } from '@/types/importFailedTypes' @@ -76,7 +73,10 @@ import PackEnableToggle from '@/workbench/extensions/manager/components/manager/ import InfoPanelHeader from '@/workbench/extensions/manager/components/manager/infoPanel/InfoPanelHeader.vue' import InfoTabs from '@/workbench/extensions/manager/components/manager/infoPanel/InfoTabs.vue' import MetadataRow from '@/workbench/extensions/manager/components/manager/infoPanel/MetadataRow.vue' +import { useConflictDetection } from '@/workbench/extensions/manager/composables/useConflictDetection' +import { useImportFailedDetection } from '@/workbench/extensions/manager/composables/useImportFailedDetection' import { useComfyManagerStore } from '@/workbench/extensions/manager/stores/comfyManagerStore' +import { useConflictDetectionStore } from '@/workbench/extensions/manager/stores/conflictDetectionStore' import { IsInstallingKey } from '@/workbench/extensions/manager/types/comfyManagerTypes' interface InfoItem { diff --git a/src/workbench/extensions/manager/components/manager/infoPanel/InfoPanelHeader.vue b/src/workbench/extensions/manager/components/manager/infoPanel/InfoPanelHeader.vue index 2b0b5133e..db1d976c3 100644 --- a/src/workbench/extensions/manager/components/manager/infoPanel/InfoPanelHeader.vue +++ b/src/workbench/extensions/manager/components/manager/infoPanel/InfoPanelHeader.vue @@ -45,13 +45,13 @@ import { computed, inject, ref, watch } from 'vue' import NoResultsPlaceholder from '@/components/common/NoResultsPlaceholder.vue' -import { useConflictDetection } from '@/composables/useConflictDetection' import type { components } from '@/types/comfyRegistryTypes' import type { ConflictDetail } from '@/types/conflictDetectionTypes' import { ImportFailedKey } from '@/types/importFailedTypes' import PackInstallButton from '@/workbench/extensions/manager/components/manager/button/PackInstallButton.vue' import PackUninstallButton from '@/workbench/extensions/manager/components/manager/button/PackUninstallButton.vue' import PackIcon from '@/workbench/extensions/manager/components/manager/packIcon/PackIcon.vue' +import { useConflictDetection } from '@/workbench/extensions/manager/composables/useConflictDetection' import { useComfyManagerStore } from '@/workbench/extensions/manager/stores/comfyManagerStore' const { nodePacks, hasConflict } = defineProps<{ diff --git a/src/workbench/extensions/manager/components/manager/infoPanel/InfoPanelMultiItem.vue b/src/workbench/extensions/manager/components/manager/infoPanel/InfoPanelMultiItem.vue index cf1a75436..97ce03337 100644 --- a/src/workbench/extensions/manager/components/manager/infoPanel/InfoPanelMultiItem.vue +++ b/src/workbench/extensions/manager/components/manager/infoPanel/InfoPanelMultiItem.vue @@ -57,9 +57,6 @@ import { useAsyncState } from '@vueuse/core' import { computed, onUnmounted, provide, toRef } from 'vue' -import { usePacksSelection } from '@/composables/nodePack/usePacksSelection' -import { usePacksStatus } from '@/composables/nodePack/usePacksStatus' -import { useConflictDetection } from '@/composables/useConflictDetection' import { useComfyRegistryStore } from '@/stores/comfyRegistryStore' import type { components } from '@/types/comfyRegistryTypes' import type { ConflictDetail } from '@/types/conflictDetectionTypes' @@ -70,6 +67,9 @@ import PackUninstallButton from '@/workbench/extensions/manager/components/manag import InfoPanelHeader from '@/workbench/extensions/manager/components/manager/infoPanel/InfoPanelHeader.vue' import MetadataRow from '@/workbench/extensions/manager/components/manager/infoPanel/MetadataRow.vue' import PackIconStacked from '@/workbench/extensions/manager/components/manager/packIcon/PackIconStacked.vue' +import { usePacksSelection } from '@/workbench/extensions/manager/composables/nodePack/usePacksSelection' +import { usePacksStatus } from '@/workbench/extensions/manager/composables/nodePack/usePacksStatus' +import { useConflictDetection } from '@/workbench/extensions/manager/composables/useConflictDetection' const { nodePacks } = defineProps<{ nodePacks: components['schemas']['Node'][] diff --git a/src/workbench/extensions/manager/components/manager/infoPanel/tabs/WarningTabPanel.vue b/src/workbench/extensions/manager/components/manager/infoPanel/tabs/WarningTabPanel.vue index a992975f8..7868855e6 100644 --- a/src/workbench/extensions/manager/components/manager/infoPanel/tabs/WarningTabPanel.vue +++ b/src/workbench/extensions/manager/components/manager/infoPanel/tabs/WarningTabPanel.vue @@ -27,11 +27,11 @@