-
Notifications
You must be signed in to change notification settings - Fork 451
feat: Auto-close LoadWorkflowWarning dialog when all missing nodes are installed #5321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…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
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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' | ||
|
|
@@ -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[] | ||
|
|
@@ -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) { | ||
| // 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) | ||
|
||
| } | ||
| }) | ||
| </script> | ||
|
|
||
| <style scoped> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't
missingNodePacks.value !== nullimplied by allMissingNodesInstalled?There was a problem hiding this comment.
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: