LCOV - code coverage report
Current view: top level - src/renderer/extensions/firstRunTour/roles - tourRolePins.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 100.0 % 2 2
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : import type {
       2              :   CURATED_TEMPLATE_IDS,
       3              :   FALLBACK_TEMPLATE_IDS
       4              : } from '@/renderer/extensions/firstRunTour/gettingStarted/tutorialCards'
       5              : 
       6              : /** Every id the Getting Started grid can offer, so no card can ship unpinned. */
       7              : export type SupportedTemplateId =
       8              :   | (typeof CURATED_TEMPLATE_IDS)[number]
       9              :   | (typeof FALLBACK_TEMPLATE_IDS)[number]
      10              : 
      11              : export type TourMediaKind = 'image' | 'video'
      12              : 
      13              : /**
      14              :  * The kind a sink node type produces, so the drift guard can hold the two in
      15              :  * step. Video sinks are listed because they are fed IMAGE frames, so the slot
      16              :  * type alone would call their output an image.
      17              :  */
      18         2355 : export const MEDIA_KIND_BY_SINK_TYPE: Record<string, TourMediaKind> = {
      19              :   SaveImage: 'image',
      20              :   SaveImageAdvanced: 'image',
      21              :   SaveVideo: 'video',
      22              :   SaveAnimatedWEBP: 'video',
      23              :   SaveAnimatedPNG: 'video',
      24              :   SaveWEBM: 'video',
      25              :   VHS_VideoCombine: 'video'
      26              : }
      27              : 
      28              : /**
      29              :  * A pinned node. The type is pinned alongside the id so an upstream renumber
      30              :  * that leaves the id occupied by a different node fails the drift guard.
      31              :  */
      32              : export interface RolePin {
      33              :   id: number
      34              :   type: string
      35              : }
      36              : 
      37              : export interface RolePins {
      38              :   /** Absent for text-to-image, which has nothing to upload. */
      39              :   source?: RolePin
      40              :   /** Absent when the template exposes no prompt the user can edit. */
      41              :   prompt?: RolePin
      42              :   sink: RolePin
      43              :   mediaKind: TourMediaKind
      44              : }
      45              : 
      46              : /**
      47              :  * The templates the tour supports, pinned by hand. A prompt pinned inside a
      48              :  * subgraph is spotlit through the root-graph node hosting it.
      49              :  */
      50         2355 : export const TOUR_ROLE_PINS: Record<SupportedTemplateId, RolePins> = {
      51              :   image_krea2_turbo_t2i: {
      52              :     prompt: { id: 19, type: 'PrimitiveStringMultiline' },
      53              :     sink: { id: 29, type: 'SaveImage' },
      54              :     mediaKind: 'image'
      55              :   },
      56              :   image_z_image_turbo: {
      57              :     prompt: { id: 27, type: 'CLIPTextEncode' },
      58              :     sink: { id: 9, type: 'SaveImage' },
      59              :     mediaKind: 'image'
      60              :   },
      61              :   video_ltx2_3_i2v: {
      62              :     source: { id: 269, type: 'LoadImage' },
      63              :     prompt: { id: 319, type: 'PrimitiveStringMultiline' },
      64              :     sink: { id: 75, type: 'SaveVideo' },
      65              :     mediaKind: 'video'
      66              :   },
      67              :   video_wan2_2_14B_i2v: {
      68              :     source: { id: 97, type: 'LoadImage' },
      69              :     prompt: { id: 93, type: 'CLIPTextEncode' },
      70              :     sink: { id: 108, type: 'SaveVideo' },
      71              :     mediaKind: 'video'
      72              :   },
      73              :   'templates-image_to_real': {
      74              :     source: { id: 14, type: 'LoadImage' },
      75              :     sink: { id: 18, type: 'SaveImage' },
      76              :     mediaKind: 'image'
      77              :   },
      78              :   image_qwen_image_edit_2509: {
      79              :     source: { id: 78, type: 'LoadImage' },
      80              :     prompt: { id: 111, type: 'TextEncodeQwenImageEditPlus' },
      81              :     sink: { id: 469, type: 'SaveImageAdvanced' },
      82              :     mediaKind: 'image'
      83              :   },
      84              :   flux_fill_inpaint_example: {
      85              :     source: { id: 17, type: 'LoadImage' },
      86              :     prompt: { id: 23, type: 'CLIPTextEncode' },
      87              :     sink: { id: 9, type: 'SaveImage' },
      88              :     mediaKind: 'image'
      89              :   },
      90              :   video_ltx2_i2v_distilled: {
      91              :     source: { id: 98, type: 'LoadImage' },
      92              :     prompt: { id: 3, type: 'CLIPTextEncode' },
      93              :     sink: { id: 75, type: 'SaveVideo' },
      94              :     mediaKind: 'video'
      95              :   }
      96              : }
        

Generated by: LCOV version 2.0-1