Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5c4f87b
fix: Replace reactive feature flags with non-reactive approach
viva-jinyi Sep 3, 2025
404585b
fix: Add HelpCenter manager state handling and API version switching
viva-jinyi Sep 3, 2025
f4fae6d
fix: Simplify manager state determination and fix API timing issues
viva-jinyi Sep 3, 2025
6d1d864
fix: Correct manager state determination for non-v4 servers
viva-jinyi Sep 3, 2025
13f156f
chore: Remove debug console.log statements
viva-jinyi Sep 3, 2025
775faa0
test: Update manager state store tests to match new logic
viva-jinyi Sep 3, 2025
6d8ed5c
fix: Remove dynamic API version handling in manager service
viva-jinyi Sep 4, 2025
896eb37
refactor: Add helper functions to managerStateStore for better code r…
viva-jinyi Sep 4, 2025
ad29891
fix: Ensure SystemStats is loaded before conflict detection
viva-jinyi Sep 4, 2025
5b6d6f1
docs: Clarify feature flag default behavior in manager state
viva-jinyi Sep 4, 2025
e5fb47f
fix: Ensure consistent manager state handling for legacy commands
viva-jinyi Sep 4, 2025
2df02e0
refactor: centralize manager opening logic into managerStateStore
viva-jinyi Sep 4, 2025
fe139af
fix: use correct i18n import in managerStateStore
viva-jinyi Sep 4, 2025
abeed2e
feature: initial tab fix
viva-jinyi Sep 4, 2025
4603ca3
test: Fix managerStateStore test failures by adding missing mocks
viva-jinyi Sep 4, 2025
5de7788
refactor: convert managerStateStore to composable
viva-jinyi Sep 5, 2025
4098d34
refactor: use readonly computed properties instead of getter methods
viva-jinyi Sep 5, 2025
dd17988
fix: check isManagerEnabled check to GraphCanvas.vue to avoid the sid…
viva-jinyi Sep 5, 2025
61058a8
chore: console.log to console.debug
viva-jinyi Sep 5, 2025
1bdc990
chore: useConflictDetection().initializeConflictDetection()
viva-jinyi Sep 5, 2025
2386dec
test: add mockManagerDisabled option to disable manager in Playwright…
viva-jinyi Sep 5, 2025
aef2b7b
chore: text modified
viva-jinyi Sep 5, 2025
2cadf05
fix: resolve CI/CD failures by fixing manager initialization timing
viva-jinyi Sep 5, 2025
91c6c87
chore: modified the note
viva-jinyi Sep 5, 2025
75db082
fix: test code modified
viva-jinyi Sep 5, 2025
2b42259
fix: when manager is new manager ui, conflict detectetion should work
viva-jinyi Sep 5, 2025
9634186
fix: ensure fetch system stats before determine manager stats & when …
viva-jinyi Sep 6, 2025
ecbb78d
chore: unnecessary .value deleted & fetch name modified to refetch
viva-jinyi Sep 6, 2025
647a0f2
fix: ref type .value needed
viva-jinyi Sep 6, 2025
c9dd3de
chore: vue use until pattern for waiting initializing
viva-jinyi Sep 6, 2025
3f2ccd8
fix: .value added
viva-jinyi Sep 6, 2025
a363cdc
fix: useManagerState test to properly mock reactive refs
viva-jinyi Sep 6, 2025
1974b1f
fix: when system stats initialized, use until(systemStatsStore.isInit…
viva-jinyi Sep 6, 2025
eda2bf9
fix: test
viva-jinyi Sep 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: convert managerStateStore to composable
- Move managerStateStore from store to composable pattern
- All functions are non-reactive utilities that don't need state management
- Follows Pinia guideline: "If it's not reactive, it shouldn't be in a store"
- Update all import paths across 8 files
- Move and update test file accordingly

This change improves architecture consistency as other utility functions
in the codebase also use composables rather than stores when reactivity
is not required.
  • Loading branch information
viva-jinyi committed Sep 6, 2025
commit 5de7788eac22beaa02b5e762526ad154735d378d
11 changes: 5 additions & 6 deletions src/components/dialog/content/LoadWorkflowWarning.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ import { computed } from 'vue'
import NoResultsPlaceholder from '@/components/common/NoResultsPlaceholder.vue'
import MissingCoreNodesMessage from '@/components/dialog/content/MissingCoreNodesMessage.vue'
import { useMissingNodes } from '@/composables/nodePack/useMissingNodes'
import { useManagerState } from '@/composables/useManagerState'
import { useComfyManagerStore } from '@/stores/comfyManagerStore'
import { useManagerStateStore } from '@/stores/managerStateStore'
import type { MissingNodeType } from '@/types/comfy'
import { ManagerTab } from '@/types/comfyManagerTypes'

Expand All @@ -74,6 +74,7 @@ const { missingNodePacks, isLoading, error, missingCoreNodes } =
useMissingNodes()

const comfyManagerStore = useComfyManagerStore()
const managerState = useManagerState()

// Check if any of the missing packs are currently being installed
const isInstalling = computed(() => {
Expand Down Expand Up @@ -104,20 +105,18 @@ const uniqueNodes = computed(() => {
})
})

const managerStateStore = useManagerStateStore()

// Show manager buttons unless manager is disabled
const showManagerButtons = computed(() => {
return managerStateStore.shouldShowManagerButtons()
return managerState.shouldShowManagerButtons()
})

// Only show Install All button for NEW_UI (new manager with v4 support)
const showInstallAllButton = computed(() => {
return managerStateStore.shouldShowInstallButton()
return managerState.shouldShowInstallButton()
})

const openManager = async () => {
await managerStateStore.openManager({
await managerState.openManager({
initialTab: ManagerTab.Missing,
showToastOnLegacyError: true
})
Expand Down
4 changes: 2 additions & 2 deletions src/components/helpcenter/HelpCenterMenuContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ import { useI18n } from 'vue-i18n'

import PuzzleIcon from '@/components/icons/PuzzleIcon.vue'
import { useConflictAcknowledgment } from '@/composables/useConflictAcknowledgment'
import { useManagerState } from '@/composables/useManagerState'
import { type ReleaseNote } from '@/services/releaseService'
import { useCommandStore } from '@/stores/commandStore'
import { useManagerStateStore } from '@/stores/managerStateStore'
import { useReleaseStore } from '@/stores/releaseStore'
import { useSettingStore } from '@/stores/settingStore'
import { ManagerTab } from '@/types/comfyManagerTypes'
Expand Down Expand Up @@ -314,7 +314,7 @@ const menuItems = computed<MenuItem[]>(() => {
label: t('helpCenter.managerExtension'),
showRedDot: shouldShowManagerRedDot.value,
action: async () => {
await useManagerStateStore().openManager({
await useManagerState().openManager({
initialTab: ManagerTab.All,
showToastOnLegacyError: false
})
Expand Down
8 changes: 4 additions & 4 deletions src/components/topbar/CommandMenubar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ import { useI18n } from 'vue-i18n'
import SubgraphBreadcrumb from '@/components/breadcrumb/SubgraphBreadcrumb.vue'
import SettingDialogContent from '@/components/dialog/content/SettingDialogContent.vue'
import SettingDialogHeader from '@/components/dialog/header/SettingDialogHeader.vue'
import { useManagerState } from '@/composables/useManagerState'
import { useColorPaletteService } from '@/services/colorPaletteService'
import { useCommandStore } from '@/stores/commandStore'
import { useDialogStore } from '@/stores/dialogStore'
import { useManagerStateStore } from '@/stores/managerStateStore'
import { useMenuItemStore } from '@/stores/menuItemStore'
import { useSettingStore } from '@/stores/settingStore'
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
Expand All @@ -103,6 +103,8 @@ const dialogStore = useDialogStore()
const settingStore = useSettingStore()
const { t } = useI18n()

const managerState = useManagerState()

const menuRef = ref<
({ dirty: boolean } & TieredMenuMethods & TieredMenuState) | null
>(null)
Expand Down Expand Up @@ -135,10 +137,8 @@ const showSettings = (defaultPanel?: string) => {
})
}

const managerStateStore = useManagerStateStore()

const showManageExtensions = async () => {
await managerStateStore.openManager({
await managerState.openManager({
initialTab: ManagerTab.All,
showToastOnLegacyError: false
})
Expand Down
6 changes: 3 additions & 3 deletions src/composables/useConflictDetection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { computed, getCurrentInstance, onUnmounted, readonly, ref } from 'vue'

import { useInstalledPacks } from '@/composables/nodePack/useInstalledPacks'
import { useConflictAcknowledgment } from '@/composables/useConflictAcknowledgment'
import { useManagerState } from '@/composables/useManagerState'
import config from '@/config'
import { useComfyManagerService } from '@/services/comfyManagerService'
import { useComfyRegistryService } from '@/services/comfyRegistryService'
import { useComfyManagerStore } from '@/stores/comfyManagerStore'
import { useConflictDetectionStore } from '@/stores/conflictDetectionStore'
import { useManagerStateStore } from '@/stores/managerStateStore'
import { useSystemStatsStore } from '@/stores/systemStatsStore'
import type { SystemStats } from '@/types'
import type { components } from '@/types/comfyRegistryTypes'
Expand Down Expand Up @@ -638,8 +638,8 @@ export function useConflictDetection() {
async function initializeConflictDetection(): Promise<void> {
try {
// Check if manager is disabled before running conflict detection
const managerStore = useManagerStateStore()
if (!managerStore.isManagerEnabled()) {
const managerState = useManagerState()
if (!managerState.isManagerEnabled()) {
console.log(
'[ConflictDetection] Manager is disabled, skipping conflict detection'
)
Expand Down
21 changes: 9 additions & 12 deletions src/composables/useCoreCommands.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useFirebaseAuthActions } from '@/composables/auth/useFirebaseAuthActions'
import { useSelectedLiteGraphItems } from '@/composables/canvas/useSelectedLiteGraphItems'
import { ManagerUIState, useManagerState } from '@/composables/useManagerState'
import { useModelSelectorDialog } from '@/composables/useModelSelectorDialog'
import {
DEFAULT_DARK_COLOR_PALETTE,
Expand All @@ -24,10 +25,6 @@ import { useExecutionStore } from '@/stores/executionStore'
import { useCanvasStore, useTitleEditorStore } from '@/stores/graphStore'
import { useHelpCenterStore } from '@/stores/helpCenterStore'
import { useNodeOutputStore } from '@/stores/imagePreviewStore'
import {
ManagerUIState,
useManagerStateStore
} from '@/stores/managerStateStore'
import { useQueueSettingsStore, useQueueStore } from '@/stores/queueStore'
import { useSettingStore } from '@/stores/settingStore'
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
Expand Down Expand Up @@ -731,7 +728,7 @@ export function useCoreCommands(): ComfyCommand[] {
label: 'Custom Nodes Manager',
versionAdded: '1.12.10',
function: async () => {
await useManagerStateStore().openManager({
await useManagerState().openManager({
showToastOnLegacyError: true
})
}
Expand All @@ -742,8 +739,8 @@ export function useCoreCommands(): ComfyCommand[] {
label: 'Check for Custom Node Updates',
versionAdded: '1.17.0',
function: async () => {
const managerStore = useManagerStateStore()
const state = managerStore.getManagerUIState()
const managerState = useManagerState()
const state = managerState.getManagerUIState()

// For DISABLED state, show error toast instead of opening settings
if (state === ManagerUIState.DISABLED) {
Expand All @@ -756,7 +753,7 @@ export function useCoreCommands(): ComfyCommand[] {
return
}

await managerStore.openManager({
await managerState.openManager({
initialTab: ManagerTab.UpdateAvailable,
showToastOnLegacyError: false
})
Expand All @@ -768,7 +765,7 @@ export function useCoreCommands(): ComfyCommand[] {
label: 'Install Missing Custom Nodes',
versionAdded: '1.17.0',
function: async () => {
await useManagerStateStore().openManager({
await useManagerState().openManager({
initialTab: ManagerTab.Missing,
showToastOnLegacyError: false
})
Expand Down Expand Up @@ -878,7 +875,7 @@ export function useCoreCommands(): ComfyCommand[] {
icon: 'mdi mdi-puzzle-outline',
label: 'Manager',
function: async () => {
await useManagerStateStore().openManager({
await useManagerState().openManager({
initialTab: ManagerTab.All,
showToastOnLegacyError: false
})
Expand Down Expand Up @@ -946,7 +943,7 @@ export function useCoreCommands(): ComfyCommand[] {
label: 'Custom Nodes (Legacy)',
versionAdded: '1.16.4',
function: async () => {
await useManagerStateStore().openManager({
await useManagerState().openManager({
legacyCommand: 'Comfy.Manager.CustomNodesManager.ToggleVisibility',
showToastOnLegacyError: true,
isLegacyOnly: true
Expand All @@ -959,7 +956,7 @@ export function useCoreCommands(): ComfyCommand[] {
label: 'Manager Menu (Legacy)',
versionAdded: '1.16.4',
function: async () => {
await useManagerStateStore().openManager({
await useManagerState().openManager({
showToastOnLegacyError: true,
isLegacyOnly: true
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { defineStore } from 'pinia'

import { t } from '@/i18n'
import { api } from '@/scripts/api'
import { useDialogService } from '@/services/dialogService'
Expand All @@ -14,7 +12,7 @@ export enum ManagerUIState {
NEW_UI = 'new'
}

export const useManagerStateStore = defineStore('managerState', () => {
export function useManagerState() {
const systemStatsStore = useSystemStatsStore()

/**
Expand Down Expand Up @@ -179,4 +177,4 @@ export const useManagerStateStore = defineStore('managerState', () => {
shouldShowManagerButtons,
openManager
}
})
}
6 changes: 3 additions & 3 deletions src/services/comfyManagerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import axios, { AxiosError, AxiosResponse } from 'axios'
import { v4 as uuidv4 } from 'uuid'
import { ref } from 'vue'

import { useManagerState } from '@/composables/useManagerState'
import { api } from '@/scripts/api'
import { useManagerStateStore } from '@/stores/managerStateStore'
import { components } from '@/types/generatedManagerTypes'
import { isAbortError } from '@/utils/typeGuardUtil'

Expand Down Expand Up @@ -54,8 +54,8 @@ export const useComfyManagerService = () => {

// Check if manager service should be available
const isManagerServiceAvailable = () => {
const managerStore = useManagerStateStore()
return managerStore.isNewManagerUI()
const managerState = useManagerState()
return managerState.isNewManagerUI()
}

const handleRequestError = (
Expand Down
Loading