Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Next Next commit
feat: Auto-close LoadWorkflowWarning dialog when all missing nodes ar…
…e 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.
  • Loading branch information
viva-jinyi committed Sep 10, 2025
commit c507a6f8e4e1f700534fef71c7ed08219a587274
35 changes: 34 additions & 1 deletion src/components/dialog/content/LoadWorkflowWarning.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
<script setup lang="ts">
import Button from 'primevue/button'
import ListBox from 'primevue/listbox'
import { computed } from 'vue'
import { computed, watch } from 'vue'
import { useI18n } from 'vue-i18n'

import NoResultsPlaceholder from '@/components/common/NoResultsPlaceholder.vue'
import MissingCoreNodesMessage from '@/components/dialog/content/MissingCoreNodesMessage.vue'
Expand All @@ -64,6 +65,8 @@ import type { MissingNodeType } from '@/types/comfy'
import { ManagerTab } from '@/types/comfyManagerTypes'

import PackInstallButton from './manager/button/PackInstallButton.vue'
import { useDialogStore } from '@/stores/dialogStore'
import { useToastStore } from '@/stores/toastStore'

const props = defineProps<{
missingNodeTypes: MissingNodeType[]
Expand Down Expand Up @@ -121,6 +124,36 @@ const openManager = async () => {
showToastOnLegacyError: true
})
}

const { t } = useI18n()
const dialogStore = useDialogStore()

// Computed to check if all missing nodes have been installed
const allMissingNodesInstalled = computed(() => {
return (
!isLoading.value &&
missingNodePacks.value?.length === 0 &&
!isInstalling.value
)
})

// Watch for completion and close dialog
watch(allMissingNodesInstalled, (allInstalled) => {
if (allInstalled && missingNodePacks.value !== null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't missingNodePacks.value !== null implied by allMissingNodesInstalled?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All missing nodes have been installed" means:

  • Loading has finished + No installation in progress + Zero missing packs remaining = true
  • If any condition is missing, the dialog may close at the wrong timing.

// Small delay to let the user see the completion
setTimeout(() => {
dialogStore.closeDialog({ key: 'global-load-workflow-warning' })

// Show success toast
useToastStore().add({
severity: 'success',
summary: t('g.success'),
detail: t('manager.allMissingNodesInstalled'),
life: 3000
})
}, 500)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we don't need the timeout if we are showing a toast anyway, WDYT?

If we are using a timeout, do you think we need to:

  1. clear it in unMounted or, alternatively, use https://vueuse.org/shared/useTimeout/
  2. add deduplication to prevent multiple queued calls

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the issue is a race condition with missingNodePacks changes -> missingNodePacks may not update fully until next tick, then we could just add nextTick() for now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will use nextTick to ensure state updates are complete.

}
})
</script>

<style scoped>
Expand Down
1 change: 1 addition & 0 deletions src/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
"noDescription": "No description available",
"installSelected": "Install Selected",
"installAllMissingNodes": "Install All Missing Nodes",
"allMissingNodesInstalled": "All missing nodes have been successfully installed",
"packsSelected": "packs selected",
"mixedSelectionMessage": "Cannot perform bulk action on mixed selection",
"notAvailable": "Not Available",
Expand Down