Add save/save as to breadcrumb root item (#5213)

This commit is contained in:
pythongosssss
2025-09-02 07:41:07 +01:00
committed by GitHub
parent f215872e2e
commit b091f3aa08

View File

@@ -107,6 +107,7 @@ const rename = async (
} }
} }
const isRoot = props.item.key === 'root'
const menuItems = computed<MenuItem[]>(() => { const menuItems = computed<MenuItem[]>(() => {
return [ return [
{ {
@@ -120,7 +121,27 @@ const menuItems = computed<MenuItem[]>(() => {
command: async () => { command: async () => {
await workflowService.duplicateWorkflow(workflowStore.activeWorkflow!) await workflowService.duplicateWorkflow(workflowStore.activeWorkflow!)
}, },
visible: props.item.key === 'root' visible: isRoot
},
{
separator: true,
visible: isRoot
},
{
label: t('menuLabels.Save'),
icon: 'pi pi-save',
command: async () => {
await useCommandStore().execute('Comfy.SaveWorkflow')
},
visible: isRoot
},
{
label: t('menuLabels.Save As'),
icon: 'pi pi-save',
command: async () => {
await useCommandStore().execute('Comfy.SaveWorkflowAs')
},
visible: isRoot
}, },
{ {
separator: true separator: true
@@ -134,7 +155,7 @@ const menuItems = computed<MenuItem[]>(() => {
}, },
{ {
separator: true, separator: true,
visible: props.item.key === 'root' visible: isRoot
}, },
{ {
label: t('breadcrumbsMenu.deleteWorkflow'), label: t('breadcrumbsMenu.deleteWorkflow'),
@@ -142,7 +163,7 @@ const menuItems = computed<MenuItem[]>(() => {
command: async () => { command: async () => {
await workflowService.deleteWorkflow(workflowStore.activeWorkflow!) await workflowService.deleteWorkflow(workflowStore.activeWorkflow!)
}, },
visible: props.item.key === 'root' visible: isRoot
} }
] ]
}) })