Skip to content

Commit 6ea021d

Browse files
feat: Auto-close LoadWorkflowWarning dialog when all missing nodes are installed (#5321)
* feat: Auto-close LoadWorkflowWarning dialog when all missing nodes are installed - Add computed property to check if all missing nodes are installed - Watch for completion and automatically close dialog with 500ms delay - Show success toast notification when installation completes - Add translation key for success message This improves UX by automatically dismissing the warning dialog once the user has successfully installed all missing nodes through the manager. * fix: settimeout to nexttick * [auto-fix] Apply ESLint and Prettier fixes --------- Co-authored-by: GitHub Action <[email protected]>
1 parent 7245213 commit 6ea021d

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

src/components/dialog/content/LoadWorkflowWarning.vue

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,16 @@
5353
<script setup lang="ts">
5454
import Button from 'primevue/button'
5555
import ListBox from 'primevue/listbox'
56-
import { computed } from 'vue'
56+
import { computed, nextTick, watch } from 'vue'
57+
import { useI18n } from 'vue-i18n'
5758
5859
import NoResultsPlaceholder from '@/components/common/NoResultsPlaceholder.vue'
5960
import MissingCoreNodesMessage from '@/components/dialog/content/MissingCoreNodesMessage.vue'
6061
import { useMissingNodes } from '@/composables/nodePack/useMissingNodes'
6162
import { useManagerState } from '@/composables/useManagerState'
6263
import { useComfyManagerStore } from '@/stores/comfyManagerStore'
64+
import { useDialogStore } from '@/stores/dialogStore'
65+
import { useToastStore } from '@/stores/toastStore'
6366
import type { MissingNodeType } from '@/types/comfy'
6467
import { ManagerTab } from '@/types/comfyManagerTypes'
6568
@@ -121,6 +124,35 @@ const openManager = async () => {
121124
showToastOnLegacyError: true
122125
})
123126
}
127+
128+
const { t } = useI18n()
129+
const dialogStore = useDialogStore()
130+
131+
// Computed to check if all missing nodes have been installed
132+
const allMissingNodesInstalled = computed(() => {
133+
return (
134+
!isLoading.value &&
135+
!isInstalling.value &&
136+
missingNodePacks.value?.length === 0
137+
)
138+
})
139+
// Watch for completion and close dialog
140+
watch(allMissingNodesInstalled, async (allInstalled) => {
141+
if (allInstalled) {
142+
// Use nextTick to ensure state updates are complete
143+
await nextTick()
144+
145+
dialogStore.closeDialog({ key: 'global-load-workflow-warning' })
146+
147+
// Show success toast
148+
useToastStore().add({
149+
severity: 'success',
150+
summary: t('g.success'),
151+
detail: t('manager.allMissingNodesInstalled'),
152+
life: 3000
153+
})
154+
}
155+
})
124156
</script>
125157

126158
<style scoped>

src/locales/en/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@
213213
"noDescription": "No description available",
214214
"installSelected": "Install Selected",
215215
"installAllMissingNodes": "Install All Missing Nodes",
216+
"allMissingNodesInstalled": "All missing nodes have been successfully installed",
216217
"packsSelected": "packs selected",
217218
"mixedSelectionMessage": "Cannot perform bulk action on mixed selection",
218219
"notAvailable": "Not Available",

0 commit comments

Comments
 (0)