Road to No Explicit Any Part 7: Scripts and Dialog Cleanup#8092
Road to No Explicit Any Part 7: Scripts and Dialog Cleanup#8092
Conversation
- Define V1RawPrompt and CloudRawPrompt tuple types for queue responses - Export QueueIndex, PromptInputs, ExtraData, OutputsToExecute from apiSchema - Type normalizeQueuePrompt with proper discriminated union - Type #postItem body as Record<string, unknown> - Type storeUserData data as BodyInit | Record<string, unknown> | null - Type getCustomNodesI18n return as Record<string, unknown>
- Add GroupNodeConfigEntry interface to LGraph.ts for config typing - Extend GroupNodeWorkflowData with title and widgets_values node props - Type config as Record<number, GroupNodeConfigEntry> instead of unknown - Export new types from litegraph barrel file - Fix all class properties with definite assignment assertions - Type all method parameters (changeTab, changeNode, changeGroup, etc.) - Fix event handlers with proper Event and CustomEvent types - Type storeModification, getEditElement, and build*Page methods - Fix save button callback with proper generic types for node ordering - Add override modifier to show method - Use optional chaining for node.recreate() call
…types - Type nodeOutputs as Record<string, ExecutedWsMessage['output']> - Import CanvasPointerEvent from litegraph - Type prompt callback value as string | number - Type prompt callback function as (v: string) => void - Type event parameter as CanvasPointerEvent
ComfyDialog: - Type constructor buttons parameter as HTMLButtonElement[] | null - Type show method parameter as string | HTMLElement | HTMLElement[] - Use definite assignment for textElement ComfyAsyncDialog: - Make class generic with DialogAction<T> type - Type resolve function, show/showModal return types - Fix button creation with proper HTMLButtonElement cast - Add generic static prompt method ManageGroupDialog: - Update show method signature to match base class - Extract nodeType from parameter for string comparisons
📝 WalkthroughWalkthroughType and null-safety refinements across group-node, LiteGraph types, API, change-tracking, and dialog UI. Signatures and exported types updated (notably Changes
Sequence Diagram(s)(omitted) Possibly related PRs
Suggested reviewers
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/20/2026, 12:37:41 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Tests:
|
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 22.4 kB (baseline 22.4 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.02 MB (baseline 1.02 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 80.7 kB (baseline 80.7 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed Panels & Settings — 430 kB (baseline 430 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 8 added / 8 removed User & Accounts — 3.94 kB (baseline 3.94 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 3 added / 3 removed Editors & Dialogs — 2.8 kB (baseline 2.8 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 2 added / 2 removed UI Components — 32.8 kB (baseline 32.8 kB) • ⚪ 0 BReusable component library chunks
Status: 5 added / 5 removed Data & Services — 3.04 MB (baseline 3.04 MB) • 🔴 +68 BStores, services, APIs, and repositories
Status: 7 added / 7 removed Utilities & Hooks — 18.7 kB (baseline 18.7 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 4 added / 4 removed Vendor & Third-Party — 10.4 MB (baseline 10.4 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 6.24 MB (baseline 6.24 MB) • 🔴 +815 BBundles that do not match a named category
Status: 25 added / 25 removed |
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/extensions/core/groupNodeManage.ts (1)
239-256: Castingsectiontosymbolis incorrect and type-unsafe.The
sectionparameter is typed asstring, but lines 241 and 254 cast it tosymbolviaas unknown as symbol. This bypasses TypeScript's type system and is misleading sincestoreModificationexpectssection: symbolbut receives a string at runtime.Either:
- Change
storeModificationto acceptstring | symbolfor thesectionparameter, or- Pass the actual symbol (e.g.,
ORDER) where appropriate and keep strings for other cases.
🤖 Fix all issues with AI agents
In `@src/extensions/core/groupNode.ts`:
- Around line 389-390: The code currently casts node.outputs?.[0] to
GroupNodeOutput | undefined because
GroupNodeWorkflowData['nodes'][number]['outputs'] is typed as unknown[]; keep
this explicit cast (const output = node.outputs?.[0] as GroupNodeOutput |
undefined) and the guarded access (const source = output?.widget?.name) to avoid
runtime errors when accessing widget, and if feasible consider narrowing the
outputs type in GroupNodeWorkflowData to GroupNodeOutput[] across the workflow
typings to remove the need for the cast.
In `@src/extensions/core/groupNodeManage.ts`:
- Around line 343-346: The override show method currently declared as
show(groupNodeType?: string | HTMLElement | HTMLElement[]) only uses the string
case (variable nodeType) which mismatches the base signature and silently
ignores DOM inputs; either narrow the signature to show(groupNodeType?: string |
undefined) to match actual usage (update the override declaration and any
dependent call sites) or add clear JSDoc on the override explaining that only
string values are supported and DOM arguments will be ignored/unsupported;
locate the override show implementation in GroupNodeManage (the show method that
defines nodeType) and apply the chosen change consistently across the class and
any interfaces/overrides.
- Around line 69-71: The getter selectedNodeInnerIndex uses three chained
non-null assertions
(this.nodeItems[this.selectedNodeIndex!]!.dataset.nodeindex!) which is fragile;
replace them with runtime guards: first verify this.nodeItems and
this.selectedNodeIndex are defined, then get const item =
this.nodeItems[this.selectedNodeIndex] and ensure item and
item.dataset.nodeindex exist before converting to number; if any check fails
either return a safe default (e.g., -1 or NaN) or throw a clear error message
indicating which value was missing so callers can handle it.
- Around line 480-494: The loops that rewrite link and external node indices
access groupNodeData.nodes[...] without bounds checks; update the link loop
(iterating over groupNodeData.links) and the external loop (iterating over
groupNodeData.external) to verify the numeric index is within 0 <= idx <
groupNodeData.nodes.length before reading groupNodeData.nodes[idx].index, and
skip or leave the value unchanged when the check fails so you don't dereference
undefined; specifically add bounds checks around the accesses to
groupNodeData.nodes[l[0] as number].index, groupNodeData.nodes[l[2] as
number].index, and groupNodeData.nodes[ext[0] as number].index.
In `@src/scripts/api.ts`:
- Around line 908-944: The current defensive check in normalizeQueuePrompt ("if
(!Array.isArray(prompt))") can hide corrupted non-array inputs; replace this
silent guard with explicit validation that surfaces the problem: inside
normalizeQueuePrompt, if prompt is not an array, throw a descriptive Error (or
at minimum log the unexpected value and throw) including the prompt's runtime
value and type so callers see the failure; keep the subsequent discriminant
logic for V1RawPrompt/CloudRawPrompt and return TaskPrompt as before.
In `@src/scripts/ui/components/asyncDialog.ts`:
- Around line 6-9: ComfyAsyncDialog's private field `#resolve` is declared with a
definite assignment assertion but can be called in close() before
show()/showModal() initializes it; initialize `#resolve` defensively (e.g., set a
no-op resolver in the field or constructor) and/or guard its invocation in
close() (check existence or use optional call) so calling close() without prior
show()/showModal() won't throw; update the ComfyAsyncDialog class (the `#resolve`
declaration, the constructor, and the close() method) to implement this
defensive initialization/guard.
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (9)
src/extensions/core/groupNode.tssrc/extensions/core/groupNodeManage.tssrc/lib/litegraph/src/LGraph.tssrc/lib/litegraph/src/litegraph.tssrc/schemas/apiSchema.tssrc/scripts/api.tssrc/scripts/changeTracker.tssrc/scripts/ui/components/asyncDialog.tssrc/scripts/ui/dialog.ts
🧰 Additional context used
📓 Path-based instructions (10)
src/**/*.{vue,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json
Files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.tssrc/schemas/apiSchema.tssrc/extensions/core/groupNode.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.tssrc/scripts/ui/dialog.tssrc/scripts/changeTracker.tssrc/scripts/ui/components/asyncDialog.ts
src/**/*.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety
src/**/*.ts: Derive component types usingvue-component-type-helpers(ComponentProps,ComponentSlots) instead of separate type files
Use es-toolkit for utility functions
Minimize the surface area (exported values) of each module and composable
Favor pure functions, especially testable ones
Files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.tssrc/schemas/apiSchema.tssrc/extensions/core/groupNode.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.tssrc/scripts/ui/dialog.tssrc/scripts/changeTracker.tssrc/scripts/ui/components/asyncDialog.ts
src/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using@ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase
src/**/*.{ts,tsx,vue}: Use separateimport typestatements instead of inlinetypein mixed imports
Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, 80-character width
Sort and group imports by plugin, runpnpm formatbefore committing
Never useanytype - use proper TypeScript types
Never useas anytype assertions - fix the underlying type issue
Write code that is expressive and self-documenting - avoid unnecessary comments
Do not add or retain redundant comments - clean as you go
Avoid mutable state - prefer immutability and assignment at point of declaration
Watch out for Code Smells and refactor to avoid them
Files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.tssrc/schemas/apiSchema.tssrc/extensions/core/groupNode.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.tssrc/scripts/ui/dialog.tssrc/scripts/changeTracker.tssrc/scripts/ui/components/asyncDialog.ts
src/**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Follow Vue 3 composition API style guide
Files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.tssrc/schemas/apiSchema.tssrc/extensions/core/groupNode.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.tssrc/scripts/ui/dialog.tssrc/scripts/changeTracker.tssrc/scripts/ui/components/asyncDialog.ts
src/lib/litegraph/**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (src/lib/litegraph/CLAUDE.md)
src/lib/litegraph/**/*.{js,ts,jsx,tsx}: Run ESLint instead of manually figuring out whitespace fixes or other trivial style concerns using thepnpm lint:fixcommand
Take advantage ofTypedArraysubarraywhen appropriate
Thesizeandposproperties ofRectangleshare the same array buffer (subarray); they may be used to set the rectangle's size and position
Prefer single lineifsyntax over adding curly braces, when the statement has a very concise expression and concise, single line statement
Do not replace&&=or||=with=when there is no reason to do so. If you do find a reason to remove either&&=or||=, leave a comment explaining why the removal occurred
When writing methods, prefer returning idiomatic JavaScriptundefinedovernull
Files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.ts
src/lib/litegraph/**/*.{ts,tsx}
📄 CodeRabbit inference engine (src/lib/litegraph/CLAUDE.md)
Type assertions are an absolute last resort. In almost all cases, they are a crutch that leads to brittle code
Files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.ts
src/**/*.{ts,vue}
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.{ts,vue}: Usereffor reactive state,computed()for derived values, andwatch/watchEffectfor side effects in Composition API
Avoid usingrefwithwatchif acomputedwould suffice - minimize refs and derived state
Useprovide/injectfor dependency injection only when simpler alternatives (Store or shared composable) won't work
Leverage VueUse functions for performance-enhancing composables
Use VueUse function for useI18n in composition API for string literals
Files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.tssrc/schemas/apiSchema.tssrc/extensions/core/groupNode.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.tssrc/scripts/ui/dialog.tssrc/scripts/changeTracker.tssrc/scripts/ui/components/asyncDialog.ts
src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.{ts,tsx}: Keep functions short and functional
Minimize nesting (if statements, for loops, etc.)
Use function declarations instead of function expressions when possible
Files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.tssrc/schemas/apiSchema.tssrc/extensions/core/groupNode.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.tssrc/scripts/ui/dialog.tssrc/scripts/changeTracker.tssrc/scripts/ui/components/asyncDialog.ts
src/**/{composables,components}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Clean up subscriptions in state management to prevent memory leaks
Files:
src/scripts/ui/components/asyncDialog.ts
src/**/{components,composables}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Use vue-i18n for ALL user-facing strings by adding them to
src/locales/en/main.json
Files:
src/scripts/ui/components/asyncDialog.ts
🧠 Learnings (14)
📓 Common learnings
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/*.{ts,tsx,vue} : Implement proper TypeScript types throughout the codebase
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to src/**/*.{ts,tsx,vue} : Never use `as any` type assertions - fix the underlying type issue
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7894
File: src/renderer/extensions/vueNodes/widgets/components/WidgetToggleSwitch.test.ts:11-14
Timestamp: 2026-01-08T02:40:22.621Z
Learning: In the Comfy-Org/ComfyUI_frontend repository test files: When testing components, import the real type definitions from the component files instead of duplicating interface definitions in the test files. This prevents type drift and maintains consistency.
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7898
File: src/composables/usePaste.test.ts:248-248
Timestamp: 2026-01-09T02:07:59.035Z
Learning: In test files at src/**/*.test.ts, when creating mock objects that partially implement an interface (e.g., LGraphNode), use `as Partial<InterfaceType> as InterfaceType` instead of `as any` or `as unknown as InterfaceType` to explicitly acknowledge the incomplete implementation while maintaining type safety.
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to src/**/*.{ts,tsx,vue} : Use separate `import type` statements instead of inline `type` in mixed imports
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.ts : Use TypeScript for type safety
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{js,ts,jsx,tsx} : When writing methods, prefer returning idiomatic JavaScript `undefined` over `null`
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{ts,tsx} : Type assertions are an absolute last resort. In almost all cases, they are a crutch that leads to brittle code
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/stores/**/*.{ts,tsx} : Use TypeScript for type safety in state management stores
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{test,spec}.{ts,tsx} : Use provided test helpers `createTestSubgraph` and `createTestSubgraphNode` from `./fixtures/subgraphHelpers` for consistent subgraph test setup
Applied to files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.tssrc/extensions/core/groupNodeManage.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{test,spec}.{ts,tsx} : When writing tests for subgraph-related code, always import from the barrel export at `@/lib/litegraph/src/litegraph` to avoid circular dependency issues
Applied to files:
src/lib/litegraph/src/litegraph.tssrc/extensions/core/groupNodeManage.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{ts,tsx} : Type assertions are an absolute last resort. In almost all cases, they are a crutch that leads to brittle code
Applied to files:
src/lib/litegraph/src/litegraph.tssrc/extensions/core/groupNodeManage.ts
📚 Learning: 2025-12-09T03:39:54.501Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7169
File: src/platform/remote/comfyui/jobs/jobTypes.ts:1-107
Timestamp: 2025-12-09T03:39:54.501Z
Learning: In the ComfyUI_frontend project, Zod is on v3.x. Do not suggest Zod v4 standalone validators (z.uuid, z.ulid, z.cuid2, z.nanoid) until an upgrade to Zod 4 is performed. When reviewing TypeScript files (e.g., src/platform/remote/comfyui/jobs/jobTypes.ts) validate against Zod 3 capabilities and avoid introducing v4-specific features; flag any proposal to upgrade or incorporate v4-only validators and propose staying with compatible 3.x patterns.
Applied to files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.tssrc/schemas/apiSchema.tssrc/extensions/core/groupNode.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.tssrc/scripts/ui/dialog.tssrc/scripts/changeTracker.tssrc/scripts/ui/components/asyncDialog.ts
📚 Learning: 2025-12-13T11:03:11.264Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7416
File: src/stores/imagePreviewStore.ts:5-7
Timestamp: 2025-12-13T11:03:11.264Z
Learning: In the ComfyUI_frontend repository, lint rules require keeping 'import type' statements separate from non-type imports, even if importing from the same module. Do not suggest consolidating them into a single import statement. Ensure type imports remain on their own line (import type { ... } from 'module') and regular imports stay on separate lines.
Applied to files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.tssrc/schemas/apiSchema.tssrc/extensions/core/groupNode.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.tssrc/scripts/ui/dialog.tssrc/scripts/changeTracker.tssrc/scripts/ui/components/asyncDialog.ts
📚 Learning: 2025-12-17T00:40:09.635Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7537
File: src/components/ui/button/Button.stories.ts:45-55
Timestamp: 2025-12-17T00:40:09.635Z
Learning: Prefer pure function declarations over function expressions (e.g., use function foo() { ... } instead of const foo = () => { ... }) for pure functions in the repository. Function declarations are more functional-leaning, offer better hoisting clarity, and can improve readability and tooling consistency. Apply this guideline across TypeScript files in Comfy-Org/ComfyUI_frontend, including story and UI component code, except where a function expression is semantically required (e.g., callbacks, higher-order functions with closures).
Applied to files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.tssrc/schemas/apiSchema.tssrc/extensions/core/groupNode.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.tssrc/scripts/ui/dialog.tssrc/scripts/changeTracker.tssrc/scripts/ui/components/asyncDialog.ts
📚 Learning: 2025-12-30T22:22:33.836Z
Learnt from: kaili-yang
Repo: Comfy-Org/ComfyUI_frontend PR: 7805
File: src/composables/useCoreCommands.ts:439-439
Timestamp: 2025-12-30T22:22:33.836Z
Learning: When accessing reactive properties from Pinia stores in TypeScript files, avoid using .value on direct property access (e.g., useStore().isOverlayExpanded). Pinia auto-wraps refs when accessed directly, returning the primitive value. The .value accessor is only needed when destructuring store properties or when using storeToRefs().
Applied to files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.tssrc/schemas/apiSchema.tssrc/extensions/core/groupNode.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.tssrc/scripts/ui/dialog.tssrc/scripts/changeTracker.tssrc/scripts/ui/components/asyncDialog.ts
📚 Learning: 2025-12-11T12:25:15.470Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7358
File: src/components/dialog/content/signin/SignUpForm.vue:45-54
Timestamp: 2025-12-11T12:25:15.470Z
Learning: This repository uses CI automation to format code (pnpm format). Do not include manual formatting suggestions in code reviews for Comfy-Org/ComfyUI_frontend. If formatting issues are detected, rely on the CI formatter or re-run pnpm format. Focus reviews on correctness, readability, performance, accessibility, and maintainability rather than style formatting.
Applied to files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.tssrc/schemas/apiSchema.tssrc/extensions/core/groupNode.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.tssrc/scripts/ui/dialog.tssrc/scripts/changeTracker.tssrc/scripts/ui/components/asyncDialog.ts
📚 Learning: 2026-01-12T17:39:27.738Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7906
File: src/components/sidebar/tabs/AssetsSidebarTab.vue:545-552
Timestamp: 2026-01-12T17:39:27.738Z
Learning: In Vue/TypeScript files (src/**/*.{ts,tsx,vue}), prefer if/else statements over ternary operators when performing side effects or actions (e.g., mutating state, calling methods with side effects). Ternaries should be reserved for computing and returning values.
Applied to files:
src/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/LGraph.tssrc/schemas/apiSchema.tssrc/extensions/core/groupNode.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.tssrc/scripts/ui/dialog.tssrc/scripts/changeTracker.tssrc/scripts/ui/components/asyncDialog.ts
📚 Learning: 2025-12-08T01:21:41.368Z
Learnt from: jtydhr88
Repo: Comfy-Org/ComfyUI_frontend PR: 7214
File: src/i18n.ts:97-98
Timestamp: 2025-12-08T01:21:41.368Z
Learning: In src/i18n.ts and related i18n code, use `Record<string, unknown>` for locale data structures (including custom nodes i18n data) to maintain consistency with existing patterns used in localeLoaders, nodeDefsLoaders, commandsLoaders, and settingsLoaders.
Applied to files:
src/scripts/api.tssrc/extensions/core/groupNodeManage.ts
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/*.{ts,tsx,vue} : Implement proper TypeScript types throughout the codebase
Applied to files:
src/extensions/core/groupNodeManage.ts
📚 Learning: 2026-01-09T07:29:32.501Z
Learnt from: LittleSound
Repo: Comfy-Org/ComfyUI_frontend PR: 7812
File: src/components/rightSidePanel/RightSidePanel.vue:100-132
Timestamp: 2026-01-09T07:29:32.501Z
Learning: The `findParentGroupInGraph` function in `src/components/rightSidePanel/RightSidePanel.vue` is a temporary workaround for a bug where group sub-items were not updating correctly after a page refresh. It can be removed once that underlying bug is fixed.
Applied to files:
src/extensions/core/groupNodeManage.ts
📚 Learning: 2026-01-08T02:40:22.621Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7894
File: src/renderer/extensions/vueNodes/widgets/components/WidgetToggleSwitch.test.ts:11-14
Timestamp: 2026-01-08T02:40:22.621Z
Learning: In the Comfy-Org/ComfyUI_frontend repository test files: When testing components, import the real type definitions from the component files instead of duplicating interface definitions in the test files. This prevents type drift and maintains consistency.
Applied to files:
src/scripts/ui/components/asyncDialog.ts
🧬 Code graph analysis (4)
src/extensions/core/groupNode.ts (2)
src/lib/litegraph/src/LGraph.ts (1)
GroupNodeWorkflowData(110-122)src/lib/litegraph/src/litegraph.ts (1)
GroupNodeWorkflowData(108-108)
src/scripts/api.ts (2)
src/schemas/apiSchema.ts (6)
QueueIndex(300-300)PromptId(16-16)PromptInputs(301-301)ExtraData(302-302)OutputsToExecute(303-303)TaskPrompt(295-295)src/stores/queueStore.ts (1)
extraData(299-301)
src/extensions/core/groupNodeManage.ts (3)
src/lib/litegraph/src/litegraph.ts (4)
LGraphNodeConstructor(57-76)LGraphNode(116-116)GroupNodeWorkflowData(108-108)GroupNodeConfigEntry(107-107)src/lib/litegraph/src/LGraphNode.ts (10)
LGraphNode(213-215)LGraphNode(225-4196)LGraphNode(746-754)LGraphNode(756-762)widgets(4118-4154)inputs(3310-3314)outputs(3319-3321)slot(3920-3935)slot(3957-3964)slot(3966-3968)src/constants/groupNodeConstants.ts (2)
PREFIX(7-7)SEPARATOR(8-8)
src/scripts/changeTracker.ts (1)
src/schemas/apiSchema.ts (1)
ExecutedWsMessage(156-156)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: playwright-tests-chromium-sharded (5, 8)
- GitHub Check: playwright-tests-chromium-sharded (4, 8)
- GitHub Check: playwright-tests-chromium-sharded (2, 8)
- GitHub Check: playwright-tests-chromium-sharded (8, 8)
- GitHub Check: playwright-tests (mobile-chrome)
- GitHub Check: playwright-tests-chromium-sharded (1, 8)
- GitHub Check: playwright-tests (chromium-0.5x)
- GitHub Check: playwright-tests (chromium-2x)
- GitHub Check: deploy-and-comment
- GitHub Check: collect
- GitHub Check: test
- GitHub Check: lint-and-format
🔇 Additional comments (16)
src/lib/litegraph/src/litegraph.ts (1)
107-108: Type exports align with PR goals.Clean addition of
GroupNodeConfigEntryandGroupNodeWorkflowDatato the public API surface. This follows the existing pattern of type re-exports fromLGraphand supports the broader typing improvements ingroupNode.tsandgroupNodeManage.ts.src/lib/litegraph/src/LGraph.ts (1)
105-122: Well-structured type definitions for group node configuration.The
GroupNodeConfigEntryinterface and extendedGroupNodeWorkflowDataprovide proper typing that replaces the previousRecord<number, unknown>. The structure aligns well with theNodeConfigEntryinterface ingroupNode.tsand supports the type narrowing needed throughout the group node feature.src/scripts/ui/dialog.ts (3)
7-7: Definite assignment assertion is appropriate here.The
textElementis assigned synchronously via the$elcallback at line 15:$el('p', { $: (p) => (this.textElement = p) }). Since$elexecutes the callback during element creation before the constructor returns, the assignment is guaranteed.
10-10: Explicit button type parameter improves type safety.The
HTMLButtonElement[] | nulltype properly constrains the buttons parameter and aligns with the expected usage increateButtons().
37-46: Method signature and implementation correctly handle all input types.The union type
string | HTMLElement | HTMLElement[]properly covers all usage patterns, and the implementation correctly differentiates between string (usinginnerHTML) and element inputs (usingreplaceChildren).src/extensions/core/groupNode.ts (1)
370-372: Union type signature enables broader input compatibility.The updated signature
GroupNodeData | GroupNodeWorkflowData['nodes'][number]allows this method to accept nodes from both the internal representation and the serialized workflow data format.src/scripts/ui/components/asyncDialog.ts (3)
4-4: Clean generic action type definition.The
DialogAction<T>type elegantly supports both simple string actions and typed value objects, enabling type-safe dialog results.
11-23: Constructor correctly normalizes actions to typed objects.The normalization of string actions to
{ text: opt }objects and the resolution with(action.value ?? action.text) as Tproperly handles both action formats.
56-73: Well-typed static prompt factory method.The generic static
prompt<U>method correctly instantiatesComfyAsyncDialog<U>with the provided actions, maintaining type safety throughout the dialog lifecycle.src/extensions/core/groupNodeManage.ts (1)
536-538: Safe optional chaining forrecreatemethod.Good use of optional chaining (
node.recreate?.()) to safely call the method only if it exists.src/schemas/apiSchema.ts (1)
299-304: Clean type exports for queue response handling.The new exports (
QueueIndex,PromptInputs,ExtraData,OutputsToExecute) are properly inferred from existing Zod schemas and follow the established pattern in this file. This enables type-safe handling of raw queue responses inapi.ts.src/scripts/changeTracker.ts (2)
44-44: Good use of indexed access type for nodeOutputs.Using
ExecutedWsMessage['output']ensures the type stays in sync with the schema definition. This is preferable to duplicating the type structure.
305-316: No action needed—callback signature is correct.The callback type
(v: string) => voidis correct and matches the original LGraphCanvas.prompt implementation in src/lib/litegraph/src/LGraphCanvas.ts. HTML dialog inputs always return strings, and the codebase pattern (as seen in pnginfo.ts) is to convert strings to numbers at the call site using+vorNumber(v)when needed. Thevalue: string | numberparameter represents the initial display value, not the callback return type.src/scripts/api.ts (3)
1001-1012: Improved typing for#postItembody parameter.Using
Record<string, unknown>instead ofanyfor the optional body parameter maintains flexibility while providing basic type safety.
1122-1141: Flexible data parameter typing for storeUserData.The union type
BodyInit | Record<string, unknown> | nullcorrectly handles both raw body data and objects that need serialization. The conditional serialization on line 1141 properly handles thestringifyoption.
1324-1326: Correct return type for i18n data.Using
Record<string, unknown>aligns with the established pattern for locale data structures in this codebase. Based on learnings, this is the preferred type for custom nodes i18n data.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| const output = node.outputs?.[0] as GroupNodeOutput | undefined | ||
| const source = output?.widget?.name |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Type assertion is necessary due to unknown[] in workflow data.
Since GroupNodeWorkflowData['nodes'][number]['outputs'] is typed as unknown[], the cast to GroupNodeOutput | undefined is needed to access the widget property. The guarded access pattern (output?.widget?.name) is safer than the previous direct chain access.
Consider whether the outputs type in GroupNodeWorkflowData could be narrowed to GroupNodeOutput[] to eliminate this cast, though that may require broader changes.
🤖 Prompt for AI Agents
In `@src/extensions/core/groupNode.ts` around lines 389 - 390, The code currently
casts node.outputs?.[0] to GroupNodeOutput | undefined because
GroupNodeWorkflowData['nodes'][number]['outputs'] is typed as unknown[]; keep
this explicit cast (const output = node.outputs?.[0] as GroupNodeOutput |
undefined) and the guarded access (const source = output?.widget?.name) to avoid
runtime errors when accessing widget, and if feasible consider narrowing the
outputs type in GroupNodeWorkflowData to GroupNodeOutput[] across the workflow
typings to remove the need for the cast.
groupNodeManage.ts: - Add bounds checking before accessing node indices in link/external loops - Fix selectedNodeInnerIndex getter with proper runtime guards - Change storeModification section param to string | symbol, removing casts asyncDialog.ts: - Initialize #resolve with no-op function for defensive safety api.ts: - Add warning log for unexpected non-array queue prompts
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
src/scripts/ui/components/asyncDialog.ts (1)
25-48: Consider using{ once: true }to avoid redundant close calls.The event listener setup can cause
close()to be invoked twice: once explicitly (with the result) and once from the 'close' event (with null). While Promise resolution is idempotent making this benign, using{ once: true }would be cleaner and prevent listener accumulation if the same dialog instance is reused.♻️ Optional: Add once option to event listeners
override show(html: string | HTMLElement | HTMLElement[]): Promise<T | null> { - this.element.addEventListener('close', () => { + this.element.addEventListener('close', () => { this.close() - }) + }, { once: true }) super.show(html) ... } showModal(html: string | HTMLElement | HTMLElement[]): Promise<T | null> { - this.element.addEventListener('close', () => { + this.element.addEventListener('close', () => { this.close() - }) + }, { once: true })src/extensions/core/groupNodeManage.ts (1)
158-167: Guard empty group nodes before callingchangeNode(0).If a group has zero nodes,
changeNode(0)will dereferencethis.nodeItems[0]and throw. Short-circuit the reset path to avoid a hard crash and clear the pages instead.🐛 Proposed fix
if (reset) { this.selectedNodeIndex = null + if (nodes.length === 0) { + this.widgetsPage.replaceChildren() + this.inputsPage.replaceChildren() + this.outputsPage.replaceChildren() + return + } this.changeNode(0) } else {src/scripts/api.ts (1)
1125-1145: Auto-detect non-stringifiableBodyInittypes to prevent silent data corruption.Passing
FormData,Blob, orURLSearchParamswith the defaultstringify: truesilently corrupts them into empty objects{}. The suggested fix auto-detects these types and only stringifies plain objects/arrays, while still allowing explicit override via thestringifyoption.🧩 Suggested hardening
- const resp = await this.fetchApi( + const shouldStringify = + options?.stringify ?? + !( + data instanceof FormData || + data instanceof Blob || + data instanceof URLSearchParams + ) + const resp = await this.fetchApi( `/userdata/${encodeURIComponent(file)}?overwrite=${options.overwrite}&full_info=${options.full_info}`, { method: 'POST', - body: options?.stringify ? JSON.stringify(data) : (data as BodyInit), + body: shouldStringify ? JSON.stringify(data) : (data as BodyInit), ...options } )
🤖 Fix all issues with AI agents
In `@src/extensions/core/groupNodeManage.ts`:
- Around line 293-310: The method currently maps `items` to `elements` (using
`this.getEditElement`) and filters out nulls, but then returns `!!items.length`,
which can be true even if all entries were filtered out; change the return to
reflect the filtered `elements` array instead (e.g., return whether
`elements.length` is non-zero) so the Inputs tab only stays active when there
are rendered elements; keep the existing
`this.inputsPage.replaceChildren(...elements)` and the `filter((el): el is
HTMLDivElement => el !== null)` safeguard.
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
src/extensions/core/groupNodeManage.tssrc/scripts/api.tssrc/scripts/ui/components/asyncDialog.ts
🧰 Additional context used
📓 Path-based instructions (8)
src/**/*.{vue,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json
Files:
src/scripts/ui/components/asyncDialog.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.ts
src/**/*.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety
src/**/*.ts: Derive component types usingvue-component-type-helpers(ComponentProps,ComponentSlots) instead of separate type files
Use es-toolkit for utility functions
Minimize the surface area (exported values) of each module and composable
Favor pure functions, especially testable ones
Files:
src/scripts/ui/components/asyncDialog.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.ts
src/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using@ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase
src/**/*.{ts,tsx,vue}: Use separateimport typestatements instead of inlinetypein mixed imports
Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, 80-character width
Sort and group imports by plugin, runpnpm formatbefore committing
Never useanytype - use proper TypeScript types
Never useas anytype assertions - fix the underlying type issue
Write code that is expressive and self-documenting - avoid unnecessary comments
Do not add or retain redundant comments - clean as you go
Avoid mutable state - prefer immutability and assignment at point of declaration
Watch out for Code Smells and refactor to avoid them
Files:
src/scripts/ui/components/asyncDialog.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.ts
src/**/{composables,components}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Clean up subscriptions in state management to prevent memory leaks
Files:
src/scripts/ui/components/asyncDialog.ts
src/**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Follow Vue 3 composition API style guide
Files:
src/scripts/ui/components/asyncDialog.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.ts
src/**/{components,composables}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Use vue-i18n for ALL user-facing strings by adding them to
src/locales/en/main.json
Files:
src/scripts/ui/components/asyncDialog.ts
src/**/*.{ts,vue}
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.{ts,vue}: Usereffor reactive state,computed()for derived values, andwatch/watchEffectfor side effects in Composition API
Avoid usingrefwithwatchif acomputedwould suffice - minimize refs and derived state
Useprovide/injectfor dependency injection only when simpler alternatives (Store or shared composable) won't work
Leverage VueUse functions for performance-enhancing composables
Use VueUse function for useI18n in composition API for string literals
Files:
src/scripts/ui/components/asyncDialog.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.ts
src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.{ts,tsx}: Keep functions short and functional
Minimize nesting (if statements, for loops, etc.)
Use function declarations instead of function expressions when possible
Files:
src/scripts/ui/components/asyncDialog.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.ts
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/*.{ts,tsx,vue} : Implement proper TypeScript types throughout the codebase
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to src/**/*.{ts,tsx,vue} : Never use `as any` type assertions - fix the underlying type issue
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7898
File: src/composables/usePaste.test.ts:248-248
Timestamp: 2026-01-09T02:07:59.035Z
Learning: In test files at src/**/*.test.ts, when creating mock objects that partially implement an interface (e.g., LGraphNode), use `as Partial<InterfaceType> as InterfaceType` instead of `as any` or `as unknown as InterfaceType` to explicitly acknowledge the incomplete implementation while maintaining type safety.
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.ts : Use TypeScript for type safety
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{ts,tsx} : Type assertions are an absolute last resort. In almost all cases, they are a crutch that leads to brittle code
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7894
File: src/renderer/extensions/vueNodes/widgets/components/WidgetToggleSwitch.test.ts:11-14
Timestamp: 2026-01-08T02:40:22.621Z
Learning: In the Comfy-Org/ComfyUI_frontend repository test files: When testing components, import the real type definitions from the component files instead of duplicating interface definitions in the test files. This prevents type drift and maintains consistency.
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to src/**/*.{ts,tsx,vue} : Use separate `import type` statements instead of inline `type` in mixed imports
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{test,spec}.{ts,tsx} : Use provided test helpers `createTestSubgraph` and `createTestSubgraphNode` from `./fixtures/subgraphHelpers` for consistent subgraph test setup
📚 Learning: 2025-12-09T03:39:54.501Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7169
File: src/platform/remote/comfyui/jobs/jobTypes.ts:1-107
Timestamp: 2025-12-09T03:39:54.501Z
Learning: In the ComfyUI_frontend project, Zod is on v3.x. Do not suggest Zod v4 standalone validators (z.uuid, z.ulid, z.cuid2, z.nanoid) until an upgrade to Zod 4 is performed. When reviewing TypeScript files (e.g., src/platform/remote/comfyui/jobs/jobTypes.ts) validate against Zod 3 capabilities and avoid introducing v4-specific features; flag any proposal to upgrade or incorporate v4-only validators and propose staying with compatible 3.x patterns.
Applied to files:
src/scripts/ui/components/asyncDialog.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.ts
📚 Learning: 2025-12-13T11:03:11.264Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7416
File: src/stores/imagePreviewStore.ts:5-7
Timestamp: 2025-12-13T11:03:11.264Z
Learning: In the ComfyUI_frontend repository, lint rules require keeping 'import type' statements separate from non-type imports, even if importing from the same module. Do not suggest consolidating them into a single import statement. Ensure type imports remain on their own line (import type { ... } from 'module') and regular imports stay on separate lines.
Applied to files:
src/scripts/ui/components/asyncDialog.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.ts
📚 Learning: 2025-12-17T00:40:09.635Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7537
File: src/components/ui/button/Button.stories.ts:45-55
Timestamp: 2025-12-17T00:40:09.635Z
Learning: Prefer pure function declarations over function expressions (e.g., use function foo() { ... } instead of const foo = () => { ... }) for pure functions in the repository. Function declarations are more functional-leaning, offer better hoisting clarity, and can improve readability and tooling consistency. Apply this guideline across TypeScript files in Comfy-Org/ComfyUI_frontend, including story and UI component code, except where a function expression is semantically required (e.g., callbacks, higher-order functions with closures).
Applied to files:
src/scripts/ui/components/asyncDialog.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.ts
📚 Learning: 2025-12-30T22:22:33.836Z
Learnt from: kaili-yang
Repo: Comfy-Org/ComfyUI_frontend PR: 7805
File: src/composables/useCoreCommands.ts:439-439
Timestamp: 2025-12-30T22:22:33.836Z
Learning: When accessing reactive properties from Pinia stores in TypeScript files, avoid using .value on direct property access (e.g., useStore().isOverlayExpanded). Pinia auto-wraps refs when accessed directly, returning the primitive value. The .value accessor is only needed when destructuring store properties or when using storeToRefs().
Applied to files:
src/scripts/ui/components/asyncDialog.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.ts
📚 Learning: 2025-12-11T12:25:15.470Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7358
File: src/components/dialog/content/signin/SignUpForm.vue:45-54
Timestamp: 2025-12-11T12:25:15.470Z
Learning: This repository uses CI automation to format code (pnpm format). Do not include manual formatting suggestions in code reviews for Comfy-Org/ComfyUI_frontend. If formatting issues are detected, rely on the CI formatter or re-run pnpm format. Focus reviews on correctness, readability, performance, accessibility, and maintainability rather than style formatting.
Applied to files:
src/scripts/ui/components/asyncDialog.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.ts
📚 Learning: 2026-01-12T17:39:27.738Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7906
File: src/components/sidebar/tabs/AssetsSidebarTab.vue:545-552
Timestamp: 2026-01-12T17:39:27.738Z
Learning: In Vue/TypeScript files (src/**/*.{ts,tsx,vue}), prefer if/else statements over ternary operators when performing side effects or actions (e.g., mutating state, calling methods with side effects). Ternaries should be reserved for computing and returning values.
Applied to files:
src/scripts/ui/components/asyncDialog.tssrc/scripts/api.tssrc/extensions/core/groupNodeManage.ts
📚 Learning: 2025-12-08T01:21:41.368Z
Learnt from: jtydhr88
Repo: Comfy-Org/ComfyUI_frontend PR: 7214
File: src/i18n.ts:97-98
Timestamp: 2025-12-08T01:21:41.368Z
Learning: In src/i18n.ts and related i18n code, use `Record<string, unknown>` for locale data structures (including custom nodes i18n data) to maintain consistency with existing patterns used in localeLoaders, nodeDefsLoaders, commandsLoaders, and settingsLoaders.
Applied to files:
src/scripts/api.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{ts,tsx} : Type assertions are an absolute last resort. In almost all cases, they are a crutch that leads to brittle code
Applied to files:
src/extensions/core/groupNodeManage.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{js,ts,jsx,tsx} : Do not replace `&&=` or `||=` with `=` when there is no reason to do so. If you do find a reason to remove either `&&=` or `||=`, leave a comment explaining why the removal occurred
Applied to files:
src/extensions/core/groupNodeManage.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{test,spec}.{ts,tsx} : Use provided test helpers `createTestSubgraph` and `createTestSubgraphNode` from `./fixtures/subgraphHelpers` for consistent subgraph test setup
Applied to files:
src/extensions/core/groupNodeManage.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{test,spec}.{ts,tsx} : When writing tests for subgraph-related code, always import from the barrel export at `@/lib/litegraph/src/litegraph` to avoid circular dependency issues
Applied to files:
src/extensions/core/groupNodeManage.ts
📚 Learning: 2026-01-09T07:29:32.501Z
Learnt from: LittleSound
Repo: Comfy-Org/ComfyUI_frontend PR: 7812
File: src/components/rightSidePanel/RightSidePanel.vue:100-132
Timestamp: 2026-01-09T07:29:32.501Z
Learning: The `findParentGroupInGraph` function in `src/components/rightSidePanel/RightSidePanel.vue` is a temporary workaround for a bug where group sub-items were not updating correctly after a page refresh. It can be removed once that underlying bug is fixed.
Applied to files:
src/extensions/core/groupNodeManage.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: test
- GitHub Check: setup
- GitHub Check: lint-and-format
- GitHub Check: collect
🔇 Additional comments (8)
src/scripts/ui/components/asyncDialog.ts (4)
4-9: Well-implemented generic dialog with defensive initialization.The
DialogAction<T>type alias provides good flexibility, and the defensive initialization of#resolvewith a no-op function addresses the edge case whereclose()could be called beforeshow()/showModal().
11-23: Constructor correctly normalizes actions with appropriate type handling.The normalization of string actions to objects on line 15 is clean. The type assertion on line 19 is necessary because TypeScript cannot infer that the fallback to
action.textis compatible withTwhenvalueis undefined—this is a reasonable trade-off for the flexible API design.
50-54: Properly typed close method with safe default.The
result: T | null = nullparameter maintains type safety while providing a sensible default. The method correctly propagates the result through the resolver.
56-73: Clean static factory with proper generics and cleanup.The static
promptmethod correctly uses a separate generic parameterUfor flexibility, creates a properly typed dialog instance, and ensures cleanup by removing the element after resolution.src/extensions/core/groupNodeManage.ts (2)
20-37: Typed merge helper looks good.The stricter Record-based typing improves safety without changing behavior.
69-74: Good defensive guards for selected node access.Clear runtime checks replace fragile non-null assertions.
src/scripts/api.ts (2)
908-947: Queue prompt normalization is clear and resilient.The tuple union plus warning for unexpected shapes makes the mapping easier to reason about.
1327-1328: Return type for custom nodes i18n is consistent.Using
Record<string, unknown>keeps the locale payload flexible.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
christian-byrne
left a comment
There was a problem hiding this comment.
Can we pause on this one until #7171 is in? Major refactor to related code I believe
src/scripts/api.ts
Outdated
| * @returns The custom nodes i18n data | ||
| */ | ||
| async getCustomNodesI18n(): Promise<Record<string, any>> { | ||
| async getCustomNodesI18n(): Promise<Record<string, unknown>> { |
There was a problem hiding this comment.
We should have a schema for this, or define one otherwise
src/scripts/api.ts
Outdated
| async storeUserData( | ||
| file: string, | ||
| data: any, | ||
| data: BodyInit | Record<string, unknown> | null, |
There was a problem hiding this comment.
May as well use unknown here?
- Add zCustomNodesI18n schema and CustomNodesI18n type to apiSchema.ts - Update getCustomNodesI18n to use new CustomNodesI18n type - Simplify storeUserData data parameter from BodyInit | Record<string, unknown> | null to unknown
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/scripts/api.ts (1)
1076-1096: Guard non-stringify payloads to avoid invalidBodyInit.
Theunknown→BodyInitcast can mask invalid payloads whenstringifyis false; consider validating before request to fail fast and improve error clarity.♻️ Proposed refactor
async storeUserData( file: string, data: unknown, options: RequestInit & { overwrite?: boolean stringify?: boolean throwOnError?: boolean full_info?: boolean } = { overwrite: true, stringify: true, throwOnError: true, full_info: false } ): Promise<Response> { + const isBodyInit = (value: unknown): value is BodyInit => + typeof value === 'string' || + value instanceof Blob || + value instanceof ArrayBuffer || + ArrayBuffer.isView(value) || + value instanceof FormData || + value instanceof URLSearchParams + + let body: BodyInit | undefined + if (options?.stringify === false) { + if (data != null && !isBodyInit(data)) { + throw new Error( + 'storeUserData: non-stringify payload must be a valid BodyInit' + ) + } + body = data ?? undefined + } else { + body = JSON.stringify(data) + } + const resp = await this.fetchApi( `/userdata/${encodeURIComponent(file)}?overwrite=${options.overwrite}&full_info=${options.full_info}`, { method: 'POST', - body: options?.stringify ? JSON.stringify(data) : (data as BodyInit), + body, ...options } )
| if (type === 'COMBO') { | ||
| // Use the array items | ||
| const source = node.outputs?.[0]?.widget?.name | ||
| const output = node.outputs?.[0] as GroupNodeOutput | undefined |
There was a problem hiding this comment.
Using type assertions isn't much safer than any
Removed all 5 any types and replaced with proper TypeScript types. Changes: - Replaced any with Partial<Load3d> for mock objects - Used ReturnType<typeof useLoad3dService> for service mocks - Used ReturnType<typeof useToastStore> for store mocks - Used Load3d['sceneManager'] etc. for nested manager types - Minimized type assertions to 2 necessary as unknown casts Remaining type assertions: - mockNode: Partial LGraphNode mock (constructor incompatible) - sceneManager: Simplified gridHelper mock (vs 82+ Three.js properties) Both mocks accurately reflect implementation usage patterns. All tests passing (33/33), 0 typecheck errors. Part of #8092
Replaced any with ReturnType<typeof useToastStore> for mockToastStore. All tests passing (13/13), 0 typecheck errors. Part of #8092
Replaced all 3 any types with unknown for generic request parameters. All tests passing (11/11), 0 typecheck errors. Part of #8092
Removed all 11 any types and replaced with proper TypeScript types. Changes: - Typed executionStore mock with proper structure - Typed workflowStore.activeWorkflow based on actual usage - Replaced (settingStore.get as any) with vi.mocked(settingStore.get) - Fixed vi.fn() signature to accept key parameter All tests passing (8/9, 1 skipped), 0 typecheck errors. Part of #8092
Removed all 3 any types and replaced with proper TypeScript types. Changes: - Replaced as any with Partial<ReturnType<typeof useSettingStore>> - Used as unknown as for partial mock subgraph (114+ missing properties) All tests passing (3/3), 0 typecheck errors. Part of #8092
Removed all 7 any types by removing unnecessary type assertions. TypeScript can infer return types correctly for mockImplementation callbacks returning literal values. All tests passing (8/8), 0 typecheck errors. Part of #8092
Removed all 3 any types and replaced with proper TypeScript types. Changes: - Replaced as any with as unknown as for partial mockCanvasStore - Removed as any from null assignments (TypeScript infers correctly) All tests passing (7/7), 0 typecheck errors. Part of #8092
Replaced any with proper type for mockCanvas.
Changes:
- Typed mockCanvas as { selectedItems: Set<Positionable> }
- Added as unknown as Positionable casts for MockNode instances
- Added as unknown as cast for getCanvas mock return value
All tests passing (18/18), 0 typecheck errors.
Part of #8092
Removed all 14 any types from Pinia store mocks. Changes: - Replaced as any with as unknown as ReturnType<typeof store> pattern - Removed as any from $state and _p properties (empty objects) All tests passing (6/6), 0 typecheck errors. Part of #8092
Replaced any with Record<string, unknown> for mountComponent props parameter. Uses as unknown as cast to allow testing edge cases with invalid prop types. All tests passing (11/11), 0 typecheck errors. Part of #8092
…#8092) ## Summary Continues the TypeScript strict typing improvements by removing `any` types from core scripts and dialog components. ### Changes **api.ts (6 instances)** - Define `V1RawPrompt` and `CloudRawPrompt` tuple types for queue prompt formats - Export `QueueIndex`, `PromptInputs`, `ExtraData`, `OutputsToExecute` from apiSchema - Type `#postItem` body, `storeUserData` data, and `getCustomNodesI18n` return **groupNodeManage.ts (all @ts-expect-error removed)** - Add `GroupNodeConfigEntry` interface to LGraph.ts - Extend `GroupNodeWorkflowData` with `title`, `widgets_values`, and typed `config` - Type all class properties with definite assignment assertions - Type all method parameters and event handlers - Fix save button callback with proper generic types for node ordering **changeTracker.ts (4 instances)** - Type `nodeOutputs` as `Record<string, ExecutedWsMessage['output']>` - Type prompt callback with `CanvasPointerEvent` and proper value types **asyncDialog.ts and dialog.ts** - Make `ComfyAsyncDialog` generic with `DialogAction<T>` type - Type `ComfyDialog` constructor and show method parameters - Update `ManageGroupDialog.show` signature to match base class ## Test plan - [x] `pnpm typecheck` passes - [x] `pnpm lint` passes - [x] Sourcegraph checks for external usage --- Related: Continues from Comfy-Org#8083 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8092-Road-to-No-Explicit-Any-Part-7-Scripts-and-Dialog-Cleanup-2ea6d73d365081fbb890e73646a6ad16) by [Unito](https://www.unito.io)
## Summary
This PR removes unsafe type assertions ("as unknown as Type") from test
files and improves type safety across the codebase.
### Key Changes
#### Type Safety Improvements
- Removed all instances of "as unknown as" patterns from test files
- Used proper factory functions from litegraphTestUtils instead of
custom mocks
- Made incomplete mocks explicit using Partial<T> types
- Fixed DialogStore mocking with proper interface exports
- Improved type safety with satisfies operator where applicable
#### App Parameter Removal
- **Removed the unused `app` parameter from all ComfyExtension interface
methods**
- The app parameter was always undefined at runtime as it was never
passed from invokeExtensions
- Affected methods: init, setup, addCustomNodeDefs,
beforeRegisterNodeDef, beforeRegisterVueAppNodeDefs,
registerCustomNodes, loadedGraphNode, nodeCreated, beforeConfigureGraph,
afterConfigureGraph
##### Breaking Change Analysis
Verified via Sourcegraph that this is NOT a breaking change:
- Searched all 10 affected methods across GitHub repositories
- Only one external repository
([drawthingsai/draw-things-comfyui](https://github.com/drawthingsai/draw-things-comfyui))
declares the app parameter in their extension methods
- That repository never actually uses the app parameter (just declares
it in the function signature)
- All other repositories already omit the app parameter
- Search queries used:
- [init method
search](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/.*+lang:typescript+%22init%28app%22+-repo:Comfy-Org/ComfyUI_frontend&patternType=standard)
- [setup method
search](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/.*+lang:typescript+%22setup%28app%22+-repo:Comfy-Org/ComfyUI_frontend&patternType=standard)
- Similar searches for all 10 methods confirmed no usage
### Files Changed
Test files:
-
src/components/settings/widgets/__tests__/WidgetInputNumberInput.test.ts
- src/services/keybindingService.escape.test.ts
- src/services/keybindingService.forwarding.test.ts
- src/utils/__tests__/newUserService.test.ts →
src/utils/__tests__/useNewUserService.test.ts
- src/services/jobOutputCache.test.ts
-
src/renderer/extensions/vueNodes/widgets/composables/useRemoteWidget.test.ts
-
src/renderer/extensions/vueNodes/widgets/composables/useIntWidget.test.ts
-
src/renderer/extensions/vueNodes/widgets/composables/useFloatWidget.test.ts
Source files:
- src/types/comfy.ts - Removed app parameter from ComfyExtension
interface
- src/services/extensionService.ts - Improved type safety with
FunctionPropertyNames helper
- src/scripts/metadata/isobmff.ts - Fixed extractJson return type per
review
- src/extensions/core/*.ts - Updated extension implementations
- src/scripts/app.ts - Updated app initialization
### Testing
- All existing tests pass
- Type checking passes
- ESLint/oxlint checks pass
- No breaking changes for external repositories
Part of the "Road to No Explicit Any" initiative.
### Previous PRs in this series:
- Part 2: #7401
- Part 3: #7935
- Part 4: #7970
- Part 5: #8064
- Part 6: #8083
- Part 7: #8092
- Part 8 Group 1: #8253
- Part 8 Group 2: #8258
- Part 8 Group 3: #8304
- Part 8 Group 4: #8314
- Part 8 Group 5: #8329
- Part 8 Group 6: #8344 (this PR)
## Summary
This PR removes unsafe type assertions ("as unknown as Type") from test
files and improves type safety across the codebase.
### Key Changes
#### Type Safety Improvements
- Removed all instances of "as unknown as" patterns from test files
- Used proper factory functions from litegraphTestUtils instead of
custom mocks
- Made incomplete mocks explicit using Partial<T> types
- Fixed DialogStore mocking with proper interface exports
- Improved type safety with satisfies operator where applicable
#### App Parameter Removal
- **Removed the unused `app` parameter from all ComfyExtension interface
methods**
- The app parameter was always undefined at runtime as it was never
passed from invokeExtensions
- Affected methods: init, setup, addCustomNodeDefs,
beforeRegisterNodeDef, beforeRegisterVueAppNodeDefs,
registerCustomNodes, loadedGraphNode, nodeCreated, beforeConfigureGraph,
afterConfigureGraph
##### Breaking Change Analysis
Verified via Sourcegraph that this is NOT a breaking change:
- Searched all 10 affected methods across GitHub repositories
- Only one external repository
([drawthingsai/draw-things-comfyui](https://github.com/drawthingsai/draw-things-comfyui))
declares the app parameter in their extension methods
- That repository never actually uses the app parameter (just declares
it in the function signature)
- All other repositories already omit the app parameter
- Search queries used:
- [init method
search](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/.*+lang:typescript+%22init%28app%22+-repo:Comfy-Org/ComfyUI_frontend&patternType=standard)
- [setup method
search](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/.*+lang:typescript+%22setup%28app%22+-repo:Comfy-Org/ComfyUI_frontend&patternType=standard)
- Similar searches for all 10 methods confirmed no usage
### Files Changed
Test files:
-
src/components/settings/widgets/__tests__/WidgetInputNumberInput.test.ts
- src/services/keybindingService.escape.test.ts
- src/services/keybindingService.forwarding.test.ts
- src/utils/__tests__/newUserService.test.ts →
src/utils/__tests__/useNewUserService.test.ts
- src/services/jobOutputCache.test.ts
-
src/renderer/extensions/vueNodes/widgets/composables/useRemoteWidget.test.ts
-
src/renderer/extensions/vueNodes/widgets/composables/useIntWidget.test.ts
-
src/renderer/extensions/vueNodes/widgets/composables/useFloatWidget.test.ts
Source files:
- src/types/comfy.ts - Removed app parameter from ComfyExtension
interface
- src/services/extensionService.ts - Improved type safety with
FunctionPropertyNames helper
- src/scripts/metadata/isobmff.ts - Fixed extractJson return type per
review
- src/extensions/core/*.ts - Updated extension implementations
- src/scripts/app.ts - Updated app initialization
### Testing
- All existing tests pass
- Type checking passes
- ESLint/oxlint checks pass
- No breaking changes for external repositories
Part of the "Road to No Explicit Any" initiative.
### Previous PRs in this series:
- Part 2: #7401
- Part 3: #7935
- Part 4: #7970
- Part 5: #8064
- Part 6: #8083
- Part 7: #8092
- Part 8 Group 1: #8253
- Part 8 Group 2: #8258
- Part 8 Group 3: #8304
- Part 8 Group 4: #8314
- Part 8 Group 5: #8329
- Part 8 Group 6: #8344 (this PR)
## Summary
This PR removes unsafe type assertions ("as unknown as Type") from test
files and improves type safety across the codebase.
### Key Changes
#### Type Safety Improvements
- Removed improper `as unknown as Type` patterns from 17 test files in
Group 8 part 7
- Replaced with proper TypeScript patterns using factory functions and
Mock types
- Fixed createTestingPinia usage in test files (was incorrectly using
createPinia)
- Fixed vi.hoisted pattern for mockSetDirty in viewport tests
- Fixed vi.doMock lint issues with vi.mock and vi.hoisted pattern
- Retained necessary `as unknown as` casts only for complex mock objects
where direct type assertions would fail
### Files Changed
Test files (Group 8 part 7 - services, stores, utils):
- src/services/nodeOrganizationService.test.ts
- src/services/providers/algoliaSearchProvider.test.ts
- src/services/providers/registrySearchProvider.test.ts
- src/stores/comfyRegistryStore.test.ts
- src/stores/domWidgetStore.test.ts
- src/stores/executionStore.test.ts
- src/stores/firebaseAuthStore.test.ts
- src/stores/modelToNodeStore.test.ts
- src/stores/queueStore.test.ts
- src/stores/subgraphNavigationStore.test.ts
- src/stores/subgraphNavigationStore.viewport.test.ts
- src/stores/subgraphStore.test.ts
- src/stores/systemStatsStore.test.ts
- src/stores/workspace/nodeHelpStore.test.ts
- src/utils/colorUtil.test.ts
- src/utils/executableGroupNodeChildDTO.test.ts
Source files:
- src/stores/modelStore.ts - Improved type handling
### Testing
- All TypeScript type checking passes (`pnpm typecheck`)
- All affected test files pass (`pnpm test:unit`)
- Linting passes without errors (`pnpm lint`)
- Code formatting applied (`pnpm format`)
Part of the "Road to No Explicit Any" initiative, cleaning up type
casting issues from branch `fix/remove-any-types-part8`.
### Previous PRs in this series:
- Part 2: #7401
- Part 3: #7935
- Part 4: #7970
- Part 5: #8064
- Part 6: #8083
- Part 7: #8092
- Part 8 Group 1: #8253
- Part 8 Group 2: #8258
- Part 8 Group 3: #8304
- Part 8 Group 4: #8314
- Part 8 Group 5: #8329
- Part 8 Group 6: #8344
- Part 8 Group 7: #8459 (this PR)
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8459-Road-to-No-explicit-any-Group-8-part-7-test-files-2f86d73d36508114ad28d82e72a3a5e9)
by [Unito](https://www.unito.io)
## Summary
This PR removes unsafe type assertions ("as unknown as Type") from test
files and improves type safety across the codebase.
### Key Changes
#### Type Safety Improvements
- Removed improper `as unknown as Type` patterns from 17 test files in
Group 8 part 7
- Replaced with proper TypeScript patterns using factory functions and
Mock types
- Fixed createTestingPinia usage in test files (was incorrectly using
createPinia)
- Fixed vi.hoisted pattern for mockSetDirty in viewport tests
- Fixed vi.doMock lint issues with vi.mock and vi.hoisted pattern
- Retained necessary `as unknown as` casts only for complex mock objects
where direct type assertions would fail
### Files Changed
Test files (Group 8 part 7 - services, stores, utils):
- src/services/nodeOrganizationService.test.ts
- src/services/providers/algoliaSearchProvider.test.ts
- src/services/providers/registrySearchProvider.test.ts
- src/stores/comfyRegistryStore.test.ts
- src/stores/domWidgetStore.test.ts
- src/stores/executionStore.test.ts
- src/stores/firebaseAuthStore.test.ts
- src/stores/modelToNodeStore.test.ts
- src/stores/queueStore.test.ts
- src/stores/subgraphNavigationStore.test.ts
- src/stores/subgraphNavigationStore.viewport.test.ts
- src/stores/subgraphStore.test.ts
- src/stores/systemStatsStore.test.ts
- src/stores/workspace/nodeHelpStore.test.ts
- src/utils/colorUtil.test.ts
- src/utils/executableGroupNodeChildDTO.test.ts
Source files:
- src/stores/modelStore.ts - Improved type handling
### Testing
- All TypeScript type checking passes (`pnpm typecheck`)
- All affected test files pass (`pnpm test:unit`)
- Linting passes without errors (`pnpm lint`)
- Code formatting applied (`pnpm format`)
Part of the "Road to No Explicit Any" initiative, cleaning up type
casting issues from branch `fix/remove-any-types-part8`.
### Previous PRs in this series:
- Part 2: #7401
- Part 3: #7935
- Part 4: #7970
- Part 5: #8064
- Part 6: #8083
- Part 7: #8092
- Part 8 Group 1: #8253
- Part 8 Group 2: #8258
- Part 8 Group 3: #8304
- Part 8 Group 4: #8314
- Part 8 Group 5: #8329
- Part 8 Group 6: #8344
- Part 8 Group 7: #8459 (this PR)
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8459-Road-to-No-explicit-any-Group-8-part-7-test-files-2f86d73d36508114ad28d82e72a3a5e9)
by [Unito](https://www.unito.io)
## Summary
This PR removes unsafe type assertions ("as unknown as Type") from test
files and improves type safety across the codebase.
### Key Changes
#### Type Safety Improvements
- Removed improper `as unknown as Type` patterns from test files in
Group 8 part 8
- Replaced with proper TypeScript patterns using Pinia store testing
patterns
- Fixed parameter shadowing issue in typeGuardUtil.test.ts (constructor
→ nodeConstructor)
- Fixed stale mock values in useConflictDetection.test.ts using getter
functions
- Refactored useManagerState tests to follow proper Pinia store testing
patterns with createTestingPinia
### Files Changed
Test files (Group 8 part 8 - utils and manager composables):
- src/utils/typeGuardUtil.test.ts - Fixed parameter shadowing
- src/utils/graphTraversalUtil.test.ts - Removed unsafe type assertions
- src/utils/litegraphUtil.test.ts - Improved type handling
- src/workbench/extensions/manager/composables/useManagerState.test.ts -
Complete rewrite using Pinia testing patterns
-
src/workbench/extensions/manager/composables/useConflictDetection.test.ts
- Fixed stale mock values with getters
- src/workbench/extensions/manager/composables/useManagerQueue.test.ts -
Type safety improvements
-
src/workbench/extensions/manager/composables/nodePack/useMissingNodes.test.ts
- Removed unsafe casts
-
src/workbench/extensions/manager/composables/nodePack/usePacksSelection.test.ts
- Type improvements
-
src/workbench/extensions/manager/composables/nodePack/usePacksStatus.test.ts
- Type improvements
- src/workbench/extensions/manager/utils/versionUtil.test.ts - Type
safety fixes
Source files (minor type fixes):
- src/utils/fuseUtil.ts - Type improvements
- src/utils/linkFixer.ts - Type safety fixes
- src/utils/syncUtil.ts - Type improvements
-
src/workbench/extensions/manager/composables/nodePack/useWorkflowPacks.ts
- Type fix
-
src/workbench/extensions/manager/composables/useConflictAcknowledgment.ts
- Type fix
### Testing
- All TypeScript type checking passes (`pnpm typecheck`)
- All affected test files pass (`pnpm test:unit`)
- Linting passes without errors (`pnpm lint`)
- Code formatting applied (`pnpm format`)
Part of the "Road to No Explicit Any" initiative, cleaning up type
casting issues from branch `fix/remove-any-types-part8`.
### Previous PRs in this series:
- Part 2: #7401
- Part 3: #7935
- Part 4: #7970
- Part 5: #8064
- Part 6: #8083
- Part 7: #8092
- Part 8 Group 1: #8253
- Part 8 Group 2: #8258
- Part 8 Group 3: #8304
- Part 8 Group 4: #8314
- Part 8 Group 5: #8329
- Part 8 Group 6: #8344
- Part 8 Group 7: #8459
- Part 8 Group 8: #8496 (this PR)
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8496-Road-to-No-explicit-any-Group-8-part-8-test-files-2f86d73d365081f3afdcf8d01fba81e1)
by [Unito](https://www.unito.io)
---------
Co-authored-by: GitHub Action <action@github.com>
## Summary
This PR removes unsafe type assertions ("as unknown as Type") from test
files and improves type safety across the codebase.
### Key Changes
#### Type Safety Improvements
- Removed improper `as unknown as Type` patterns from 17 test files in
Group 8 part 7
- Replaced with proper TypeScript patterns using factory functions and
Mock types
- Fixed createTestingPinia usage in test files (was incorrectly using
createPinia)
- Fixed vi.hoisted pattern for mockSetDirty in viewport tests
- Fixed vi.doMock lint issues with vi.mock and vi.hoisted pattern
- Retained necessary `as unknown as` casts only for complex mock objects
where direct type assertions would fail
### Files Changed
Test files (Group 8 part 7 - services, stores, utils):
- src/services/nodeOrganizationService.test.ts
- src/services/providers/algoliaSearchProvider.test.ts
- src/services/providers/registrySearchProvider.test.ts
- src/stores/comfyRegistryStore.test.ts
- src/stores/domWidgetStore.test.ts
- src/stores/executionStore.test.ts
- src/stores/firebaseAuthStore.test.ts
- src/stores/modelToNodeStore.test.ts
- src/stores/queueStore.test.ts
- src/stores/subgraphNavigationStore.test.ts
- src/stores/subgraphNavigationStore.viewport.test.ts
- src/stores/subgraphStore.test.ts
- src/stores/systemStatsStore.test.ts
- src/stores/workspace/nodeHelpStore.test.ts
- src/utils/colorUtil.test.ts
- src/utils/executableGroupNodeChildDTO.test.ts
Source files:
- src/stores/modelStore.ts - Improved type handling
### Testing
- All TypeScript type checking passes (`pnpm typecheck`)
- All affected test files pass (`pnpm test:unit`)
- Linting passes without errors (`pnpm lint`)
- Code formatting applied (`pnpm format`)
Part of the "Road to No Explicit Any" initiative, cleaning up type
casting issues from branch `fix/remove-any-types-part8`.
### Previous PRs in this series:
- Part 2: #7401
- Part 3: #7935
- Part 4: #7970
- Part 5: #8064
- Part 6: #8083
- Part 7: #8092
- Part 8 Group 1: #8253
- Part 8 Group 2: #8258
- Part 8 Group 3: #8304
- Part 8 Group 4: #8314
- Part 8 Group 5: #8329
- Part 8 Group 6: #8344
- Part 8 Group 7: #8459 (this PR)
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8459-Road-to-No-explicit-any-Group-8-part-7-test-files-2f86d73d36508114ad28d82e72a3a5e9)
by [Unito](https://www.unito.io)
## Summary
This PR removes unsafe type assertions ("as unknown as Type") from test
files and improves type safety across the codebase.
### Key Changes
#### Type Safety Improvements
- Removed improper `as unknown as Type` patterns from test files in
Group 8 part 8
- Replaced with proper TypeScript patterns using Pinia store testing
patterns
- Fixed parameter shadowing issue in typeGuardUtil.test.ts (constructor
→ nodeConstructor)
- Fixed stale mock values in useConflictDetection.test.ts using getter
functions
- Refactored useManagerState tests to follow proper Pinia store testing
patterns with createTestingPinia
### Files Changed
Test files (Group 8 part 8 - utils and manager composables):
- src/utils/typeGuardUtil.test.ts - Fixed parameter shadowing
- src/utils/graphTraversalUtil.test.ts - Removed unsafe type assertions
- src/utils/litegraphUtil.test.ts - Improved type handling
- src/workbench/extensions/manager/composables/useManagerState.test.ts -
Complete rewrite using Pinia testing patterns
-
src/workbench/extensions/manager/composables/useConflictDetection.test.ts
- Fixed stale mock values with getters
- src/workbench/extensions/manager/composables/useManagerQueue.test.ts -
Type safety improvements
-
src/workbench/extensions/manager/composables/nodePack/useMissingNodes.test.ts
- Removed unsafe casts
-
src/workbench/extensions/manager/composables/nodePack/usePacksSelection.test.ts
- Type improvements
-
src/workbench/extensions/manager/composables/nodePack/usePacksStatus.test.ts
- Type improvements
- src/workbench/extensions/manager/utils/versionUtil.test.ts - Type
safety fixes
Source files (minor type fixes):
- src/utils/fuseUtil.ts - Type improvements
- src/utils/linkFixer.ts - Type safety fixes
- src/utils/syncUtil.ts - Type improvements
-
src/workbench/extensions/manager/composables/nodePack/useWorkflowPacks.ts
- Type fix
-
src/workbench/extensions/manager/composables/useConflictAcknowledgment.ts
- Type fix
### Testing
- All TypeScript type checking passes (`pnpm typecheck`)
- All affected test files pass (`pnpm test:unit`)
- Linting passes without errors (`pnpm lint`)
- Code formatting applied (`pnpm format`)
Part of the "Road to No Explicit Any" initiative, cleaning up type
casting issues from branch `fix/remove-any-types-part8`.
### Previous PRs in this series:
- Part 2: #7401
- Part 3: #7935
- Part 4: #7970
- Part 5: #8064
- Part 6: #8083
- Part 7: #8092
- Part 8 Group 1: #8253
- Part 8 Group 2: #8258
- Part 8 Group 3: #8304
- Part 8 Group 4: #8314
- Part 8 Group 5: #8329
- Part 8 Group 6: #8344
- Part 8 Group 7: #8459
- Part 8 Group 8: #8496 (this PR)
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8496-Road-to-No-explicit-any-Group-8-part-8-test-files-2f86d73d365081f3afdcf8d01fba81e1)
by [Unito](https://www.unito.io)
---------
Co-authored-by: GitHub Action <action@github.com>
## Summary This PR removes `any` types from UI component files and replaces them with proper TypeScript types. ### Key Changes #### Type Safety Improvements - Replaced `any` with `unknown`, explicit types, or proper interfaces across UI components - Used `ComponentPublicInstance` with explicit method signatures for component refs - Used `Record<string, unknown>` for dynamic property access - Added generics for form components with flexible value types - Used `CSSProperties` for style objects ### Files Changed UI Components: - src/components/common/ComfyImage.vue - Used proper class prop type - src/components/common/DeviceInfo.vue - Used `string | number` for formatValue - src/components/common/FormItem.vue - Used `unknown` for model value - src/components/common/FormRadioGroup.vue - Added generic type parameter - src/components/common/TreeExplorer.vue - Used proper async function signature - src/components/custom/widget/WorkflowTemplateSelectorDialog.vue - Fixed duplicate import - src/components/graph/CanvasModeSelector.vue - Used `ComponentPublicInstance` for ref - src/components/node/NodePreview.vue - Changed `any` to `unknown` - src/components/queue/job/JobDetailsPopover.vue - Removed unnecessary casts - src/components/queue/job/JobFiltersBar.vue - Removed `as any` casts - src/platform/assets/components/MediaAssetContextMenu.vue - Added `ContextMenuInstance` type - src/renderer/extensions/minimap/MiniMapPanel.vue - Used `CSSProperties` - src/renderer/extensions/vueNodes/composables/useNodeTooltips.ts - Added `PrimeVueTooltipElement` interface - src/renderer/extensions/vueNodes/widgets/components/form/FormSelectButton.vue - Used `Record<string, unknown>` - src/workbench/extensions/manager/components/manager/infoPanel/tabs/DescriptionTabPanel.vue - Added `LicenseObject` interface ### Testing - All TypeScript type checking passes (`pnpm typecheck`) - Linting passes without errors (`pnpm lint`) Part of the "Road to No Explicit Any" initiative. ### Previous PRs in this series: - Part 2: #7401 - Part 3: #7935 - Part 4: #7970 - Part 5: #8064 - Part 6: #8083 - Part 7: #8092 - Part 8 Group 1: #8253 - Part 8 Group 2: #8258 - Part 8 Group 3: #8304 - Part 8 Group 4: #8314 - Part 8 Group 5: #8329 - Part 8 Group 6: #8344 - Part 8 Group 7: #8459 - Part 8 Group 8: #8496 - Part 9: #8498 - Part 10: #8499 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8499-Road-to-No-Explicit-Any-Part-10-2f86d73d365081aab129f165c7d02434) by [Unito](https://www.unito.io)
## Summary
This PR removes `any` types from core source files and replaces them
with proper TypeScript types.
### Key Changes
#### Type Safety Improvements
- Replaced `any` with `unknown`, explicit types, or proper interfaces
across core files
- Introduced new type definitions: `SceneConfig`, `Load3DNode`,
`ElectronWindow`
- Used `Object.assign` instead of `as any` for dynamic property
assignment
- Replaced `as any` casts with proper type assertions
### Files Changed
Source files:
- src/extensions/core/widgetInputs.ts - Removed unnecessary `as any`
cast
- src/platform/cloud/onboarding/auth.ts - Used `Record<string, unknown>`
and Sentry types
- src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts -
Used `AuditLog[]` type
- src/platform/workflow/management/stores/workflowStore.ts - Used
`typeof ComfyWorkflow` constructor type
- src/scripts/app.ts - Used `ResultItem[]` for Clipspace images
- src/services/colorPaletteService.ts - Used `Object.assign` instead of
`as any`
- src/services/customerEventsService.ts - Used `unknown` instead of
`any`
- src/services/load3dService.ts - Added proper interface types for
Load3D nodes
- src/types/litegraph-augmentation.d.ts - Used `TWidgetValue[]` type
- src/utils/envUtil.ts - Added ElectronWindow interface
- src/workbench/extensions/manager/stores/comfyManagerStore.ts - Typed
event as `CustomEvent<{ ui_id?: string }>`
### Testing
- All TypeScript type checking passes (`pnpm typecheck`)
- Linting passes without errors (`pnpm lint`)
- Code formatting applied (`pnpm format`)
Part of the "Road to No Explicit Any" initiative.
### Previous PRs in this series:
- Part 2: #7401
- Part 3: #7935
- Part 4: #7970
- Part 5: #8064
- Part 6: #8083
- Part 7: #8092
- Part 8 Group 1: #8253
- Part 8 Group 2: #8258
- Part 8 Group 3: #8304
- Part 8 Group 4: #8314
- Part 8 Group 5: #8329
- Part 8 Group 6: #8344
- Part 8 Group 7: #8459
- Part 8 Group 8: #8496
- Part 9: #8498 (this PR)
## Summary
This PR removes `any` types from widgets, services, stores, and test
files, replacing them with proper TypeScript types.
### Key Changes
#### Type Safety Improvements
- Replaced `any` with `unknown`, explicit types, or proper interfaces
across widgets and services
- Added proper type imports (TgpuRoot, Point, StyleValue, etc.)
- Created typed interfaces (NumericWidgetOptions, TestWindow,
ImportFailureDetail, etc.)
- Fixed function return types to be non-nullable where appropriate
- Added type guards and null checks instead of non-null assertions
- Used `ComponentProps` from vue-component-type-helpers for component
testing
#### Widget System
- Added index signature to IWidgetOptions for Record compatibility
- Centralized disabled logic in WidgetInputNumberInput
- Moved template type assertions to computed properties
- Fixed ComboWidget getOptionLabel type assertions
- Improved remote widget type handling with runtime checks
#### Services & Stores
- Fixed getOrCreateViewer to return non-nullable values
- Updated addNodeOnGraph to use specific options type `{ pos?: Point }`
- Added proper type assertions for settings store retrieval
- Fixed executionIdToCurrentId return type (string | undefined)
#### Test Infrastructure
- Exported GraphOrSubgraph from litegraph barrel to avoid circular
dependencies
- Updated test fixtures with proper TypeScript types (TestInfo,
LGraphNode)
- Replaced loose Record types with ComponentProps in tests
- Added proper error handling in WebSocket fixture
#### Code Organization
- Created shared i18n-types module for locale data types
- Made ImportFailureDetail non-exported (internal use only)
- Added @public JSDoc tag to ElectronWindow type
- Fixed console.log usage in scripts to use allowed methods
### Files Changed
**Widgets & Components:**
-
src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
-
src/renderer/extensions/vueNodes/widgets/components/WidgetSelectDefault.vue
-
src/renderer/extensions/vueNodes/widgets/components/WidgetSelectDropdown.vue
- src/renderer/extensions/vueNodes/widgets/components/WidgetTextarea.vue
-
src/renderer/extensions/vueNodes/widgets/composables/useRemoteWidget.ts
- src/lib/litegraph/src/widgets/ComboWidget.ts
- src/lib/litegraph/src/types/widgets.ts
- src/components/common/LazyImage.vue
- src/components/load3d/Load3dViewerContent.vue
**Services & Stores:**
- src/services/litegraphService.ts
- src/services/load3dService.ts
- src/services/colorPaletteService.ts
- src/stores/maskEditorStore.ts
- src/stores/nodeDefStore.ts
- src/platform/settings/settingStore.ts
- src/platform/workflow/management/stores/workflowStore.ts
**Composables & Utils:**
- src/composables/node/useWatchWidget.ts
- src/composables/useCanvasDrop.ts
- src/utils/widgetPropFilter.ts
- src/utils/queueDisplay.ts
- src/utils/envUtil.ts
**Test Files:**
- browser_tests/fixtures/ComfyPage.ts
- browser_tests/fixtures/ws.ts
- browser_tests/tests/actionbar.spec.ts
-
src/workbench/extensions/manager/components/manager/skeleton/PackCardGridSkeleton.test.ts
- src/lib/litegraph/src/subgraph/subgraphUtils.test.ts
- src/components/rightSidePanel/shared.test.ts
- src/platform/cloud/subscription/composables/useSubscription.test.ts
-
src/platform/workflow/persistence/composables/useWorkflowPersistence.test.ts
**Scripts & Types:**
- scripts/i18n-types.ts (new shared module)
- scripts/diff-i18n.ts
- scripts/check-unused-i18n-keys.ts
- src/workbench/extensions/manager/types/conflictDetectionTypes.ts
- src/types/algoliaTypes.ts
- src/types/simplifiedWidget.ts
**Infrastructure:**
- src/lib/litegraph/src/litegraph.ts (added GraphOrSubgraph export)
- src/lib/litegraph/src/infrastructure/CustomEventTarget.ts
- src/platform/assets/services/assetService.ts
**Stories:**
- apps/desktop-ui/src/views/InstallView.stories.ts
- src/components/queue/job/JobDetailsPopover.stories.ts
**Extension Manager:**
- src/workbench/extensions/manager/composables/useConflictDetection.ts
- src/workbench/extensions/manager/composables/useManagerQueue.ts
- src/workbench/extensions/manager/services/comfyManagerService.ts
- src/workbench/extensions/manager/utils/conflictMessageUtil.ts
### Testing
- [x] All TypeScript type checking passes (`pnpm typecheck`)
- [x] ESLint passes without errors (`pnpm lint`)
- [x] Format checks pass (`pnpm format:check`)
- [x] Knip (unused exports) passes (`pnpm knip`)
- [x] Pre-commit and pre-push hooks pass
Part of the "Road to No Explicit Any" initiative.
### Previous PRs in this series:
- Part 2: #7401
- Part 3: #7935
- Part 4: #7970
- Part 5: #8064
- Part 6: #8083
- Part 7: #8092
- Part 8 Group 1: #8253
- Part 8 Group 2: #8258
- Part 8 Group 3: #8304
- Part 8 Group 4: #8314
- Part 8 Group 5: #8329
- Part 8 Group 6: #8344
- Part 8 Group 7: #8459
- Part 8 Group 8: #8496
- Part 9: #8498
- Part 10: #8499
---------
Co-authored-by: Comfy Org PR Bot <snomiao+comfy-pr@gmail.com>
Co-authored-by: christian-byrne <72887196+christian-byrne@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
## Summary
This PR removes `any` types from widgets, services, stores, and test
files, replacing them with proper TypeScript types.
### Key Changes
#### Type Safety Improvements
- Replaced `any` with `unknown`, explicit types, or proper interfaces
across widgets and services
- Added proper type imports (TgpuRoot, Point, StyleValue, etc.)
- Created typed interfaces (NumericWidgetOptions, TestWindow,
ImportFailureDetail, etc.)
- Fixed function return types to be non-nullable where appropriate
- Added type guards and null checks instead of non-null assertions
- Used `ComponentProps` from vue-component-type-helpers for component
testing
#### Widget System
- Added index signature to IWidgetOptions for Record compatibility
- Centralized disabled logic in WidgetInputNumberInput
- Moved template type assertions to computed properties
- Fixed ComboWidget getOptionLabel type assertions
- Improved remote widget type handling with runtime checks
#### Services & Stores
- Fixed getOrCreateViewer to return non-nullable values
- Updated addNodeOnGraph to use specific options type `{ pos?: Point }`
- Added proper type assertions for settings store retrieval
- Fixed executionIdToCurrentId return type (string | undefined)
#### Test Infrastructure
- Exported GraphOrSubgraph from litegraph barrel to avoid circular
dependencies
- Updated test fixtures with proper TypeScript types (TestInfo,
LGraphNode)
- Replaced loose Record types with ComponentProps in tests
- Added proper error handling in WebSocket fixture
#### Code Organization
- Created shared i18n-types module for locale data types
- Made ImportFailureDetail non-exported (internal use only)
- Added @public JSDoc tag to ElectronWindow type
- Fixed console.log usage in scripts to use allowed methods
### Files Changed
**Widgets & Components:**
-
src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
-
src/renderer/extensions/vueNodes/widgets/components/WidgetSelectDefault.vue
-
src/renderer/extensions/vueNodes/widgets/components/WidgetSelectDropdown.vue
- src/renderer/extensions/vueNodes/widgets/components/WidgetTextarea.vue
-
src/renderer/extensions/vueNodes/widgets/composables/useRemoteWidget.ts
- src/lib/litegraph/src/widgets/ComboWidget.ts
- src/lib/litegraph/src/types/widgets.ts
- src/components/common/LazyImage.vue
- src/components/load3d/Load3dViewerContent.vue
**Services & Stores:**
- src/services/litegraphService.ts
- src/services/load3dService.ts
- src/services/colorPaletteService.ts
- src/stores/maskEditorStore.ts
- src/stores/nodeDefStore.ts
- src/platform/settings/settingStore.ts
- src/platform/workflow/management/stores/workflowStore.ts
**Composables & Utils:**
- src/composables/node/useWatchWidget.ts
- src/composables/useCanvasDrop.ts
- src/utils/widgetPropFilter.ts
- src/utils/queueDisplay.ts
- src/utils/envUtil.ts
**Test Files:**
- browser_tests/fixtures/ComfyPage.ts
- browser_tests/fixtures/ws.ts
- browser_tests/tests/actionbar.spec.ts
-
src/workbench/extensions/manager/components/manager/skeleton/PackCardGridSkeleton.test.ts
- src/lib/litegraph/src/subgraph/subgraphUtils.test.ts
- src/components/rightSidePanel/shared.test.ts
- src/platform/cloud/subscription/composables/useSubscription.test.ts
-
src/platform/workflow/persistence/composables/useWorkflowPersistence.test.ts
**Scripts & Types:**
- scripts/i18n-types.ts (new shared module)
- scripts/diff-i18n.ts
- scripts/check-unused-i18n-keys.ts
- src/workbench/extensions/manager/types/conflictDetectionTypes.ts
- src/types/algoliaTypes.ts
- src/types/simplifiedWidget.ts
**Infrastructure:**
- src/lib/litegraph/src/litegraph.ts (added GraphOrSubgraph export)
- src/lib/litegraph/src/infrastructure/CustomEventTarget.ts
- src/platform/assets/services/assetService.ts
**Stories:**
- apps/desktop-ui/src/views/InstallView.stories.ts
- src/components/queue/job/JobDetailsPopover.stories.ts
**Extension Manager:**
- src/workbench/extensions/manager/composables/useConflictDetection.ts
- src/workbench/extensions/manager/composables/useManagerQueue.ts
- src/workbench/extensions/manager/services/comfyManagerService.ts
- src/workbench/extensions/manager/utils/conflictMessageUtil.ts
### Testing
- [x] All TypeScript type checking passes (`pnpm typecheck`)
- [x] ESLint passes without errors (`pnpm lint`)
- [x] Format checks pass (`pnpm format:check`)
- [x] Knip (unused exports) passes (`pnpm knip`)
- [x] Pre-commit and pre-push hooks pass
Part of the "Road to No Explicit Any" initiative.
### Previous PRs in this series:
- Part 2: #7401
- Part 3: #7935
- Part 4: #7970
- Part 5: #8064
- Part 6: #8083
- Part 7: #8092
- Part 8 Group 1: #8253
- Part 8 Group 2: #8258
- Part 8 Group 3: #8304
- Part 8 Group 4: #8314
- Part 8 Group 5: #8329
- Part 8 Group 6: #8344
- Part 8 Group 7: #8459
- Part 8 Group 8: #8496
- Part 9: #8498
- Part 10: #8499
---------
Co-authored-by: Comfy Org PR Bot <snomiao+comfy-pr@gmail.com>
Co-authored-by: christian-byrne <72887196+christian-byrne@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Summary
Continues the TypeScript strict typing improvements by removing
anytypes from core scripts and dialog components.Changes
api.ts (6 instances)
V1RawPromptandCloudRawPrompttuple types for queue prompt formatsQueueIndex,PromptInputs,ExtraData,OutputsToExecutefrom apiSchema#postItembody,storeUserDatadata, andgetCustomNodesI18nreturngroupNodeManage.ts (all @ts-expect-error removed)
GroupNodeConfigEntryinterface to LGraph.tsGroupNodeWorkflowDatawithtitle,widgets_values, and typedconfigchangeTracker.ts (4 instances)
nodeOutputsasRecord<string, ExecutedWsMessage['output']>CanvasPointerEventand proper value typesasyncDialog.ts and dialog.ts
ComfyAsyncDialoggeneric withDialogAction<T>typeComfyDialogconstructor and show method parametersManageGroupDialog.showsignature to match base classTest plan
pnpm typecheckpassespnpm lintpassesRelated: Continues from #8083
┆Issue is synchronized with this Notion page by Unito