Comfy-Org / Comfy-Org/ComfyUI_frontend
Break promotion and canvas import cycles and ratchet the baseline
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
Audit and break the promotion/canvas and manager import cycles identified in the architecture review. The review reported 64 cycles; that number is historical and must be remeasured against the implementation commit.
Current evidence: [promotionUtils.ts](https://github.com/Comfy-Org/ComfyUI_frontend/blob/686a91971eccaec062b39830764b04e5d0aa8a03/src/core/graph/subgraph/promotionUtils.ts) imports `useCanvasStore` from `src/renderer/core/canvas/canvasStore.ts`. The older review path `src/stores/canvasStore.ts` no longer exists. Reconstruct the complete cycle with Fallow before changing its edges; the import alone does not prove the full cycle.
Invert the dependency by passing needed canvas state through a narrow boundary or moving shared promotion helpers below the store. Apply the same analysis to the manager cluster. Follow the repository's layer rules and avoid a new reverse dependency.
Acceptance:
- Record the exact base/head commits and fresh Fallow cycle output.
- Remove the named promotion/canvas cycle and reduce the cycle baseline (the review target was below 64).
- Preserve promotion behavior with focused tests.
- Ratchet the verified baseline so new cycles fail rather than increasing allowances.
Upstream transfer for FE-2113. Implementation belongs upstream.
Contributor guide
Research direction
Record the implementation base and head commits, then use Fallow to reconstruct the complete cycle involving src/core/graph/subgraph/promotionUtils.ts and src/renderer/core/canvas/canvasStore.ts before changing imports. Apply the same analysis to the manager cluster and inspect the repository's layer rules. Done means the named cycle is removed, the verified baseline is ratcheted below the measured count, and focused promotion tests preserve behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100