Skip to content

Commit 4247668

Browse files
fix: Restore correct interfaces from PR #3367
- Restore original useManagerQueue, useServerLogs, and comfyManagerService interfaces - Restore original component implementations for ManagerProgressDialogContent and ManagerProgressHeader - Fix all TypeScript interface compatibility issues by using original PR implementations - Remove duplicate setting that was causing runtime errors This fixes merge errors where interfaces were incorrectly mixed between old and new implementations.
1 parent 231a866 commit 4247668

File tree

11 files changed

+2053
-4399
lines changed

11 files changed

+2053
-4399
lines changed

CLAUDE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ Key Nx features:
5454
- Add "Fixes #n" to PR descriptions
5555
- Never mention Claude/AI in commits
5656

57+
### Git Conflict Resolution
58+
59+
**pnpm-lock.yaml and pnpm-workspace.yaml conflicts:**
60+
- Always use main's version: `git checkout --theirs pnpm-lock.yaml pnpm-workspace.yaml`
61+
- Manager migration work doesn't involve package.json changes
62+
- Avoids unnecessary merge conflicts in lock files
63+
5764
## External Resources
5865

5966
- PrimeVue docs: <https://primevue.org>

MANAGER_MIGRATION_BACKUPS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ This document tracks backup branches created during the manager migration recove
1818
- Updated type definitions and store interfaces
1919
- Resolved merge conflicts and formatting fixes
2020

21+
### `manager-migration-clean-tested`
22+
- **Created**: 2025-08-30
23+
- **Source Branch**: `manager-migration-clean`
24+
- **Source Commit**: `380f335bf` - "feat: Integrate ComfyUI Manager migration with v2 API and enhanced UI"
25+
- **Purpose**: Backup before manual testing via dev server
26+
- **Contains**:
27+
- Single squashed commit with complete manager migration
28+
- All recovered functionality from PR #3367
29+
- v2 API integration and enhanced UI components
30+
- Resolved TypeScript issues and quality checks passed
31+
- Clean, production-ready state ready for manual testing
32+
2133
### `manager-migration-upstream-backup`
2234
- **Created**: Earlier in recovery process
2335
- **Purpose**: Backup of upstream state before major changes

pnpm-lock.yaml

Lines changed: 1845 additions & 3572 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/dialog/content/ManagerProgressDialogContent.vue

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
'max-h-0': !isExpanded
1919
}"
2020
>
21-
<div v-for="(log, index) in focusedLogs" :key="index">
21+
<div v-for="(panel, index) in taskPanels" :key="index">
2222
<Panel
2323
:expanded="collapsedPanels[index] || false"
2424
toggleable
@@ -27,7 +27,7 @@
2727
<template #header>
2828
<div class="flex items-center justify-between w-full py-2">
2929
<div class="flex flex-col text-sm font-medium leading-normal">
30-
<span>{{ log.taskName }}</span>
30+
<span>{{ panel.taskName }}</span>
3131
<span class="text-muted">
3232
{{
3333
isInProgress(index)
@@ -52,24 +52,24 @@
5252
</template>
5353
<div
5454
:ref="
55-
index === focusedLogs.length - 1
55+
index === taskPanels.length - 1
5656
? (el) => (lastPanelRef = el as HTMLElement)
5757
: undefined
5858
"
5959
class="overflow-y-auto h-64 rounded-lg bg-black"
6060
:class="{
61-
'h-64': index !== focusedLogs.length - 1,
62-
'flex-grow': index === focusedLogs.length - 1
61+
'h-64': index !== taskPanels.length - 1,
62+
'flex-grow': index === taskPanels.length - 1
6363
}"
6464
@scroll="handleScroll"
6565
>
6666
<div class="h-full">
6767
<div
68-
v-for="(logLine, logIndex) in log.logs"
68+
v-for="(log, logIndex) in panel.logs"
6969
:key="logIndex"
7070
class="text-neutral-400 dark-theme:text-muted"
7171
>
72-
<pre class="whitespace-pre-wrap break-words">{{ logLine }}</pre>
72+
<pre class="whitespace-pre-wrap break-words">{{ log }}</pre>
7373
</div>
7474
</div>
7575
</div>
@@ -90,23 +90,17 @@ import {
9090
useManagerProgressDialogStore
9191
} from '@/stores/comfyManagerStore'
9292
93-
const comfyManagerStore = useComfyManagerStore()
93+
const { taskLogs } = useComfyManagerStore()
9494
const progressDialogContent = useManagerProgressDialogStore()
95+
const managerStore = useComfyManagerStore()
9596
9697
const isInProgress = (index: number) =>
97-
index === comfyManagerStore.managerQueue.historyCount - 1 &&
98-
comfyManagerStore.isLoading
98+
index === taskPanels.value.length - 1 && managerStore.uncompletedCount > 0
9999
100+
const taskPanels = computed(() => taskLogs)
100101
const isExpanded = computed(() => progressDialogContent.isExpanded)
101102
const isCollapsed = computed(() => !isExpanded.value)
102103
103-
const focusedLogs = computed(() => {
104-
if (progressDialogContent.getActiveTabIndex() === 0) {
105-
return comfyManagerStore.succeededTasksLogs
106-
}
107-
return comfyManagerStore.failedTasksLogs
108-
})
109-
110104
const collapsedPanels = ref<Record<number, boolean>>({})
111105
const togglePanel = (index: number) => {
112106
collapsedPanels.value[index] = !collapsedPanels.value[index]
@@ -121,7 +115,7 @@ const { y: scrollY } = useScroll(sectionsContainerRef, {
121115
122116
const lastPanelRef = ref<HTMLElement | null>(null)
123117
const isUserScrolling = ref(false)
124-
const lastPanelLogs = computed(() => focusedLogs.value?.at(-1)?.logs)
118+
const lastPanelLogs = computed(() => taskPanels.value?.at(-1)?.logs)
125119
126120
const isAtBottom = (el: HTMLElement | null) => {
127121
if (!el) return false

src/components/dialog/header/ManagerProgressHeader.vue

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,16 @@
1818

1919
<script setup lang="ts">
2020
import TabMenu from 'primevue/tabmenu'
21-
import { computed } from 'vue'
21+
import { ref } from 'vue'
2222
import { useI18n } from 'vue-i18n'
2323
24-
import {
25-
useComfyManagerStore,
26-
useManagerProgressDialogStore
27-
} from '@/stores/comfyManagerStore'
24+
import { useManagerProgressDialogStore } from '@/stores/comfyManagerStore'
2825
2926
const progressDialogContent = useManagerProgressDialogStore()
30-
const comfyManagerStore = useComfyManagerStore()
31-
const activeTabIndex = computed({
32-
get: () => progressDialogContent.getActiveTabIndex(),
33-
set: (value: number) => progressDialogContent.setActiveTabIndex(value)
34-
})
27+
const activeTabIndex = ref(0)
3528
const { t } = useI18n()
36-
37-
const failedCount = computed(() => comfyManagerStore.failedTasksIds.length)
38-
39-
const queueSuffix = computed(() => {
40-
const queueLength = comfyManagerStore.managerQueue.queueLength
41-
if (queueLength === 0) {
42-
return ''
43-
}
44-
return ` (${queueLength})`
45-
})
46-
const failedSuffix = computed(() => {
47-
if (failedCount.value === 0) {
48-
return ''
49-
}
50-
return ` (${failedCount.value})`
51-
})
52-
53-
const tabs = computed(() => [
54-
{ label: t('manager.installationQueue') + queueSuffix.value },
55-
{ label: t('manager.failed') + failedSuffix.value }
56-
])
29+
const tabs = [
30+
{ label: t('manager.installationQueue') },
31+
{ label: t('manager.failed', { count: 0 }) }
32+
]
5733
</script>

src/composables/useServerLogs.ts

Lines changed: 14 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,24 @@
11
import { useEventListener } from '@vueuse/core'
2-
import { ref } from 'vue'
2+
import { onUnmounted, ref } from 'vue'
33

44
import { LogsWsMessage } from '@/schemas/apiSchema'
55
import { api } from '@/scripts/api'
6-
import { components } from '@/types/generatedManagerTypes'
76

87
const LOGS_MESSAGE_TYPE = 'logs'
9-
const MANAGER_WS_TASK_DONE_NAME = 'cm-task-completed'
10-
const MANAGER_WS_TASK_STARTED_NAME = 'cm-task-started'
11-
12-
type ManagerWsTaskDoneMsg = components['schemas']['MessageTaskDone']
13-
type ManagerWsTaskStartedMsg = components['schemas']['MessageTaskStarted']
148

159
interface UseServerLogsOptions {
16-
ui_id: string
1710
immediate?: boolean
1811
messageFilter?: (message: string) => boolean
1912
}
2013

21-
export const useServerLogs = (options: UseServerLogsOptions) => {
14+
export const useServerLogs = (options: UseServerLogsOptions = {}) => {
2215
const {
2316
immediate = false,
2417
messageFilter = (msg: string) => Boolean(msg.trim())
2518
} = options
2619

2720
const logs = ref<string[]>([])
28-
const isTaskStarted = ref(false)
29-
let stopLogs: ReturnType<typeof useEventListener> | null = null
30-
let stopTaskDone: ReturnType<typeof useEventListener> | null = null
31-
let stopTaskStarted: ReturnType<typeof useEventListener> | null = null
21+
let stop: ReturnType<typeof useEventListener> | null = null
3222

3323
const isValidLogEvent = (event: CustomEvent<LogsWsMessage>) =>
3424
event?.type === LOGS_MESSAGE_TYPE && event.detail?.entries?.length > 0
@@ -37,81 +27,34 @@ export const useServerLogs = (options: UseServerLogsOptions) => {
3727
event.detail.entries.map((e) => e.m).filter(messageFilter)
3828

3929
const handleLogMessage = (event: CustomEvent<LogsWsMessage>) => {
40-
// Only capture logs if this task has started
41-
if (!isTaskStarted.value) return
42-
4330
if (isValidLogEvent(event)) {
44-
const messages = parseLogMessage(event)
45-
if (messages.length > 0) {
46-
logs.value.push(...messages)
47-
}
48-
}
49-
}
50-
51-
const handleTaskStarted = (event: CustomEvent<ManagerWsTaskStartedMsg>) => {
52-
if (event?.type === MANAGER_WS_TASK_STARTED_NAME) {
53-
// Check if this is our task starting
54-
const isOurTask = event.detail.ui_id === options.ui_id
55-
if (isOurTask) {
56-
isTaskStarted.value = true
57-
void stopTaskStarted?.()
58-
}
31+
logs.value.push(...parseLogMessage(event))
5932
}
6033
}
6134

62-
const handleTaskDone = (event: CustomEvent<ManagerWsTaskDoneMsg>) => {
63-
if (event?.type === MANAGER_WS_TASK_DONE_NAME) {
64-
const { state } = event.detail
65-
// Check if our task is now in the history (completed)
66-
const isOurTaskDone = state.history[options.ui_id]
67-
if (isOurTaskDone) {
68-
isTaskStarted.value = false
69-
void stopListening()
70-
}
71-
}
72-
}
73-
74-
const startListening = async () => {
35+
const start = async () => {
7536
await api.subscribeLogs(true)
76-
stopLogs = useEventListener(api, LOGS_MESSAGE_TYPE, handleLogMessage)
77-
stopTaskStarted = useEventListener(
78-
api,
79-
MANAGER_WS_TASK_STARTED_NAME,
80-
handleTaskStarted
81-
)
82-
stopTaskDone = useEventListener(
83-
api,
84-
MANAGER_WS_TASK_DONE_NAME,
85-
handleTaskDone
86-
)
37+
stop = useEventListener(api, LOGS_MESSAGE_TYPE, handleLogMessage)
8738
}
8839

8940
const stopListening = async () => {
90-
stopLogs?.()
91-
stopTaskStarted?.()
92-
stopTaskDone?.()
93-
stopLogs = null
94-
stopTaskStarted = null
95-
stopTaskDone = null
96-
// TODO: move subscribe/unsubscribe logs to useManagerQueue. Subscribe when task starts if not already subscribed.
97-
// Unsubscribe ONLY when there are no tasks running or queued up and the only remaining task finishes.
98-
// await api.subscribeLogs(false)
41+
stop?.()
42+
stop = null
43+
await api.subscribeLogs(false)
9944
}
10045

10146
if (immediate) {
102-
void startListening()
47+
void start()
10348
}
10449

105-
const cleanup = async () => {
50+
onUnmounted(async () => {
10651
await stopListening()
10752
logs.value = []
108-
isTaskStarted.value = false
109-
}
53+
})
11054

11155
return {
11256
logs,
113-
startListening,
114-
stopListening,
115-
cleanup
57+
startListening: start,
58+
stopListening
11659
}
11760
}

src/constants/coreSettings.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -935,12 +935,5 @@ export const CORE_SETTINGS: SettingParams[] = [
935935
name: 'Release seen timestamp',
936936
type: 'hidden',
937937
defaultValue: 0
938-
},
939-
{
940-
id: 'Comfy.Memory.AllowManualUnload',
941-
name: 'Allow manual unload of models and execution cache via user command',
942-
type: 'hidden',
943-
defaultValue: true,
944-
versionAdded: '1.18.0'
945938
}
946939
]

0 commit comments

Comments
 (0)