diff --git a/browser_tests/tests/firstRunTourRolePins.spec.ts b/browser_tests/tests/firstRunTourRolePins.spec.ts new file mode 100644 index 00000000000..a732f015bb9 --- /dev/null +++ b/browser_tests/tests/firstRunTourRolePins.spec.ts @@ -0,0 +1,86 @@ +import { expect } from '@playwright/test' + +import type { + ExportedSubgraph, + ISerialisedNode, + SerialisableGraph +} from '@/lib/litegraph/src/types/serialisation' +import { + MEDIA_KIND_BY_SINK_TYPE, + TOUR_ROLE_PINS +} from '@/renderer/extensions/firstRunTour/roles/tourRolePins' +import type { + RolePin, + RolePins +} from '@/renderer/extensions/firstRunTour/roles/tourRolePins' +import { templateApiFixture as test } from '@e2e/fixtures/templateApiFixture' + +const baseUrl = process.env.PLAYWRIGHT_TEST_URL || 'http://localhost:8188' + +const pinnedTemplates = Object.entries(TOUR_ROLE_PINS) + +function pinnedRoles(pins: RolePins): [string, RolePin][] { + const roles = { source: pins.source, prompt: pins.prompt, sink: pins.sink } + return Object.entries(roles).filter( + (entry): entry is [string, RolePin] => entry[1] !== undefined + ) +} + +/** Subgraph definitions nest, and so does the resolver's host-mapping. */ +function nodesOf( + graph: SerialisableGraph | ExportedSubgraph +): ISerialisedNode[] { + return [ + ...(graph.nodes ?? []), + ...(graph.definitions?.subgraphs ?? []).flatMap(nodesOf) + ] +} + +/** Ids are graph-local, so a nested same-id node would satisfy a match-first lookup. */ +function matchingNodes(workflow: SerialisableGraph, id: number) { + return nodesOf(workflow).filter((node) => String(node.id) === String(id)) +} + +test.describe('first-run tour role pins', { tag: '@workflow' }, () => { + test('every pinned node still exists with its pinned type', async ({ + request + }) => { + const unserved: string[] = [] + + for (const [templateId, pins] of pinnedTemplates) { + const url = new URL(`/templates/${templateId}.json`, baseUrl).toString() + const response = await request.get(url) + if (!response.ok()) { + unserved.push(templateId) + continue + } + + const workflow = (await response.json()) as SerialisableGraph + for (const [role, pin] of pinnedRoles(pins)) { + const matches = matchingNodes(workflow, pin.id) + expect( + matches, + `${templateId} pins its ${role} to node ${pin.id}, which this backend serves ${matches.length} times — a nested same-id node would resolve arbitrarily` + ).toHaveLength(1) + expect( + matches[0]?.type, + `${templateId} pins its ${role} to node ${pin.id}, which this backend no longer serves as a ${pin.type}` + ).toBe(pin.type) + } + + expect( + MEDIA_KIND_BY_SINK_TYPE[pins.sink.type], + `${templateId} pins a ${pins.sink.type} sink but claims mediaKind '${pins.mediaKind}', so the result step would preview the wrong medium` + ).toBe(pins.mediaKind) + } + if (unserved.length) + test.info().annotations.push({ + type: 'unserved templates', + description: `pins unverified, not served by this backend: ${unserved.join(', ')}` + }) + expect( + pinnedTemplates.length - unserved.length, + `only ${pinnedTemplates.length - unserved.length} pinned templates are served, so the grid cannot fill — unserved: ${unserved.join(', ')}` + ).toBeGreaterThan(2) + }) +}) diff --git a/src/components/graph/GraphCanvas.vue b/src/components/graph/GraphCanvas.vue index 426e6a44fbf..7e3bf14727e 100644 --- a/src/components/graph/GraphCanvas.vue +++ b/src/components/graph/GraphCanvas.vue @@ -179,6 +179,7 @@ import { useCanvasStore } from '@/renderer/core/canvas/canvasStore' import { useCanvasInteractions } from '@/renderer/core/canvas/useCanvasInteractions' import { layoutStore } from '@/renderer/core/layout/store/layoutStore' import TransformPane from '@/renderer/core/layout/transform/TransformPane.vue' +import { useFirstRunEntry } from '@/renderer/extensions/firstRunTour/gettingStarted/firstRunEntry' import MiniMap from '@/renderer/extensions/minimap/MiniMap.vue' import LGraphNode from '@/renderer/extensions/vueNodes/components/LGraphNode.vue' import { requestSlotLayoutSyncForAllNodes } from '@/renderer/extensions/vueNodes/composables/useSlotElementTracking' @@ -559,9 +560,10 @@ onMounted(async () => { ) // Restore saved workflow and workflow tabs state - await workflowPersistence.initializeWorkflow() + const startupOutcome = await workflowPersistence.initializeWorkflow() await workflowPersistence.restoreWorkflowTabsState() await workflowPersistence.loadTemplateFromUrlIfPresent() + await useFirstRunEntry().handleStartupOutcome(startupOutcome) } finally { workspaceStore.spinner = false } diff --git a/src/components/tab/TabList.vue b/src/components/tab/TabList.vue index 5b40484801f..744ee276214 100644 --- a/src/components/tab/TabList.vue +++ b/src/components/tab/TabList.vue @@ -1,5 +1,8 @@ @@ -7,8 +10,12 @@ diff --git a/src/renderer/extensions/firstRunTour/gettingStarted/GettingStartedCard.vue b/src/renderer/extensions/firstRunTour/gettingStarted/GettingStartedCard.vue new file mode 100644 index 00000000000..ad49facea27 --- /dev/null +++ b/src/renderer/extensions/firstRunTour/gettingStarted/GettingStartedCard.vue @@ -0,0 +1,106 @@ + + + diff --git a/src/renderer/extensions/firstRunTour/gettingStarted/GettingStartedScreen.test.ts b/src/renderer/extensions/firstRunTour/gettingStarted/GettingStartedScreen.test.ts new file mode 100644 index 00000000000..9211d751010 --- /dev/null +++ b/src/renderer/extensions/firstRunTour/gettingStarted/GettingStartedScreen.test.ts @@ -0,0 +1,233 @@ +import { createTestingPinia } from '@pinia/testing' +import userEvent from '@testing-library/user-event' +import { cleanup, render, screen, waitFor } from '@testing-library/vue' +import { setActivePinia } from 'pinia' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { createI18n } from 'vue-i18n' + +import enMessages from '@/locales/en/main.json' with { type: 'json' } + +import { CURATED_TEMPLATE_IDS, FALLBACK_TEMPLATE_IDS } from './tutorialCards' + +const mocks = vi.hoisted(() => ({ + dismiss: vi.fn(), + loadTemplate: vi.fn(), + loadCatalog: vi.fn(), + isLoaded: true, + toastAdd: vi.fn(), + loadingTemplateId: { value: null as string | null }, + catalog: [] as { name: string }[] +})) + +vi.mock('./firstRunEntry', () => ({ + useFirstRunEntry: () => ({ dismissGettingStarted: mocks.dismiss }) +})) + +vi.mock( + '@/platform/workflow/templates/composables/useTemplateWorkflows', + async () => { + const { ref } = await import('vue') + mocks.loadingTemplateId = ref(null) + return { + useTemplateWorkflows: () => ({ + loadWorkflowTemplate: mocks.loadTemplate, + loadingTemplateId: mocks.loadingTemplateId, + getTemplateThumbnailUrl: () => 'thumb.png', + getTemplateTitle: (template: { name: string }) => template.name + }) + } + } +) + +vi.mock( + '@/platform/workflow/templates/repositories/workflowTemplatesStore', + () => ({ + useWorkflowTemplatesStore: () => ({ + get isLoaded() { + return mocks.isLoaded + }, + get enhancedTemplates() { + return mocks.catalog + }, + loadWorkflowTemplates: mocks.loadCatalog, + getTemplateByName: (name: string) => + mocks.catalog.find((template) => template.name === name) + }) + }) +) + +vi.mock('@/platform/updates/common/toastStore', () => ({ + useToastStore: () => ({ add: mocks.toastAdd }) +})) + +const i18n = createI18n({ + legacy: false, + locale: 'en', + messages: { en: enMessages } +}) + +async function renderScreen() { + const { default: GettingStartedScreen } = + await import('./GettingStartedScreen.vue') + return render(GettingStartedScreen, { global: { plugins: [i18n] } }) +} + +describe('GettingStartedScreen', () => { + beforeEach(() => { + setActivePinia(createTestingPinia({ stubActions: false })) + vi.clearAllMocks() + mocks.isLoaded = true + mocks.catalog = CURATED_TEMPLATE_IDS.map((name) => ({ name })) + mocks.loadTemplate.mockResolvedValue(true) + mocks.loadCatalog.mockResolvedValue(undefined) + mocks.loadingTemplateId.value = null + }) + + afterEach(() => { + cleanup() + document.body.replaceChildren() + }) + + it('loads the chosen template and dismisses', async () => { + await renderScreen() + + await userEvent.click( + screen.getByTestId(`getting-started-card-${CURATED_TEMPLATE_IDS[0]}`) + ) + + await waitFor(() => + expect(mocks.loadTemplate).toHaveBeenCalledWith( + CURATED_TEMPLATE_IDS[0], + 'default' + ) + ) + expect(mocks.dismiss).toHaveBeenCalled() + }) + + it('ignores a second pick while one is still loading', async () => { + await renderScreen() + mocks.loadingTemplateId.value = CURATED_TEMPLATE_IDS[0] + + await userEvent.click( + screen.getByTestId(`getting-started-card-${CURATED_TEMPLATE_IDS[1]}`) + ) + + expect( + mocks.loadTemplate, + 'a second template loading over the first leaves the tour on the wrong graph' + ).not.toHaveBeenCalled() + }) + + describe('grid', () => { + it('fills from the catalog when no curated template survived a package skew', async () => { + mocks.catalog = [ + { name: 'skew-a' }, + { name: 'skew-b' }, + { name: 'skew-c' }, + { name: 'skew-d' }, + { name: 'skew-e' } + ] + + await renderScreen() + + expect( + screen.getAllByTestId(/^getting-started-card-skew-/), + 'A loaded catalog sharing none of the pinned ids must still fill the grid, not leave the user on empty space' + ).toHaveLength(CURATED_TEMPLATE_IDS.length) + }) + + it('keeps curated templates ahead of the ones it backfills', async () => { + mocks.catalog = [ + { name: 'catalog-filler' }, + { name: FALLBACK_TEMPLATE_IDS[0] }, + { name: CURATED_TEMPLATE_IDS[1] } + ] + + await renderScreen() + + const ids = screen + .getAllByTestId(/^getting-started-card-/) + .map((card) => card.getAttribute('data-testid')) + + expect( + ids, + 'the curated pick is the one the grid was designed around, so it must not be pushed out of the grid by catalog order' + ).toEqual([ + `getting-started-card-${CURATED_TEMPLATE_IDS[1]}`, + `getting-started-card-${FALLBACK_TEMPLATE_IDS[0]}`, + 'getting-started-card-catalog-filler' + ]) + }) + }) + + describe('exits', () => { + it('offers a blank-canvas action', async () => { + await renderScreen() + + await userEvent.click(screen.getByTestId('getting-started-blank')) + + expect( + mocks.dismiss, + 'A first-run user must always have a visible way out of the takeover' + ).toHaveBeenCalled() + }) + + it('exits on Escape', async () => { + await renderScreen() + + await userEvent.keyboard('{Escape}') + + expect( + mocks.dismiss, + 'Escape must follow the same safe dismissal path as the blank-canvas action' + ).toHaveBeenCalled() + }) + }) + + describe('failures', () => { + it('surfaces a failed template load and keeps the screen up to retry', async () => { + mocks.loadTemplate.mockResolvedValue(false) + await renderScreen() + + await userEvent.click( + screen.getByTestId(`getting-started-card-${CURATED_TEMPLATE_IDS[0]}`) + ) + + await waitFor(() => expect(mocks.toastAdd).toHaveBeenCalled()) + expect( + mocks.dismiss, + 'A failed load must not dismiss the screen; the user would be left on a bare canvas' + ).not.toHaveBeenCalled() + expect(screen.getByText(enMessages.gettingStarted.retry)).toBeTruthy() + }) + + it('retries a catalog load that resolved without loading anything', async () => { + mocks.isLoaded = false + await renderScreen() + + const retry = await screen.findByTestId( + 'getting-started-retry-catalog', + undefined, + { + timeout: 1000 + } + ) + mocks.loadCatalog.mockImplementation(() => { + mocks.isLoaded = true + return Promise.resolve(undefined) + }) + await userEvent.click(retry) + + expect( + mocks.loadCatalog, + 'The store swallows fetch errors and resolves with isLoaded false, so a failed catalog must be detected without a rejection' + ).toHaveBeenCalledTimes(2) + await waitFor(() => + expect( + screen.queryByTestId('getting-started-retry-catalog'), + 'A successful retry must replace the error state with the grid' + ).toBeNull() + ) + }) + }) +}) diff --git a/src/renderer/extensions/firstRunTour/gettingStarted/GettingStartedScreen.vue b/src/renderer/extensions/firstRunTour/gettingStarted/GettingStartedScreen.vue new file mode 100644 index 00000000000..81eaddd78b1 --- /dev/null +++ b/src/renderer/extensions/firstRunTour/gettingStarted/GettingStartedScreen.vue @@ -0,0 +1,241 @@ + + + diff --git a/src/renderer/extensions/firstRunTour/gettingStarted/GettingStartedTemplateCard.vue b/src/renderer/extensions/firstRunTour/gettingStarted/GettingStartedTemplateCard.vue new file mode 100644 index 00000000000..042db43dd93 --- /dev/null +++ b/src/renderer/extensions/firstRunTour/gettingStarted/GettingStartedTemplateCard.vue @@ -0,0 +1,38 @@ + + + diff --git a/src/renderer/extensions/firstRunTour/gettingStarted/firstRunEntry.test.ts b/src/renderer/extensions/firstRunTour/gettingStarted/firstRunEntry.test.ts new file mode 100644 index 00000000000..f8246ed5f38 --- /dev/null +++ b/src/renderer/extensions/firstRunTour/gettingStarted/firstRunEntry.test.ts @@ -0,0 +1,217 @@ +import { createTestingPinia } from '@pinia/testing' +import { setActivePinia } from 'pinia' +import { beforeEach, describe, expect, it, vi } from 'vitest' + +import type * as VueUseCoreModule from '@vueuse/core' + +import type { StartupOutcome } from '@/platform/workflow/persistence/base/draftTypes' + +type VueUseCore = typeof VueUseCoreModule + +const mocks = vi.hoisted(() => ({ + isCloud: true, + isDesktopWidth: true, + subscriptionEnabled: true, + isNewUser: true as boolean | null, + tourFlag: true, + execute: vi.fn(), + settings: {} as Record, + setSetting: vi.fn() +})) + +vi.mock('@/platform/distribution/types', () => ({ + get isCloud() { + return mocks.isCloud + } +})) + +vi.mock('@vueuse/core', async (importOriginal) => ({ + ...(await importOriginal()), + useBreakpoints: () => ({ + greaterOrEqual: () => ({ + get value() { + return mocks.isDesktopWidth + } + }) + }) +})) + +vi.mock('@/platform/cloud/subscription/composables/useSubscription', () => ({ + useSubscription: () => ({ + isSubscriptionEnabled: () => mocks.subscriptionEnabled + }) +})) + +vi.mock('@/services/useNewUserService', () => ({ + useNewUserService: () => ({ isNewUser: () => mocks.isNewUser }) +})) + +vi.mock('@/composables/useFeatureFlags', () => ({ + useFeatureFlags: () => ({ + flags: { + get onboardingTourEnabled() { + return mocks.tourFlag + } + } + }) +})) + +vi.mock('@/stores/commandStore', () => ({ + useCommandStore: () => ({ execute: mocks.execute }) +})) + +vi.mock('@/platform/settings/settingStore', () => ({ + useSettingStore: () => ({ + get: (key: string) => mocks.settings[key], + set: mocks.setSetting + }) +})) + +// createSharedComposable caches across calls; each test needs its own instance. +async function freshEntry() { + vi.resetModules() + const { useFirstRunEntry } = await import('./firstRunEntry') + return useFirstRunEntry() +} + +describe('useFirstRunEntry', () => { + beforeEach(() => { + setActivePinia(createTestingPinia({ stubActions: false })) + vi.clearAllMocks() + mocks.isCloud = true + mocks.isDesktopWidth = true + mocks.subscriptionEnabled = true + mocks.isNewUser = true + mocks.tourFlag = true + mocks.settings = {} + }) + + describe('what a fresh user sees', () => { + it('shows Getting Started to a candidate', async () => { + const entry = await freshEntry() + + await entry.handleStartupOutcome('fresh') + + expect(entry.gettingStartedVisible.value).toBe(true) + expect(mocks.execute).not.toHaveBeenCalled() + }) + + const disqualifiers: [string, () => void][] = [ + ['not on cloud', () => void (mocks.isCloud = false)], + ['below the md breakpoint', () => void (mocks.isDesktopWidth = false)], + ['subscription disabled', () => void (mocks.subscriptionEnabled = false)], + ['a returning user', () => void (mocks.isNewUser = false)], + ['new-user state undetermined', () => void (mocks.isNewUser = null)], + ['the tour flag off', () => void (mocks.tourFlag = false)] + ] + + it.for(disqualifiers)( + 'opens the template browser instead, with %s', + async ([, disqualify]) => { + disqualify() + const entry = await freshEntry() + + await entry.handleStartupOutcome('fresh') + + expect( + entry.gettingStartedVisible.value, + 'A non-candidate must keep the existing template-browser flow' + ).toBe(false) + expect(mocks.execute).toHaveBeenCalledWith('Comfy.BrowseTemplates') + expect( + mocks.setSetting, + 'Without this the browser reopens on every launch, forever' + ).toHaveBeenCalledWith('Comfy.TutorialCompleted', true) + } + ) + }) + + it('marks a url-intent startup completed without taking over the screen', async () => { + const entry = await freshEntry() + + await entry.handleStartupOutcome('url-intent') + + expect( + entry.gettingStartedVisible.value, + 'A share or template link is the user’s choice; onboarding must not cover it' + ).toBe(false) + expect(mocks.execute).not.toHaveBeenCalled() + expect( + mocks.setSetting, + 'Without this the template browser reopens on every launch, as it did before this flow existed' + ).toHaveBeenCalledWith('Comfy.TutorialCompleted', true) + }) + + it('never onboards over restored work, even for an apparent new user', async () => { + const entry = await freshEntry() + + await entry.handleStartupOutcome('restored') + + expect( + entry.gettingStartedVisible.value, + 'checkIsNewUser reads Comfy.TutorialCompleted, so a user who predates that setting looks new; only the outcome shows they had work to restore' + ).toBe(false) + expect( + mocks.execute, + 'nor may the template browser cover their restored workflow' + ).not.toHaveBeenCalled() + }) + + it.for(['fresh', 'url-intent'] as const)( + 'settles the first-run decision on a %s startup rather than leaving it pending', + async (outcome: StartupOutcome) => { + const entry = await freshEntry() + + await entry.handleStartupOutcome(outcome) + + expect( + entry.gettingStartedVisible.value || + mocks.setSetting.mock.calls.length > 0, + 'a startup that opened a blank canvas must either offer onboarding or record that it is done; anything else strands the user with no screen and no flag' + ).toBe(true) + } + ) + + it('leaves a completed user alone', async () => { + mocks.settings['Comfy.TutorialCompleted'] = true + const entry = await freshEntry() + + await entry.handleStartupOutcome('restored') + + expect(entry.gettingStartedVisible.value).toBe(false) + expect(mocks.execute).not.toHaveBeenCalled() + expect(mocks.setSetting).not.toHaveBeenCalled() + }) + + it('keeps the screen up when eligibility changes underneath it', async () => { + const entry = await freshEntry() + await entry.handleStartupOutcome('fresh') + + mocks.isDesktopWidth = false + mocks.tourFlag = false + mocks.subscriptionEnabled = false + + expect( + entry.gettingStartedVisible.value, + 'Candidacy gates entry only; a resize or flag refresh must not unmount the screen mid-interaction' + ).toBe(true) + }) + + it('marks the tutorial completed only once the user acts', async () => { + const entry = await freshEntry() + await entry.handleStartupOutcome('fresh') + + expect( + mocks.setSetting, + 'Showing the screen must not persist completion; the user has not chosen anything yet' + ).not.toHaveBeenCalled() + + await entry.dismissGettingStarted() + + expect(entry.gettingStartedVisible.value).toBe(false) + expect(mocks.setSetting).toHaveBeenCalledWith( + 'Comfy.TutorialCompleted', + true + ) + }) +}) diff --git a/src/renderer/extensions/firstRunTour/gettingStarted/firstRunEntry.ts b/src/renderer/extensions/firstRunTour/gettingStarted/firstRunEntry.ts new file mode 100644 index 00000000000..fb18c5a79b0 --- /dev/null +++ b/src/renderer/extensions/firstRunTour/gettingStarted/firstRunEntry.ts @@ -0,0 +1,78 @@ +import { + breakpointsTailwind, + createSharedComposable, + useBreakpoints +} from '@vueuse/core' +import { readonly, ref } from 'vue' + +import { useFeatureFlags } from '@/composables/useFeatureFlags' +import { useSubscription } from '@/platform/cloud/subscription/composables/useSubscription' +import { isCloud } from '@/platform/distribution/types' +import { useSettingStore } from '@/platform/settings/settingStore' +import type { StartupOutcome } from '@/platform/workflow/persistence/base/draftTypes' +import { useNewUserService } from '@/services/useNewUserService' +import { useCommandStore } from '@/stores/commandStore' + +/** + * Decides what a first-time user sees once startup reports its outcome: the + * Getting Started screen for first-run tour candidates, the template browser + * for everyone else. + */ +export const useFirstRunEntry = createSharedComposable(() => { + const settingStore = useSettingStore() + const gettingStartedVisible = ref(false) + const isDesktopWidth = + useBreakpoints(breakpointsTailwind).greaterOrEqual('md') + + function isFirstRunCandidate(): boolean { + if (!useFeatureFlags().flags.onboardingTourEnabled) return false + if (!isCloud) return false + if (!isDesktopWidth.value) return false + if (!useSubscription().isSubscriptionEnabled()) return false + return useNewUserService().isNewUser() === true + } + + /** + * Candidacy is read once, here: a later breakpoint, flag or subscription + * change must not unmount the screen out from under the user. + * Only a boot that opened a blank canvas can be onboarded over. `isNewUser()` + * cannot carry that alone — it reads `Comfy.TutorialCompleted`, which is + * exactly what a user predating the setting is missing. + */ + async function handleStartupOutcome(outcome: StartupOutcome) { + if (outcome === 'restored') return + if (settingStore.get('Comfy.TutorialCompleted')) return + + if (outcome === 'url-intent') { + await markTutorialCompleted() + return + } + + if (isFirstRunCandidate()) { + gettingStartedVisible.value = true + return + } + + await markTutorialCompleted() + await useCommandStore().execute('Comfy.BrowseTemplates') + } + + async function markTutorialCompleted() { + try { + await settingStore.set('Comfy.TutorialCompleted', true) + } catch (error) { + console.error('Failed to persist Comfy.TutorialCompleted', error) + } + } + + async function dismissGettingStarted() { + gettingStartedVisible.value = false + await markTutorialCompleted() + } + + return { + gettingStartedVisible: readonly(gettingStartedVisible), + handleStartupOutcome, + dismissGettingStarted + } +}) diff --git a/src/renderer/extensions/firstRunTour/gettingStarted/tutorialCards.ts b/src/renderer/extensions/firstRunTour/gettingStarted/tutorialCards.ts new file mode 100644 index 00000000000..7e61c20b389 --- /dev/null +++ b/src/renderer/extensions/firstRunTour/gettingStarted/tutorialCards.ts @@ -0,0 +1,55 @@ +/** The templates the Getting Started grid offers, in order. */ +export const CURATED_TEMPLATE_IDS = [ + 'image_krea2_turbo_t2i', + 'image_z_image_turbo', + 'video_ltx2_3_i2v', + 'video_wan2_2_14B_i2v' +] as const + +/** Fills the grid, in order, when a curated template is missing from the data. */ +export const FALLBACK_TEMPLATE_IDS = [ + 'templates-image_to_real', + 'image_qwen_image_edit_2509', + 'templates-qwen_multiangle.app', + 'video_ltx2_i2v_distilled' +] as const + +export const TUTORIAL_BADGE_ICON = 'icon-[lucide--graduation-cap]' + +export interface TutorialCard { + id: string + titleKey: string + url: string + thumbnailTemplate: (typeof CURATED_TEMPLATE_IDS)[number] +} + +/** + * Thumbnails are offset from the Templates tab's order so the two grids don't + * read as the same four images in the same places. + */ +export const tutorialCards: readonly TutorialCard[] = [ + { + id: 'interface-overview', + titleKey: 'gettingStarted.tutorials.interfaceOverview', + url: 'https://docs.comfy.org/interface/overview', + thumbnailTemplate: 'image_z_image_turbo' + }, + { + id: 'text-to-image', + titleKey: 'gettingStarted.tutorials.textToImage', + url: 'https://docs.comfy.org/tutorials/basic/text-to-image', + thumbnailTemplate: 'video_ltx2_3_i2v' + }, + { + id: 'image-to-image', + titleKey: 'gettingStarted.tutorials.imageToImage', + url: 'https://docs.comfy.org/tutorials/basic/image-to-image', + thumbnailTemplate: 'video_wan2_2_14B_i2v' + }, + { + id: 'inpaint', + titleKey: 'gettingStarted.tutorials.inpaint', + url: 'https://docs.comfy.org/tutorials/basic/inpaint', + thumbnailTemplate: 'image_krea2_turbo_t2i' + } +] diff --git a/src/renderer/extensions/firstRunTour/roles/resolveTourRoles.test.ts b/src/renderer/extensions/firstRunTour/roles/resolveTourRoles.test.ts new file mode 100644 index 00000000000..18d0719a778 --- /dev/null +++ b/src/renderer/extensions/firstRunTour/roles/resolveTourRoles.test.ts @@ -0,0 +1,128 @@ +import { createPinia, setActivePinia } from 'pinia' +import { beforeEach, describe, expect, it } from 'vitest' + +import { LGraphNode } from '@/lib/litegraph/src/litegraph' +import type { LGraph, Subgraph } from '@/lib/litegraph/src/litegraph' +import { + createTestRootGraph, + createTestSubgraph, + createTestSubgraphNode +} from '@/lib/litegraph/src/subgraph/__fixtures__/subgraphHelpers' +import { toNodeId } from '@/types/nodeId' + +import { resolveTourRoles } from './resolveTourRoles' +import { TOUR_ROLE_PINS } from './tourRolePins' +import type { RolePin } from './tourRolePins' + +const TEMPLATE_ID = 'video_wan2_2_14B_i2v' +const { source, prompt, sink, mediaKind } = TOUR_ROLE_PINS[TEMPLATE_ID] + +if (!source || !prompt) { + throw new Error( + `${TEMPLATE_ID} must pin a source and a prompt for this suite` + ) +} + +function addPinnedNode(graph: LGraph | Subgraph, pin: RolePin) { + const node = new LGraphNode(pin.type, pin.type) + node.id = toNodeId(pin.id) + graph.add(node) + return node +} + +/** Mirrors a loaded template: a subgraph definition registered on the root graph, plus its instance. */ +function addHostedSubgraph(root: LGraph, parent: LGraph | Subgraph = root) { + const subgraph = createTestSubgraph({ rootGraph: root }) + root.subgraphs.set(subgraph.id, subgraph) + const host = createTestSubgraphNode(subgraph, { parentGraph: parent }) + parent.add(host) + return { subgraph, host } +} + +describe('resolveTourRoles', () => { + beforeEach(() => setActivePinia(createPinia())) + + it('spotlights a prompt pinned inside a subgraph through its root-graph host', () => { + const root = createTestRootGraph() + const { subgraph, host } = addHostedSubgraph(root) + addPinnedNode(root, source) + addPinnedNode(root, sink) + addPinnedNode(subgraph, prompt) + + expect(resolveTourRoles(root, TEMPLATE_ID)).toEqual({ + source: toNodeId(source.id), + promptHost: host.id, + sink: toNodeId(sink.id), + mediaKind + }) + }) + + it('host-maps every role, not only the prompt', () => { + const root = createTestRootGraph() + const { subgraph, host } = addHostedSubgraph(root) + addPinnedNode(subgraph, source) + addPinnedNode(subgraph, prompt) + addPinnedNode(subgraph, sink) + + const roles = resolveTourRoles(root, TEMPLATE_ID) + + expect(roles?.source, 'source pinned inside a subgraph').toBe(host.id) + expect(roles?.sink, 'sink pinned inside a subgraph').toBe(host.id) + }) + + it('walks nested subgraphs up to the outermost host', () => { + const root = createTestRootGraph() + const outer = addHostedSubgraph(root) + const inner = addHostedSubgraph(root, outer.subgraph) + addPinnedNode(inner.subgraph, prompt) + + expect(resolveTourRoles(root, TEMPLATE_ID)?.promptHost).toBe(outer.host.id) + }) + + it('degrades a pin the live graph no longer contains to null', () => { + const root = createTestRootGraph() + addPinnedNode(root, sink) + + expect(resolveTourRoles(root, TEMPLATE_ID)).toEqual({ + source: null, + promptHost: null, + sink: toNodeId(sink.id), + mediaKind + }) + }) + + it('ignores a pinned id the live graph fills with a different node', () => { + const root = createTestRootGraph() + const impostor = new LGraphNode('LoadImage', 'LoadImage') + impostor.id = toNodeId(sink.id) + root.add(impostor) + + expect( + resolveTourRoles(root, TEMPLATE_ID)?.sink, + 'ids are plain numbers, so another workflow can hold this one' + ).toBeNull() + }) + + it('omits a role the template never pinned, without touching the graph', () => { + const root = createTestRootGraph() + const t2i = TOUR_ROLE_PINS['image_krea2_turbo_t2i'] + addPinnedNode(root, t2i.sink) + + expect( + resolveTourRoles(root, 'image_krea2_turbo_t2i'), + 'text to image has nothing to upload, so the tour offers no upload step' + ).toEqual({ + source: null, + promptHost: null, + sink: toNodeId(t2i.sink.id), + mediaKind: t2i.mediaKind + }) + }) + + it('gives an unsupported template no roles, so no tour starts', () => { + const root = createTestRootGraph() + addPinnedNode(root, sink) + + expect(resolveTourRoles(root, 'some_shared_workflow')).toBeNull() + }) +}) diff --git a/src/renderer/extensions/firstRunTour/roles/resolveTourRoles.ts b/src/renderer/extensions/firstRunTour/roles/resolveTourRoles.ts new file mode 100644 index 00000000000..c5e7a55816e --- /dev/null +++ b/src/renderer/extensions/firstRunTour/roles/resolveTourRoles.ts @@ -0,0 +1,56 @@ +import type { LGraph } from '@/lib/litegraph/src/LGraph' +import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode' +import type { NodeId } from '@/types/nodeId' +import { + getExecutionIdByNode, + getRootParentNode +} from '@/utils/graphTraversalUtil' +import { resolveNode } from '@/utils/litegraphUtil' + +import { TOUR_ROLE_PINS } from './tourRolePins' +import type { + RolePin, + SupportedTemplateId, + TourMediaKind +} from './tourRolePins' + +export interface ResolvedRoles { + source: NodeId | null + promptHost: NodeId | null + sink: NodeId | null + mediaKind: TourMediaKind +} + +/** The root-graph node a pin is spotlit through: itself, or the subgraph node holding it. */ +function rootHost(node: LGraphNode, root: LGraph): LGraphNode | null { + if (node.graph === root) return node + const executionId = getExecutionIdByNode(root, node) + return executionId ? getRootParentNode(root, executionId) : null +} + +/** The pinned type is the guard: an id alone matches any graph that has it. */ +function resolvePin(pin: RolePin | undefined, root: LGraph): NodeId | null { + if (!pin) return null + const node = resolveNode(pin.id, root) + return node?.type === pin.type ? (rootHost(node, root)?.id ?? null) : null +} + +/** + * Validates a template's pins against the live graph. A template the tour does + * not support gets no roles at all; a pin the graph no longer contains degrades + * to null so its step is omitted rather than spotlighting a node that is gone. + */ +export function resolveTourRoles( + graph: LGraph, + templateId: string +): ResolvedRoles | null { + if (!Object.hasOwn(TOUR_ROLE_PINS, templateId)) return null + const pins = TOUR_ROLE_PINS[templateId as SupportedTemplateId] + + return { + source: resolvePin(pins.source, graph), + promptHost: resolvePin(pins.prompt, graph), + sink: resolvePin(pins.sink, graph), + mediaKind: pins.mediaKind + } +} diff --git a/src/renderer/extensions/firstRunTour/roles/tourRolePins.ts b/src/renderer/extensions/firstRunTour/roles/tourRolePins.ts new file mode 100644 index 00000000000..137e1679c80 --- /dev/null +++ b/src/renderer/extensions/firstRunTour/roles/tourRolePins.ts @@ -0,0 +1,86 @@ +import type { + CURATED_TEMPLATE_IDS, + FALLBACK_TEMPLATE_IDS +} from '../gettingStarted/tutorialCards' + +/** Every id the Getting Started grid can offer, so no card can ship unpinned. */ +export type SupportedTemplateId = + | (typeof CURATED_TEMPLATE_IDS)[number] + | (typeof FALLBACK_TEMPLATE_IDS)[number] + +export type TourMediaKind = 'image' | 'video' + +/** The kind a sink node type produces, so the drift guard can hold the two in step. */ +export const MEDIA_KIND_BY_SINK_TYPE: Record = { + SaveImage: 'image', + SaveVideo: 'video' +} + +/** + * A pinned node. The type is pinned alongside the id so an upstream renumber + * that leaves the id occupied by a different node fails the drift guard. + */ +export interface RolePin { + id: number + type: string +} + +export interface RolePins { + /** Absent for text-to-image, which has nothing to upload. */ + source?: RolePin + /** Absent when the template exposes no prompt the user can edit. */ + prompt?: RolePin + sink: RolePin + mediaKind: TourMediaKind +} + +/** + * The templates the tour supports, pinned by hand. A prompt pinned inside a + * subgraph is spotlit through the root-graph node hosting it. + */ +export const TOUR_ROLE_PINS: Record = { + image_krea2_turbo_t2i: { + prompt: { id: 19, type: 'PrimitiveStringMultiline' }, + sink: { id: 29, type: 'SaveImage' }, + mediaKind: 'image' + }, + image_z_image_turbo: { + prompt: { id: 27, type: 'CLIPTextEncode' }, + sink: { id: 9, type: 'SaveImage' }, + mediaKind: 'image' + }, + video_ltx2_3_i2v: { + source: { id: 269, type: 'LoadImage' }, + prompt: { id: 319, type: 'PrimitiveStringMultiline' }, + sink: { id: 75, type: 'SaveVideo' }, + mediaKind: 'video' + }, + video_wan2_2_14B_i2v: { + source: { id: 97, type: 'LoadImage' }, + prompt: { id: 93, type: 'CLIPTextEncode' }, + sink: { id: 108, type: 'SaveVideo' }, + mediaKind: 'video' + }, + 'templates-image_to_real': { + source: { id: 14, type: 'LoadImage' }, + sink: { id: 18, type: 'SaveImage' }, + mediaKind: 'image' + }, + image_qwen_image_edit_2509: { + source: { id: 78, type: 'LoadImage' }, + prompt: { id: 435, type: 'PrimitiveStringMultiline' }, + sink: { id: 60, type: 'SaveImage' }, + mediaKind: 'image' + }, + 'templates-qwen_multiangle.app': { + source: { id: 1, type: 'LoadImage' }, + sink: { id: 2, type: 'SaveImage' }, + mediaKind: 'image' + }, + video_ltx2_i2v_distilled: { + source: { id: 98, type: 'LoadImage' }, + prompt: { id: 3, type: 'CLIPTextEncode' }, + sink: { id: 75, type: 'SaveVideo' }, + mediaKind: 'video' + } +} diff --git a/src/renderer/extensions/firstRunTour/roles/tourSequence.test.ts b/src/renderer/extensions/firstRunTour/roles/tourSequence.test.ts new file mode 100644 index 00000000000..ec4e140fc9e --- /dev/null +++ b/src/renderer/extensions/firstRunTour/roles/tourSequence.test.ts @@ -0,0 +1,72 @@ +import { describe, expect, it } from 'vitest' + +import { toNodeId } from '@/types/nodeId' + +import type { ResolvedRoles } from './resolveTourRoles' +import { sequenceBuilder } from './tourSequence' + +const SOURCE = toNodeId(97) +const PROMPT_HOST = toNodeId(129) +const SINK = toNodeId(108) + +function roles(overrides: Partial = {}): ResolvedRoles { + return { + source: null, + promptHost: null, + sink: null, + mediaKind: 'image', + ...overrides + } +} + +describe('sequenceBuilder', () => { + it.for([ + { + shape: 'image to video', + roles: roles({ source: SOURCE, promptHost: PROMPT_HOST, sink: SINK }), + kinds: ['upload', 'prompt', 'run', 'result'] + }, + { + shape: 'text to image', + roles: roles({ promptHost: PROMPT_HOST, sink: SINK }), + kinds: ['prompt', 'run', 'result'] + }, + { + shape: 'no editable prompt', + roles: roles({ source: SOURCE, sink: SINK }), + kinds: ['upload', 'run', 'result'] + }, + { + shape: 'nothing resolved', + roles: roles(), + kinds: ['run'] + } + ])('omits the steps $shape cannot offer', ({ roles, kinds }) => { + expect(sequenceBuilder(roles).map((step) => step.kind)).toEqual(kinds) + }) + + it('points each step at its own role', () => { + const steps = sequenceBuilder( + roles({ source: SOURCE, promptHost: PROMPT_HOST, sink: SINK }) + ) + + expect(steps).toEqual([ + { kind: 'upload', nodeId: SOURCE }, + { kind: 'prompt', nodeId: PROMPT_HOST }, + { kind: 'run' }, + { kind: 'result', nodeId: SINK, mediaKind: 'image' } + ]) + }) + + it('hands the result step the sink and its media kind', () => { + const steps = sequenceBuilder( + roles({ promptHost: PROMPT_HOST, sink: SINK, mediaKind: 'video' }) + ) + + expect(steps.at(-1)).toEqual({ + kind: 'result', + nodeId: SINK, + mediaKind: 'video' + }) + }) +}) diff --git a/src/renderer/extensions/firstRunTour/roles/tourSequence.ts b/src/renderer/extensions/firstRunTour/roles/tourSequence.ts new file mode 100644 index 00000000000..50b05fedd1d --- /dev/null +++ b/src/renderer/extensions/firstRunTour/roles/tourSequence.ts @@ -0,0 +1,25 @@ +import type { NodeId } from '@/types/nodeId' + +import type { ResolvedRoles } from './resolveTourRoles' +import type { TourMediaKind } from './tourRolePins' + +export type TourStep = + | { kind: 'upload'; nodeId: NodeId } + | { kind: 'prompt'; nodeId: NodeId } + | { kind: 'run' } + | { kind: 'result'; nodeId: NodeId; mediaKind: TourMediaKind } + +/** A role that did not resolve omits its step; Run targets the toolbar, not the graph. */ +export function sequenceBuilder({ + source, + promptHost, + sink, + mediaKind +}: ResolvedRoles): TourStep[] { + return [ + ...(source ? [{ kind: 'upload' as const, nodeId: source }] : []), + ...(promptHost ? [{ kind: 'prompt' as const, nodeId: promptHost }] : []), + { kind: 'run' as const }, + ...(sink ? [{ kind: 'result' as const, nodeId: sink, mediaKind }] : []) + ] +} diff --git a/src/renderer/extensions/firstRunTour/tour/canvasCoachTarget.test.ts b/src/renderer/extensions/firstRunTour/tour/canvasCoachTarget.test.ts new file mode 100644 index 00000000000..17da3a92712 --- /dev/null +++ b/src/renderer/extensions/firstRunTour/tour/canvasCoachTarget.test.ts @@ -0,0 +1,214 @@ +import { afterEach, describe, expect, it, vi } from 'vitest' +import { effectScope, nextTick } from 'vue' + +import { toNodeId } from '@/types/nodeId' + +import { canvasNodeTarget } from './canvasCoachTarget' + +const { TITLE_HEIGHT } = vi.hoisted(() => ({ TITLE_HEIGHT: 30 })) + +const state = vi.hoisted(() => ({ + camera: null as Record | null, + currentGraph: null as { getNodeById: (id: unknown) => unknown } | null, + collapsed: new Set(), + layout: null as { value: unknown } | null, + canvasOffset: { left: 0, top: 0 }, + releaseBounds: vi.fn() +})) + +function graph(id: string) { + return { + id, + getNodeById: (nodeId: unknown) => ({ + collapsed: state.collapsed.has(String(nodeId)) + }) + } +} + +vi.mock('@/lib/litegraph/src/litegraph', () => ({ + LiteGraph: { NODE_TITLE_HEIGHT: TITLE_HEIGHT } +})) +vi.mock('@/renderer/core/layout/transform/useTransformState', async () => { + const { reactive } = await import('vue') + state.camera = reactive({ x: 0, y: 0, z: 1 }) + return { useTransformState: () => ({ camera: state.camera }) } +}) +vi.mock('@/renderer/core/canvas/canvasStore', () => ({ + useCanvasStore: () => ({ + canvas: { canvas: document.createElement('canvas') }, + get currentGraph() { + return state.currentGraph + } + }) +})) +vi.mock('@/renderer/core/layout/store/layoutStore', async () => { + const { shallowRef } = await import('vue') + state.layout = shallowRef(null) + return { layoutStore: { getNodeLayoutRef: () => state.layout } } +}) +vi.mock('@vueuse/core', async (importOriginal) => { + const actual = await importOriginal>() + const { computed, onScopeDispose } = await import('vue') + return { + ...actual, + useElementBounding: () => { + onScopeDispose(state.releaseBounds) + return { + left: computed(() => state.canvasOffset.left), + top: computed(() => state.canvasOffset.top) + } + } + } +}) + +function placeNode(bounds = { x: 100, y: 200, width: 80, height: 40 }) { + state.layout!.value = { bounds } +} + +describe('canvasNodeTarget', () => { + afterEach(() => { + state.currentGraph = graph('root') + state.collapsed.clear() + state.canvasOffset = { left: 0, top: 0 } + if (state.camera) Object.assign(state.camera, { x: 0, y: 0, z: 1 }) + if (state.layout) state.layout.value = null + state.releaseBounds.mockClear() + }) + + it('releases what it watches when the tour drops it', () => { + const target = canvasNodeTarget(toNodeId(1)) + expect(state.releaseBounds).not.toHaveBeenCalled() + + target.dispose?.() + + expect( + state.releaseBounds, + 'nothing here runs from a component, so unreleased observers outlive every tour' + ).toHaveBeenCalledTimes(1) + }) + + it('places the rect over the node, title bar included', () => { + state.currentGraph = graph('root') + placeNode({ x: 100, y: 200, width: 80, height: 40 }) + + expect( + canvasNodeTarget(toNodeId(6)).getRect(), + 'layout holds the body box, but the node renders its title above it' + ).toEqual(new DOMRect(100, 200 - TITLE_HEIGHT, 80, 40 + TITLE_HEIGHT)) + }) + + it('carries the node through pan and zoom', () => { + state.currentGraph = graph('root') + placeNode({ x: 100, y: 200, width: 80, height: 40 }) + Object.assign(state.camera!, { x: 10, y: 20, z: 2 }) + state.canvasOffset = { left: 5, top: 7 } + + expect( + canvasNodeTarget(toNodeId(6)).getRect(), + 'the ring has to land on the node wherever the camera puts it' + ).toEqual( + new DOMRect( + (100 + 10) * 2 + 5, + (200 - TITLE_HEIGHT + 20) * 2 + 7, + 80 * 2, + (40 + TITLE_HEIGHT) * 2 + ) + ) + }) + + it('withholds a rect until the node has a layout', () => { + state.currentGraph = graph('root') + + expect( + canvasNodeTarget(toNodeId(6)).getRect(), + 'a step must wait for its target rather than spotlight nothing' + ).toBeNull() + }) + + it('withholds a rect once the graph it resolved against is gone', () => { + state.currentGraph = graph('root') + placeNode() + const target = canvasNodeTarget(toNodeId(6)) + expect(target.getRect()).not.toBeNull() + + state.currentGraph = graph('another-workflow') + + expect( + target.getRect(), + 'node ids are graph-local, so id 6 elsewhere is a different node' + ).toBeNull() + }) + + it('withholds a rect for a collapsed node, which renders no widget', () => { + state.currentGraph = graph('root') + placeNode() + state.collapsed.add('6') + + expect( + canvasNodeTarget(toNodeId(6)).getRect(), + 'a collapsed node hides the widget the card asks the user to use' + ).toBeNull() + }) + + it('reports the node itself changing, which the camera never announces', async () => { + const scope = effectScope() + const notify = vi.fn() + scope.run(() => canvasNodeTarget(toNodeId(1)).onMove(notify)) + + placeNode({ x: 40, y: 60, width: 80, height: 30 }) + await nextTick() + + expect( + notify, + 'a node moved or resized under a still camera leaves the ring behind' + ).toHaveBeenCalled() + scope.stop() + }) + + it('reports a resize, which moves the canvas under a still camera', () => { + const scope = effectScope() + const notify = vi.fn() + scope.run(() => canvasNodeTarget(toNodeId(1)).onMove(notify)) + + window.dispatchEvent(new Event('resize')) + + expect( + notify, + 'the canvas offset changes without the camera moving' + ).toHaveBeenCalled() + scope.stop() + }) + + it('reports the camera moving, which fires no scroll or resize event', async () => { + const scope = effectScope() + const notify = vi.fn() + scope.run(() => canvasNodeTarget(toNodeId(1)).onMove(notify)) + + state.camera!.x = 250 + await nextTick() + + expect( + notify, + 'a node the camera carries moves with nothing to announce it' + ).toHaveBeenCalled() + scope.stop() + }) + + it('stops reporting once the step that subscribed has gone', async () => { + const scope = effectScope() + const notify = vi.fn() + const stop = scope.run(() => canvasNodeTarget(toNodeId(1)).onMove(notify))! + stop() + + state.camera!.x = 120 + placeNode({ x: 1, y: 2, width: 3, height: 4 }) + await nextTick() + window.dispatchEvent(new Event('resize')) + + expect( + notify, + 'a subscription outliving its step repositions a card that is gone' + ).not.toHaveBeenCalled() + scope.stop() + }) +}) diff --git a/src/renderer/extensions/firstRunTour/tour/canvasCoachTarget.ts b/src/renderer/extensions/firstRunTour/tour/canvasCoachTarget.ts new file mode 100644 index 00000000000..edeed8fedf3 --- /dev/null +++ b/src/renderer/extensions/firstRunTour/tour/canvasCoachTarget.ts @@ -0,0 +1,56 @@ +import { useElementBounding, useEventListener } from '@vueuse/core' +import { effectScope, watch } from 'vue' + +import { LiteGraph } from '@/lib/litegraph/src/litegraph' +import type { RectTarget } from '@/platform/onboarding/coachmarkRegistry' +import { useCanvasStore } from '@/renderer/core/canvas/canvasStore' +import { layoutStore } from '@/renderer/core/layout/store/layoutStore' +import { useTransformState } from '@/renderer/core/layout/transform/useTransformState' +import type { NodeId } from '@/types/nodeId' + +/** A canvas node as a coachmark target, derived from its layout and the camera. */ +export function canvasNodeTarget(nodeId: NodeId): RectTarget { + const { camera } = useTransformState() + const canvasStore = useCanvasStore() + const layout = layoutStore.getNodeLayoutRef(nodeId) + const resolvedGraph = canvasStore.currentGraph + const scope = effectScope(true) + const canvasBounds = scope.run(() => + useElementBounding(() => canvasStore.canvas?.canvas) + )! + + return { + getRect: () => { + // Node ids are graph-local, so id 6 in another graph is a different node. + if (canvasStore.currentGraph !== resolvedGraph) return null + // A collapsed node renders no widget for a step to point at. + if (canvasStore.currentGraph?.getNodeById(nodeId)?.collapsed) return null + + const bounds = layout.value?.bounds + if (!bounds) return null + + // Bounds are the body box; the node renders a title height above it. + const title = LiteGraph.NODE_TITLE_HEIGHT || 0 + const { x, y, z } = camera + return new DOMRect( + (bounds.x + x) * z + canvasBounds.left.value, + (bounds.y - title + y) * z + canvasBounds.top.value, + bounds.width * z, + (bounds.height + title) * z + ) + }, + onMove: (notify) => { + const stopWatch = watch( + () => [camera.x, camera.y, camera.z, layout.value], + notify, + { flush: 'post' } + ) + const stopResize = useEventListener(window, 'resize', notify) + return () => { + stopWatch() + stopResize() + } + }, + dispose: () => scope.stop() + } +} diff --git a/src/views/GraphView.test.ts b/src/views/GraphView.test.ts index a1fc5242c21..64356960af0 100644 --- a/src/views/GraphView.test.ts +++ b/src/views/GraphView.test.ts @@ -191,6 +191,7 @@ vi.mock('@/components/toast/GlobalToast.vue', () => stubModule) vi.mock('@/components/toast/RerouteMigrationToast.vue', () => stubModule) vi.mock('@/components/MenuHamburger.vue', () => stubModule) vi.mock('@/components/dialog/UnloadWindowConfirmDialog.vue', () => stubModule) +vi.mock('@/renderer/extensions/firstRunTour/FirstRunTour.vue', () => stubModule) describe('GraphView - reconnect wiring', () => { beforeEach(() => { diff --git a/src/views/GraphView.vue b/src/views/GraphView.vue index c8415d642c9..731221c5ddc 100644 --- a/src/views/GraphView.vue +++ b/src/views/GraphView.vue @@ -30,6 +30,7 @@ +