Comfy-Org / Comfy-Org/ComfyUI_frontend
Sweep: Replace bare `string` NodeId typings in renderer / composables / core
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 704
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 512
Description
Follow-up to #11428 (canonical type now landed in #11839).
Replace bare \`nodeId: string\` typings in renderer, composable, and core graph code with the appropriate layered \`NodeId\` type:
- **Inside \`src/renderer/**\`** → use \`NodeId\` from \`@/renderer/core/layout/types\` (narrower \`string\`-only renderer alias).
- **Composables and \`src/core/**\`** → use canonical \`NodeId\` from \`@/lib/litegraph/src/LGraphNode\` (\`number | string\`), unless the call site is exclusively rendering Vue nodes, in which case the renderer alias is fine.
When in doubt, prefer the canonical (wider) type — narrowing later is cheap, widening later is the kind of churn this issue is trying to eliminate.
## Scope (17 files)
Composables / core:
- \`src/composables/canvas/useFocusNode.ts\`
- \`src/composables/graph/useGraphNodeManager.ts\`
- \`src/composables/node/useNodePricing.ts\`
- \`src/composables/painter/usePainter.ts\`
- \`src/core/graph/subgraph/promotedWidgetView.ts\`
- \`src/core/graph/subgraph/resolveConcretePromotedWidget.ts\`
- \`src/core/graph/subgraph/resolveSubgraphInputTarget.ts\`
Renderer:
- \`src/renderer/core/canvas/links/slotLinkDragUIState.ts\`
- \`src/renderer/core/layout/slots/slotIdentifier.ts\`
- \`src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts\`
- \`src/renderer/extensions/vueNodes/composables/useProcessedWidgets.ts\`
- \`src/renderer/extensions/vueNodes/composables/useSlotElementTracking.ts\`
- \`src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts\`
- \`src/renderer/extensions/vueNodes/stores/nodeSlotRegistryStore.ts\`
- \`src/renderer/extensions/vueNodes/widgets/components/WidgetDOM.vue\`
- \`src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue\`
- \`src/renderer/extensions/vueNodes/widgets/components/WidgetRecordAudio.vue\`
## Acceptance
- [ ] Every \`nodeId: string\` in the listed files swapped to the appropriate layered \`NodeId\` type
- [ ] \`pnpm typecheck\` passes
- [ ] PR diff stays under ~300 LOC of non-test code
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-11842-Sweep-Replace-bare-string-NodeId-typings-in-renderer-composables-core-3546d73d365081aeb0edfa18f6b0e26d) by [Unito](https://www.unito.io)
Contributor guide
Research direction
Review the 17 files listed in the issue, beginning with the existing NodeId definitions in src/renderer/core/layout/types and src/lib/litegraph/src/LGraphNode. Replace each listed bare nodeId: string with the appropriate layered type, then run pnpm typecheck. Done means all listed typings are updated, typecheck passes, and the non-test diff stays under about 300 LOC.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100