[backport core/1.42] fix: create initial workflow tab when persistence is disabled (#10568)

Backport of #10565 to `core/1.42`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-10568-backport-core-1-42-fix-create-initial-workflow-tab-when-persistence-is-disabled-32f6d73d365081d59e51ec183c61b7c7)
by [Unito](https://www.unito.io)

Co-authored-by: jaeone94 <89377375+jaeone94@users.noreply.github.com>
Co-authored-by: Alexander Brown <drjkl@comfy.org>
This commit is contained in:
Comfy Org PR Bot
2026-03-27 03:50:18 +09:00
committed by GitHub
parent c95c0e9614
commit ccc2758343
2 changed files with 18 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ import type { ComfyPage } from '../fixtures/ComfyPage'
import { DefaultGraphPositions } from '../fixtures/constants/defaultGraphPositions'
import { TestIds } from '../fixtures/selectors'
import type { NodeReference } from '../fixtures/utils/litegraphUtils'
import type { WorkspaceStore } from '../types/globals'
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
@@ -720,6 +721,19 @@ test.describe('Load workflow', { tag: '@screenshot' }, () => {
await expect(comfyPage.canvas).toHaveScreenshot('string_input.png')
})
test('Creates initial workflow tab when persistence is disabled', async ({
comfyPage
}) => {
await comfyPage.settings.setSetting('Comfy.Workflow.Persist', false)
await comfyPage.setup()
const openCount = await comfyPage.page.evaluate(() => {
return (window.app!.extensionManager as WorkspaceStore).workflow
.openWorkflows.length
})
expect(openCount).toBeGreaterThanOrEqual(1)
})
test('Restore workflow on reload (switch workflow)', async ({
comfyPage
}) => {

View File

@@ -171,7 +171,10 @@ export function useWorkflowPersistenceV2() {
}
const initializeWorkflow = async () => {
if (!workflowPersistenceEnabled.value) return
if (!workflowPersistenceEnabled.value) {
await loadDefaultWorkflow()
return
}
try {
const restored = await loadPreviousWorkflowFromStorage()