Comfy-Org / Comfy-Org/ComfyUI_frontend
Refactor promoted-widget persisted schema to named variants
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
Follow-up from #11559 and DrJKL's review.
Current state:
- `src/core/schemas/promotionSchema.ts:20` persists promoted-widget identity plus inline value as a 2/3/4-tuple union.
- `src/core/schemas/promotionSchema.ts:57` exports `getProxyWidgetInlineState()` so callers can inspect tuple arity.
- `src/lib/litegraph/src/subgraph/SubgraphNode.ts:1191` branches on the optional inline tuple state during configure.
Goal:
- Replace the tuple-arity persisted shape with named object variants, preferably a discriminated union.
- Keep migration/tolerant reads for the current tuple forms.
- Remove tuple-position-specific helper surface once callers can narrow by discriminator.
Why:
- The 4-tuple is now a forward persistence commitment. Named variants would make future schema changes additive and easier for extension authors to understand.
┆Issue is synchronized with this [Notion page](https://app.notion.com/p/Issue-11738-Refactor-promoted-widget-persisted-schema-to-named-variants-3516d73d3650812f88d8f8ff48b099e8) by [Unito](https://www.unito.io)
Contributor guide
Research direction
Start with src/core/schemas/promotionSchema.ts at lines 20 and 57, then trace the configure branch in src/lib/litegraph/src/subgraph/SubgraphNode.ts:1191. Define the named persisted variants while retaining tolerant reads for the existing tuple forms, and remove the tuple-position-specific helper once callers can narrow by discriminator.
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
- Mostly clear
- Newbie friendliness
- 48/100