Repository navigation
refactor: keep blueprint node defs in nodeDefStore - #19125
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review. Your free on-demand review promotion remains active until October 9, 2026 at 6:00 PM UTC. 📝 WalkthroughWalkthrough
ChangesShared Blueprint Definitions
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Suggested reviewers: Merge Risk: ⚪ Minimal · up to Blueprint definitions now flow through nodeDefStore, and the inspected repository callers and tests follow that shared-map contract. No actionable in-repository merge risk remains. 🚥 Pre-merge checks | ✅ 6 | ❓ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (6 passed)
Full details: Adr Compliance For Entity/Litegraph ChangesExplanation The check applies because the changed-file summary includes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🎭 Playwright: ✅ 2237 passed, 0 failed📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since e05150b041d507129b58bca5d8743f2543d6a361
Full docs: ADR-DEVEX-LINT-0015 🧩 Custom Nodes Ecosystem Matrix: ✅ PassedExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight
On a pin-bump PR, a red gate means the ecosystem moved — not that your diff broke something. That is what the bump PR is for. Outside a pin bump or a cold rebuild of the unpinned tail, a red means the diff. Note the corpus size and the executed count are different numbers, and the verdict is against the executed count: roughly 3,100 of ~5,100 packs ship no extension-shaped JS and are skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md 📦 Bundle: 10.3 MB gzip 🔴 +1.19 kBDetailsSummary
Category Glance App Entry Points — 4.17 kB (baseline 4.17 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.46 MB (baseline 1.46 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 143 kB (baseline 143 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 14 added / 14 removed / 4 unchanged Panels & Settings — 672 kB (baseline 672 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 11 added / 11 removed / 18 unchanged User & Accounts — 54.4 kB (baseline 54.4 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 7 added / 7 removed / 8 unchanged Editors & Dialogs — 133 kB (baseline 133 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 7 added / 7 removed / 2 unchanged UI Components — 205 kB (baseline 205 kB) • ⚪ 0 BReusable component library chunks
Status: 9 added / 9 removed / 11 unchanged Data & Services — 4.19 MB (baseline 4.19 MB) • 🔴 +348 BStores, services, APIs, and repositories
Status: 13 added / 13 removed / 4 unchanged Utilities & Hooks — 582 kB (baseline 582 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 19 added / 19 removed / 20 unchanged Vendor & Third-Party — 17.3 MB (baseline 17.3 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 18 unchanged Other — 18.6 MB (baseline 18.6 MB) • ⚪ 0 BBundles that do not match a named category
Status: 81 added / 81 removed / 235 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-10-07T01:13:23.503Z",
"gitSha": "7d9e34dda946bd125442bacc3df5726a2d51a3dd",
"branch": "drjkl/blueprint-defs-in-node-def-store",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2011.3759999999843,
"styleRecalcs": 7,
"styleRecalcDurationMs": 2.2769999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 430.43999999999994,
"heapDeltaBytes": 2608640,
"heapUsedBytes": 57452280,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.6209999999999996,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2022.7879999999914,
"styleRecalcs": 11,
"styleRecalcDurationMs": 3.2640000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 421.496,
"heapDeltaBytes": 7430472,
"heapUsedBytes": 76290364,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.728000000000002,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1700.5770000000098,
"styleRecalcs": 73,
"styleRecalcDurationMs": 14.919000000000002,
"layouts": 12,
"layoutDurationMs": 4.713,
"taskDurationMs": 772.239,
"heapDeltaBytes": 3313016,
"heapUsedBytes": 71431360,
"domNodes": 0,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 155.704,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.6656862745098,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1749.492000000032,
"styleRecalcs": 73,
"styleRecalcDurationMs": 14.040000000000001,
"layouts": 12,
"layoutDurationMs": 4.679,
"taskDurationMs": 775.137,
"heapDeltaBytes": -537500,
"heapUsedBytes": 62095300,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 155.566,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1724.4969999999853,
"styleRecalcs": 18,
"styleRecalcDurationMs": 6.806999999999999,
"layouts": 3,
"layoutDurationMs": 0.939,
"taskDurationMs": 332.28999999999996,
"heapDeltaBytes": 5615492,
"heapUsedBytes": 66704664,
"domNodes": 45,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 10.106,
"eventListeners": 39,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66538461538462,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1700.0779999999622,
"styleRecalcs": 18,
"styleRecalcDurationMs": 5.334999999999999,
"layouts": 3,
"layoutDurationMs": 0.8889999999999998,
"taskDurationMs": 345.98299999999995,
"heapDeltaBytes": 9608020,
"heapUsedBytes": 78463024,
"domNodes": 45,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 10.359,
"eventListeners": 39,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.667647058823523,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 674.2490000000316,
"styleRecalcs": 13,
"styleRecalcDurationMs": 3.6430000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 460.39700000000005,
"heapDeltaBytes": -6760304,
"heapUsedBytes": 62050872,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 165.58,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66500000000001,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 611.9589999999562,
"styleRecalcs": 14,
"styleRecalcDurationMs": 3.0559999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 454.227,
"heapDeltaBytes": 18142724,
"heapUsedBytes": 80729876,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 167.923,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1150.556999999992,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 751.083,
"heapDeltaBytes": 16731780,
"heapUsedBytes": 88423524,
"domNodes": 0,
"jsHeapTotalBytes": 3571712,
"scriptDurationMs": 65.524,
"eventListeners": 0,
"totalBlockingTimeMs": 518,
"frameDurationMs": 33.8235294117647,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1157.7429999999822,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 818.731,
"heapDeltaBytes": 16628688,
"heapUsedBytes": 100046252,
"domNodes": 0,
"jsHeapTotalBytes": 2785280,
"scriptDurationMs": 75.90799999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 526,
"frameDurationMs": 34.84848484848485,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 865.4589999999871,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 442.4030000000001,
"heapDeltaBytes": -7728016,
"heapUsedBytes": 81295748,
"domNodes": 0,
"jsHeapTotalBytes": 266240,
"scriptDurationMs": 162.452,
"eventListeners": 0,
"totalBlockingTimeMs": 222,
"frameDurationMs": 24.75999999999996,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 872.7069999999912,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 481.06499999999966,
"heapDeltaBytes": 18199132,
"heapUsedBytes": 97742604,
"domNodes": 0,
"jsHeapTotalBytes": 266240,
"scriptDurationMs": 163.149,
"eventListeners": 0,
"totalBlockingTimeMs": 225,
"frameDurationMs": 24.76285714285711,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "extension-clean-combined-draw",
"durationMs": 8920.518000000015,
"styleRecalcs": 1,
"styleRecalcDurationMs": 0.040000000000000105,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7986.1320000000005,
"heapDeltaBytes": -3944540,
"heapUsedBytes": 81958752,
"domNodes": -141,
"jsHeapTotalBytes": -7999488,
"scriptDurationMs": 6748.415000000001,
"eventListeners": -73,
"totalBlockingTimeMs": 663,
"frameDurationMs": 32.780514705882354,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "extension-clean-combined-draw",
"durationMs": 9863.333000000011,
"styleRecalcs": 2,
"styleRecalcDurationMs": 0.5950000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9086.153000000002,
"heapDeltaBytes": 10830176,
"heapUsedBytes": 96512028,
"domNodes": -141,
"jsHeapTotalBytes": -5902336,
"scriptDurationMs": 7515.508000000001,
"eventListeners": -73,
"totalBlockingTimeMs": 864,
"frameDurationMs": 31.72443729903537,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 9399.93800000002,
"styleRecalcs": 2,
"styleRecalcDurationMs": 0.5350000000000008,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8609.647,
"heapDeltaBytes": 26934708,
"heapUsedBytes": 97296440,
"domNodes": -141,
"jsHeapTotalBytes": -11145216,
"scriptDurationMs": 7124.417,
"eventListeners": -65,
"totalBlockingTimeMs": 723,
"frameDurationMs": 31.97142857142857,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 9213.405999999963,
"styleRecalcs": 1,
"styleRecalcDurationMs": 0.36899999999999955,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8451.234,
"heapDeltaBytes": -16445828,
"heapUsedBytes": 69291908,
"domNodes": -141,
"jsHeapTotalBytes": -10620928,
"scriptDurationMs": 6943.431,
"eventListeners": -73,
"totalBlockingTimeMs": 664,
"frameDurationMs": 32.112195121951224,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "large-graph-idle",
"durationMs": 2022.5970000000189,
"styleRecalcs": 8,
"styleRecalcDurationMs": 3.8779999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 567.4680000000001,
"heapDeltaBytes": -3393180,
"heapUsedBytes": 86135712,
"domNodes": 0,
"jsHeapTotalBytes": 36864,
"scriptDurationMs": 39.483000000000004,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2023.0420000000322,
"styleRecalcs": 9,
"styleRecalcDurationMs": 2.8889999999999993,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 513.064,
"heapDeltaBytes": -4876160,
"heapUsedBytes": 72567560,
"domNodes": 0,
"jsHeapTotalBytes": -225280,
"scriptDurationMs": 34.882,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665289256198346,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2256.768999999963,
"styleRecalcs": 71,
"styleRecalcDurationMs": 7.510000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1565.1170000000002,
"heapDeltaBytes": -17854180,
"heapUsedBytes": 72575912,
"domNodes": 0,
"jsHeapTotalBytes": 823296,
"scriptDurationMs": 821.8639999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66592592592593,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-pan",
"durationMs": 2291.821000000027,
"styleRecalcs": 70,
"styleRecalcDurationMs": 6.819999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1609.7060000000001,
"heapDeltaBytes": -5094484,
"heapUsedBytes": 85480556,
"domNodes": 0,
"jsHeapTotalBytes": 1310720,
"scriptDurationMs": 874.158,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666423357664236,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3683.527999999967,
"styleRecalcs": 70,
"styleRecalcDurationMs": 7.083000000000001,
"layouts": 60,
"layoutDurationMs": 15.902,
"taskDurationMs": 1706.8689999999997,
"heapDeltaBytes": 6171588,
"heapUsedBytes": 70492812,
"domNodes": -284,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 800.995,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666363636363634,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3533.2879999999705,
"styleRecalcs": 71,
"styleRecalcDurationMs": 8.163,
"layouts": 60,
"layoutDurationMs": 15.914000000000001,
"taskDurationMs": 1607.579,
"heapDeltaBytes": 5581156,
"heapUsedBytes": 75352692,
"domNodes": 24,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 771.109,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66603773584906,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3088.994000000014,
"styleRecalcs": 46,
"styleRecalcDurationMs": 5.577,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1867.42,
"heapDeltaBytes": 18352516,
"heapUsedBytes": 87549396,
"domNodes": 0,
"jsHeapTotalBytes": 1728512,
"scriptDurationMs": 986.2279999999998,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.756830601092897,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 3149.3390000000545,
"styleRecalcs": 47,
"styleRecalcDurationMs": 5.575,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1903.0679999999998,
"heapDeltaBytes": 22403244,
"heapUsedBytes": 92999376,
"domNodes": 0,
"jsHeapTotalBytes": 1466368,
"scriptDurationMs": 1028.096,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.755614973262027,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2022.0689999999877,
"styleRecalcs": 10,
"styleRecalcDurationMs": 3.5200000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 515.805,
"heapDeltaBytes": -4543432,
"heapUsedBytes": 76659676,
"domNodes": 0,
"jsHeapTotalBytes": -225280,
"scriptDurationMs": 36.202000000000005,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2014.002000000005,
"styleRecalcs": 8,
"styleRecalcDurationMs": 2.6169999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 495.75199999999995,
"heapDeltaBytes": -2513068,
"heapUsedBytes": 88014656,
"domNodes": 0,
"jsHeapTotalBytes": -225280,
"scriptDurationMs": 28.658999999999992,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 596.3010000000395,
"styleRecalcs": 48,
"styleRecalcDurationMs": 5.615,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 405.403,
"heapDeltaBytes": 12246312,
"heapUsedBytes": 77008356,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 144.85299999999998,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66571428571429,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 595.6719999999223,
"styleRecalcs": 47,
"styleRecalcDurationMs": 5.443999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 393.729,
"heapDeltaBytes": 13029796,
"heapUsedBytes": 77204216,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 144.837,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665714285714266,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2021.743000000015,
"styleRecalcs": 11,
"styleRecalcDurationMs": 3.74,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 417.71599999999995,
"heapDeltaBytes": 8105816,
"heapUsedBytes": 79259192,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.375,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666942148760338,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2007.043000000067,
"styleRecalcs": 7,
"styleRecalcDurationMs": 2.1139999999999994,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 411.215,
"heapDeltaBytes": 2235576,
"heapUsedBytes": 57693492,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.013000000000002,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665289256198346,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1707.5770000000148,
"styleRecalcs": 77,
"styleRecalcDurationMs": 16.703,
"layouts": 16,
"layoutDurationMs": 6.487,
"taskDurationMs": 766.2090000000001,
"heapDeltaBytes": -419192,
"heapUsedBytes": 70404120,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 110.03800000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.6656862745098,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1722.133000000099,
"styleRecalcs": 78,
"styleRecalcDurationMs": 14.227000000000002,
"layouts": 16,
"layoutDurationMs": 5.518999999999999,
"taskDurationMs": 700.472,
"heapDeltaBytes": -4510564,
"heapUsedBytes": 58157336,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 102.45400000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666019417475724,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 1401.4110000000528,
"styleRecalcs": 17,
"styleRecalcDurationMs": 26.613,
"layouts": 5,
"layoutDurationMs": 14.315000000000001,
"taskDurationMs": 907.56,
"heapDeltaBytes": 6498592,
"heapUsedBytes": 107252368,
"domNodes": 14570,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 28.769999999999996,
"eventListeners": 2458,
"totalBlockingTimeMs": 123,
"frameDurationMs": 19.143243243243237,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "viewport-pan-sweep",
"durationMs": 8570.32700000002,
"styleRecalcs": 251,
"styleRecalcDurationMs": 20.658999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5665.476,
"heapDeltaBytes": -19008600,
"heapUsedBytes": 69796752,
"domNodes": 0,
"jsHeapTotalBytes": 823296,
"scriptDurationMs": 2783.902,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666147859922177,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8324.408000000061,
"styleRecalcs": 250,
"styleRecalcDurationMs": 18.793999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5468.947,
"heapDeltaBytes": 11492700,
"heapUsedBytes": 91687396,
"domNodes": 0,
"jsHeapTotalBytes": 753664,
"scriptDurationMs": 2777.082,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.69939879759519,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 18068.746999999974,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17192.082,
"heapDeltaBytes": -33146528,
"heapUsedBytes": 181901428,
"domNodes": -3046,
"jsHeapTotalBytes": 7360512,
"scriptDurationMs": 303.848,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 30.334957983193277,
"p95FrameDurationMs": 50.10000000000218
},
{
"name": "vue-large-graph-idle",
"durationMs": 18083.118000000013,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17272.724000000002,
"heapDeltaBytes": -32290900,
"heapUsedBytes": 182712712,
"domNodes": -3046,
"jsHeapTotalBytes": 7098368,
"scriptDurationMs": 259.59700000000004,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 30.465430016863408,
"p95FrameDurationMs": 66.59999999999854
},
{
"name": "vue-large-graph-pan",
"durationMs": 22410.26099999999,
"styleRecalcs": 174,
"styleRecalcDurationMs": 14.196000000000014,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 22076.065,
"heapDeltaBytes": -28304488,
"heapUsedBytes": 187150252,
"domNodes": -3046,
"jsHeapTotalBytes": 5591040,
"scriptDurationMs": 919.211,
"eventListeners": -14915,
"totalBlockingTimeMs": 12,
"frameDurationMs": 41.434011090573016,
"p95FrameDurationMs": 83.40000000000146
},
{
"name": "vue-large-graph-pan",
"durationMs": 23483.248000000003,
"styleRecalcs": 182,
"styleRecalcDurationMs": 14.909000000000006,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 23068.106,
"heapDeltaBytes": -29638044,
"heapUsedBytes": 187964168,
"domNodes": -3075,
"jsHeapTotalBytes": 7147520,
"scriptDurationMs": 847.9760000000001,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 43.405730129390015,
"p95FrameDurationMs": 83.40000000000146
},
{
"name": "vue-node-resize-workload",
"durationMs": 6430.316000000062,
"styleRecalcs": 20,
"styleRecalcDurationMs": 72.99799999999998,
"layouts": 20,
"layoutDurationMs": 24.466,
"taskDurationMs": 6300.775000000001,
"heapDeltaBytes": 4930132,
"heapUsedBytes": 216182004,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 104.348,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 38.521556886227536,
"p95FrameDurationMs": 83.29999999999927
},
{
"name": "vue-node-resize-workload",
"durationMs": 5038.332999999966,
"styleRecalcs": 20,
"styleRecalcDurationMs": 76.22999999999999,
"layouts": 20,
"layoutDurationMs": 26.097999999999995,
"taskDurationMs": 4915.217,
"heapDeltaBytes": 646324,
"heapUsedBytes": 216301908,
"domNodes": 0,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 96.887,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 29.53099415204678,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "vue-zoom-out-idle",
"durationMs": 9274.416000000088,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8862.892,
"heapDeltaBytes": -43213312,
"heapUsedBytes": 181350240,
"domNodes": -3046,
"jsHeapTotalBytes": 1417216,
"scriptDurationMs": 134.61299999999997,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 30.73841059602649,
"p95FrameDurationMs": 66.59999999999854
},
{
"name": "vue-zoom-out-idle",
"durationMs": 9568.81400000009,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9203.913000000002,
"heapDeltaBytes": -31757268,
"heapUsedBytes": 183860504,
"domNodes": -3046,
"jsHeapTotalBytes": 7884800,
"scriptDurationMs": 147.29099999999994,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 32.76130136986301,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "workflow-execution",
"durationMs": 460.4420000000573,
"styleRecalcs": 21,
"styleRecalcDurationMs": 18.933,
"layouts": 4,
"layoutDurationMs": 1.9529999999999998,
"taskDurationMs": 136.633,
"heapDeltaBytes": 6351444,
"heapUsedBytes": 72138820,
"domNodes": 133,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 13.629999999999995,
"eventListeners": 81,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.664285714285693,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 151.48199999998724,
"styleRecalcs": 11,
"styleRecalcDurationMs": 14.212,
"layouts": 5,
"layoutDurationMs": 3.385,
"taskDurationMs": 102.88600000000001,
"heapDeltaBytes": 4071896,
"heapUsedBytes": 70327936,
"domNodes": 124,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 11.421999999999995,
"eventListeners": 33,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 699.7200000000703,
"styleRecalcs": 78,
"styleRecalcDurationMs": 81.718,
"layouts": 76,
"layoutDurationMs": 23.777,
"taskDurationMs": 667.034,
"heapDeltaBytes": 16323752,
"heapUsedBytes": 83437180,
"domNodes": 76,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 269.4,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 804.463999999939,
"styleRecalcs": 78,
"styleRecalcDurationMs": 85.078,
"layouts": 76,
"layoutDurationMs": 23.618,
"taskDurationMs": 766.745,
"heapDeltaBytes": 17236672,
"heapUsedBytes": 84041548,
"domNodes": 76,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 318.07,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 1385.864999999967,
"styleRecalcs": 78,
"styleRecalcDurationMs": 241.011,
"layouts": 76,
"layoutDurationMs": 28.483999999999998,
"taskDurationMs": 1361.179,
"heapDeltaBytes": 14032992,
"heapUsedBytes": 129779308,
"domNodes": 76,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 484.22900000000004,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.51012658227847,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 1417.2509999999647,
"styleRecalcs": 78,
"styleRecalcDurationMs": 258.984,
"layouts": 76,
"layoutDurationMs": 29.160999999999998,
"taskDurationMs": 1390.658,
"heapDeltaBytes": 13458324,
"heapUsedBytes": 120888144,
"domNodes": 76,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 482.58900000000006,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.695061728395075,
"p95FrameDurationMs": 33.29999999999927
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #19125 +/- ##
==========================================
+ Coverage 85.48% 86.29% +0.80%
==========================================
Files 3529 2487 -1042
Lines 169373 141474 -27899
Branches 44466 36736 -7730
==========================================
- Hits 144793 122086 -22707
+ Misses 22586 19007 -3579
+ Partials 1994 381 -1613
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1065 files with indirect coverage changes 🚀 New features to boost your workflow:
|
comfy-greenlight-bot
left a comment
There was a problem hiding this comment.
This pull request at head commit d965e85 has been reviewed and approved by Swarmhost's agentic review process.
The detailed evaluation is available to employees in the internal Slack review thread.
…rg#19091) ## Summary Targets `main`. In the original FE-3037 stack it sat on Comfy-Org#19089. Moves `registerCoreSidebarTabs` out of `sidebarTabStore` into `src/composables/sidebarTabs/registerCoreSidebarTabs.ts`. The store imported the six core tab composables (`useNodeLibrarySidebarTab`, `useModelLibrarySidebarTab`, `useAssetsSidebarTab`, `useJobHistorySidebarTab`, `useWorkflowsSidebarTab`, `useAppsSidebarTab`) only so it could register them. Every one of those trees reads the store back, so the node library, model library, queue, assets and workflow UI all sat in the same import cycle as the store. `menuItemStore` was pulled in the same way for the View-menu commands. Measured with dependency-cruiser on `src` (the `pnpm lint:cycles` script arrives with Comfy-Org#19085) against current `origin/main`: | | before | after | | --- | --- | --- | | modules in any cycle | 1027 | 833 | | largest cycle | 983 | 783 | | cyclic edges | 4562 | 3766 | Tracks FE-2769 / FE-3037. ## Changes - New `registerCoreSidebarTabs()` in `src/composables/sidebarTabs/`. Same body as the old store action, calling `useSidebarTabStore()` for register/unregister. - `sidebarTabStore` no longer imports the tab composables or `menuItemStore`, and `registerCoreSidebarTabs` is gone from its return value. It keeps `registerSidebarTab`, `unregisterSidebarTab`, `toggleSidebarTab` and the model-library toggle command logic. - `GraphView.vue` (the only caller) imports the function directly. `GraphView.test.ts` mocks the module instead of the store action. - Store tests that only exercised registration ordering move to `registerCoreSidebarTabs.test.ts`; the model-library view-selection tests stay on the store and register a tab directly. - `registerCoreSidebarTabs.test.ts` also covers turning QPO V2 off (the job history tab is removed), asserts the registered toggle command IDs instead of a call count, and checks the two View-menu `registerCommands` calls. ## Review Focus - No behavior change in the app. `registerCoreSidebarTabs` is called once, at the same point in `GraphView.vue`, and the QPO V2 watcher is still created during `GraphView` setup. - `app.extensionManager.sidebarTab` is the store instance, so `registerCoreSidebarTabs` was reachable from extensions at runtime. It is not on the typed `ExtensionManager` interface, and `GraphView.vue` was its only caller in this repo. - The new file sits in `src/composables/`, which the pre-commit hook flags as frozen. It lives next to the tab composables it wires together; happy to move it if there is a better home. - The `tab.id === 'model-library'` special case in the store is untouched; a per-tab activation hook on `SidebarTabExtension` would be the way to remove it, but that changes the extension-facing type. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | **Comfy-Org#19091** (this PR) | **Comfy-Org#19088 (measured on Comfy-Org#19089)** | **Register core sidebar tabs outside `sidebarTabStore`** | **816 -> 669** | **618 -> 465** | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
## Summary Targets `main`; in the original stack it sat on Comfy-Org#19088. Moves the `ServerFeatureFlag` enum out of `useFeatureFlags.ts` into a leaf module so `remoteConfig.ts` no longer imports the composable. That single type-only import was the bridge that kept litegraph in the app-wide import cycle: `remoteConfig → useFeatureFlags → api → workflowSchema → LGraph`. Everything that reports errors (`reportError`, `hostTelemetryEnabled`, `linkPresentationStore`, `transferLinkPresentation`, and the litegraph canvas code that calls them) rode that chain back into litegraph. Measured with `pnpm lint:cycles` from Comfy-Org#19085 (dependency-cruiser, type edges included; not on `main` yet, applied locally) on top of Comfy-Org#19088 in the original stack: | | before | after | | --- | --- | --- | | modules in any cycle | 949 | 816 | | largest cycle | 905 | 618 | | litegraph modules in the largest cycle | 117 | 0 | Alone on current `main`: 1027 -> 884 cyclic modules, largest cycle 983 -> 677, 4562 -> 3382 cyclic edges, and no litegraph modules in the largest cycle. In the original stack, litegraph and its entity stores (`widgetValueStore`, `layoutStore`, `nodeDataStore`, `graphMetadataStore`, `previewExposureStore`, `core/graph/subgraph`, `core/schemas`) formed their own 149-module cycle with no path to `platform/`, `components/`, or `composables/`. That is the shape a future graph-core package would need. On current `main` that cycle has 158 modules and includes `platform/nodeReplacement/cnrIdUtil.ts`, so it is not yet separate from `platform/`. Tracks FE-2769 / FE-3037. ## Changes - New `src/platform/remoteConfig/serverFeatureFlag.ts` holding the enum verbatim. No imports. - `useFeatureFlags.ts`, `remoteConfig.ts`, `checkoutJourney.ts`, `nodeReplacementStore.ts`, `useNodeImageUpload.ts`, `useWidgetSelectActions.ts` and two tests import the enum from the leaf. No re-export from `useFeatureFlags.ts`. - `src/storybook/mocks/useFeatureFlags.ts` drops its hand-copied duplicate of the enum; it existed only because of this coupling. - `tools/test-recorder` flag discovery reads the enum from the leaf, with a test against the real file; `docs/FEATURE_FLAGS.md` points at the leaf. ## Review Focus - No behavior change; the enum values are unchanged and nothing else moved. - The Storybook alias for `@/composables/useFeatureFlags` still points at the mock; nothing imports `ServerFeatureFlag` through that alias any more, so the mock only needs `useFeatureFlags`. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | **Comfy-Org#19089** (this PR) | **`main`** | **`ServerFeatureFlag` enum to a leaf module** | **1027 -> 884** | **983 -> 677** | **4562 -> 3382** | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
| @@ -429,7 +427,9 @@ export const useSubgraphStore = defineStore('subgraph', () => { | |||
| } | |||
|
|
|||
| function isGlobalBlueprint(name: string): boolean { | |||
There was a problem hiding this comment.
Potential followup here to update the function to take a nodeType? Both consumers are slicing the prefix off.
…#19124) ## Summary Targets `main`; in the original stack it sat on Comfy-Org#19122. Tracks FE-2769 / FE-3037. `src/types/comfy.ts` is inside the app cycle (litegraph barrel, `ComfyExtension`). `MissingNodeType` lived there, so the missing-node scan, error catalog, right-side-panel error groups and telemetry grouping all joined the cycle to read one type alias. The alias already depended on `NodeReplacement` from the `nodeReplacement` leaf; it now lives next to it. Import cycles in the original stack, on top of Comfy-Org#19122: 417 -> 411 cyclic modules, largest SCC 203 -> 197. Alone on current `main`: cyclic modules and largest SCC unchanged (1027, 983), 4562 -> 4555 cyclic edges. ## Changes - `MissingNodeType` moves from `src/types/comfy.ts` to `src/platform/nodeReplacement/types.ts`, unchanged. - Importers read it from `@/platform/nodeReplacement/types`; `comfy.ts` imports it for the `ComfyExtension.beforeConfigureGraph` / `afterConfigureGraph` hooks. No re-export is left behind. ## Review Focus - Type-only move, no runtime change. `MissingNodeType` was not part of the `src/types/index.ts` public barrel, so the extension-facing surface is unchanged. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | **Comfy-Org#19124** (this PR) | **`main`** | **`MissingNodeType` to the nodeReplacement leaf** | **1027 -> 1027** | **983 -> 983** | **4562 -> 4555** | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
…omfy-Org#19107) ## Summary Stacked on Comfy-Org#19091, which targets `main`. In the original stack it sat on Comfy-Org#19094. Tracks FE-2769 / FE-3037. `useSettingsDialog` imported `SettingDialog.vue` so it could open it. The settings subtree (billing stores, top-up dialogs, `ConfirmationDialogContent`, `UploadModelUrlInput`, `scripts/ui.ts`) imports `useSettingsDialog` to jump to a panel. That one edge kept the settings UI inside the main import cycle. Measured with dependency-cruiser on `src` (the `pnpm lint:cycles` script arrives with Comfy-Org#19085) against Comfy-Org#19091's branch: cyclic modules 833 -> 772, largest cycle 783 -> 719, cyclic edges 3766 -> 3541. ## Changes - `useSettingsDialog.show()` opens whichever component was registered through the new `registerSettingDialogComponent()`; `GraphView.vue` registers `SettingDialog.vue` next to the other core registrations. An unregistered `show()` reports `failure_opening_settings_dialog` through `reportError` and returns without opening anything. - `SettingDialogProps` moves to `platform/settings/types.ts`; `SettingDialog.vue` uses it for `defineProps`, so the registration stays typed without importing the component. - `useSettingsDialog.test.ts` drops the billing/i18n/telemetry mocks it only needed because it transitively loaded `SettingDialog.vue`, registers a stub, and asserts `show()` passes that stub. `useSettingsDialog.unregistered.test.ts` covers `show()` before registration: it reports `failure_opening_settings_dialog` and opens no dialog. `GraphView.test.ts` stubs `SettingDialog.vue` now that `GraphView` imports it. ## Review Focus - `GraphView` runs `registerSettingDialogComponent` during setup, before `GraphCanvas` (child) runs the `?settings=` URL loader, and before any user action can trigger `Comfy.ShowSettingsDialog`. - Registration is module-level state in `useSettingsDialog.ts`, the same shape as the sidebar tab registration in Comfy-Org#19091 but for one component. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | **Comfy-Org#19107** (this PR) | **Comfy-Org#19093 (measured on Comfy-Org#19094)** | **Register settings dialog from the app shell** | **558 -> 509** | **349 -> 297** | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
…9127) ## Summary Targets `main` on its own; in the original stack it sat on Comfy-Org#19125. Tracks FE-2769 / FE-3037. `createGraphThumbnail()` read the graph to render from `workflowStore` and `canvasStore`, and `MinimapDataSource` read node progress from `executionStore`. That put the thumbnail renderer and the minimap data path into the app cycle (`workflowStore -> useWorkflowThumbnail -> graphThumbnailRenderer -> ... -> executionStore -> workflowStore`). Both now take their inputs as arguments. Import cycles in the original stack, on top of Comfy-Org#19125: 403 -> 400 cyclic modules, largest SCC 184 -> 181. Alone on current `main`: cyclic modules and largest SCC unchanged (1027, 983), 4562 -> 4561 cyclic edges. ## Changes - `graphThumbnailRenderer.ts`: `createGraphThumbnail(graph)` renders the graph it is given. No store imports. - `useWorkflowThumbnail.ts`: `createMinimapPreview(graph)` and `storeThumbnail(workflow, graph)` forward the graph. - `workflowService.beforeLoadNewGraph` passes `workflowStore.activeSubgraph || app.canvasOrUndefined?.graph`, the same selection the renderer made before. - `MinimapDataSource(graph, nodeProgressStates = {})`: progress states are injected. `MinimapRenderContext.nodeProgressStates` carries them; `useMinimapRenderer` resolves `useExecutionStore()` once in setup and passes `nodeLocationProgressStates` on each render, so the live minimap still colors running/finished/error nodes. - `minimap/types.ts`: `MinimapNodeExecutionState` and `MinimapNodeProgressStates` replace the inline union. - `workflowService.test.ts`: `beforeLoadNewGraph` stores a thumbnail of the active subgraph, or of `app.canvasOrUndefined.graph` when none is active. The shared `scripts/__mocks__/app.ts` gains a `canvasOrUndefined` getter backed by the same state as `canvas`. ## Review Focus - Stored workflow thumbnails no longer show execution-state colors: `createGraphThumbnail` passes no progress states. Thumbnails are captured when switching away from a workflow, so that state was stale by the time it was shown. If the colors matter, `workflowService` can pass `useExecutionStore().nodeLocationProgressStates` through `storeThumbnail`. - `useMinimapViewport` builds a `MinimapDataSource` for bounds only and did not need progress states; it uses the default. - `MinimapDataSource.test.ts` injects states through the constructor instead of `Object.assign(useExecutionStore(), ...)`. `useMinimap.progressBaseline.test.ts` still exercises the executionStore path through `useMinimapRenderer` and is unchanged; removing the `nodeProgressStates` line in `useMinimapRenderer` fails it. - The `canvasOrUndefined` mock getter also reaches `workflowStore.updateActiveGraph`, which previously returned early under the mock. The 80 suites that use the shared app mock pass. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | **Comfy-Org#19127** (this PR) | **`main`** | **Thumbnail and minimap data from explicit inputs** | **1027 -> 1027** | **983 -> 983** | **4562 -> 4561** | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
## Summary Targets `main` as a standalone branch; in the original stack it sat on Comfy-Org#19121. Tracks FE-2769 / FE-3037. `settingStore` imported `scripts/app` to replay every setting change on the legacy `ComfySettingsDialog` event target, and owned `SettingTreeNode`, a settings-dialog UI type that dragged `treeExplorerTypes` (and through it `nodeDefStore`) into the store. Both edges kept the store inside the app cycle even though nothing the store does depends on the app. Import cycles in the original stack, on top of Comfy-Org#19121: 428 -> 417 cyclic modules, largest SCC 214 -> 203. Alone on current `main`: 1027 -> 1024 cyclic modules, largest SCC 983 -> 980, 4562 -> 4545 cyclic edges. ## Changes - `settingStore.ts`: exposes `onSettingChanged` (vueuse `createEventHook`, same shape as `executionStore.onJobReset`). `onChange` fires it where it used to call `app.ui.settings.dispatchChange`, still before awaiting the setting's own handler so the ordering extensions observe is unchanged. No more `scripts/app` import. - `GraphCanvas.vue`: subscribes `comfyApp.ui.settings.dispatchChange` to the hook in setup, before `CORE_SETTINGS` register, so extensions listening for `<id>.change` on the legacy dialog still receive every event, including the ones fired by core-setting registration. `createEventHook` unsubscribes on scope dispose, so a remount does not double-dispatch. `GraphCanvas.test.ts` covers both. - `SettingTreeNode` moves to `useSettingSearch.ts`, next to the composables that build and search the settings tree; `useSettingUI.ts` and `SettingDialog.vue` import it from there. - `settingStore.test.ts` asserts on the hook payload (`id`, `value`, `oldValue`) instead of the `app` mock; the `scripts/app` mock is gone from the file. - `$el` (with `Props`, `Children`, `ElementType`) moves from `scripts/ui.ts` to the new leaf `scripts/ui/utils.ts`; `ui.ts` re-exports it as `export const $el` so the comfyAPI shim keeps `window.comfyAPI.ui.$el`. Every internal importer, including the `scripts/ui/components` and `scripts/ui/menu` modules, imports `$el` from the leaf; only the shim re-export in `ui.ts` remains. Without settingStore -> app, `scripts/utils -> ui.ts -> ... -> app.ts` was reached before `app` in some test graphs and `new ComfyApp()` ran with `ComfyUI` uninitialised. - `app.test.ts` imports `./app` right after the shoehorn import so `app.ts` evaluates before the `litegraphUtil` manual mock's circular import returns the original module. - fallow: `ignoreExports` entry for the `$el` re-export (same situation as the baselined `ComfyDialog`); dead-code baseline swaps the removed `settingStore -> app` cycle for the five app.ts cycle representatives fallow now reports instead; health baseline follows `$el` to `ui/utils.ts`. ## Review Focus - The bridge lives in `GraphCanvas.vue` because `app` (and `app.ui.settings`) is constructed at module import, before pinia is active, so `ComfySettingsDialog` cannot subscribe in its constructor. Extensions are loaded in `app.setup()`, which GraphCanvas calls after the bridge subscribes, so no `<id>.change` listener exists before the bridge does. - `SettingChange` stays a module-private interface; only the hook's inferred type exposes it. - The `app.test.ts` import reorder is an evaluation-order workaround. The underlying `litegraphUtil -> app` edge (`resolveNode(graph = app.rootGraph)`) frees no cyclic modules on its own, so it is left for a later PR. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | **Comfy-Org#19122** (this PR) | **`main`** | **`settingStore` off `scripts/app`; `$el` to a leaf** | **1027 -> 1025** | **983 -> 981** | **4562 -> 4552** | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
…lder (Comfy-Org#19094) ## Summary Targets `main` as a standalone branch; in the original stack it sat on Comfy-Org#19093. `appModeStore.enterBuilder()` no longer decides whether to show the empty-workflow dialog. That check moves to a new `useEnterBuilder` composable next to the dialog, and the store's `enterBuilder` enters the builder unconditionally. The store imported `useEmptyWorkflowDialog`, which imports `dialogService`, `useWorkflowTemplateSelectorDialog` and their content components. That was the only reason those modules sat in the same import cycle as the app-mode store. Measured with dependency-cruiser (type edges included; the `pnpm lint:cycles` script from Comfy-Org#19085, not yet on `main`) on top of Comfy-Org#19093 in the original stack: | | before | after | | --- | --- | --- | | modules in any cycle | 566 | 558 | | largest cycle | 357 | 349 | Alone on current `main`: 1027 -> 1026 cyclic modules, largest cycle 983 -> 982, 4562 -> 4558 cyclic edges. Tracks FE-2769 / FE-3037. ## Changes - New `src/components/builder/useEnterBuilder.ts`: if `appModeStore.hasNodes` is false it shows the empty-workflow dialog, otherwise it calls `appModeStore.enterBuilder()`. Dismissing the dialog ("Back to workflow") returns to graph mode. After "Load template", the dialog checks the live graph and calls `appModeStore.enterBuilder()` directly, instead of re-reading the cached `hasNodes`, which can lag a template load. - `appModeStore.enterBuilder()` drops the `!hasNodes` branch and the dialog import. - `useWorkflowActionsMenu`, `AppModeToolbar.vue` and `LinearWelcome.vue` call `useEnterBuilder().enterBuilder` instead of the store action. The toolbar and welcome buttons were already hidden or disabled without nodes; the actions menu was the only reachable path to the dialog. - The dialog tests move from `appModeStore.test.ts` to `useEnterBuilder.test.ts`. New `useEmptyWorkflowDialog.test.ts` covers the dismiss path and the live-graph check after a template load. `useWorkflowActionsMenu.test.ts` mocks the composable and asserts on it. ## Review Focus - `appModeStore.enterBuilder()` is now a plain transition. Any future caller that can run with an empty graph must go through `useEnterBuilder`. - `useEnterBuilder.test.ts` uses the global testing Pinia and `Object.assign(store, { hasNodes })`, matching `AppModeToolbar.test.ts`; the `comfy/use-global-pinia` lint rule rejects mocking the store module. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | **Comfy-Org#19094** (this PR) | **`main`** | **Empty-workflow dialog out of `appModeStore`** | **1027 -> 1026** | **983 -> 982** | **4562 -> 4558** | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
…f modules (Comfy-Org#19112) ## Summary Two type/constant-only imports pulled UI modules into the stores and scripts import cycle. `domWidgetStore` imported `useAbsolutePosition` for the `PositionConfig` type, and `changeTracker` imported `layerEditorDialog` for `LAYER_EDITOR_DIALOG_KEY`. Both now come from leaf modules. Import cycles in the original stack, on top of Comfy-Org#19111: 476 -> 471 cyclic modules, largest SCC 264 -> 257; frees 7 modules (`useAbsolutePosition`, `DomWidget.vue`, `layerEditorDialog`, `LayerEditorContent.vue`, `useCompositorEditor`, `changeTracker`, `domWidgetStore`). Alone on current `main`: cyclic modules and largest SCC unchanged (1027, 983), 4562 -> 4558 cyclic edges. Targets `main` as a single commit; in the original stack it sat on Comfy-Org#19111. Tracks FE-2769 / FE-3037. ## Changes - `src/types/positionConfig.ts` holds `PositionConfig`, typed with `Point` and `Size` from litegraph `interfaces` rather than the litegraph barrel; `useAbsolutePosition` and `domWidgetStore` import it from there. - `src/renderer/extensions/layerEditor/layerEditorDialogKey.ts` holds `LAYER_EDITOR_DIALOG_KEY`; `useLayerEditor`, `useCompositorEditor`, and `changeTracker` import it from there, and `layerEditorDialog` no longer exports it. ## Review Focus - No behavior change; moves only. Neither `useAbsolutePosition` nor `layerEditorDialog` re-exports the moved symbol, so any external import of `PositionConfig` or `LAYER_EDITOR_DIALOG_KEY` from the old paths breaks at typecheck. Neither is part of the extension API surface. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | **Comfy-Org#19112** (this PR) | **`main`** | **`PositionConfig` and layer editor dialog key to leaf modules** | **1027 -> 1027** | **983 -> 983** | **4562 -> 4558** | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
…Org#19108) ## Summary Stacked on Comfy-Org#19107, in a chain rooted on `main` (Comfy-Org#19091 -> Comfy-Org#19107 -> Comfy-Org#19108). Tracks FE-2769 / FE-3037. `useAssetBrowserDialog` imported `AssetBrowserModal.vue` so it could open it. The modal pulls in the asset grid, model info panel, upload flow, and their stores, and those in turn reach the dialog composable through `createAssetWidget` and `openModelLibraryBrowser`. That one edge kept 13 asset-browser modules inside the main import cycle. Same registration pattern as Comfy-Org#19091 and Comfy-Org#19107: the composable opens whatever component the app shell registers. Import cycles, measured with dependency-cruiser on `src` (the `pnpm lint:cycles` script arrives with Comfy-Org#19085) against Comfy-Org#19107's branch: cyclic modules 772 -> 759, largest cycle 719 -> 706, cyclic edges 3541 -> 3499. ## Changes - `useAssetBrowserDialog.ts`: drop the `AssetBrowserModal.vue` import; add `registerAssetBrowserModalComponent(component: Component<AssetBrowserModalProps>)`; `show()`/`browse()` route through one `openModal()` that calls `reportError` (`failure_opening_asset_browser_modal`) and opens nothing if no component is registered. - `src/platform/assets/types/assetBrowserModalProps.ts`: new leaf holding the modal's props interface; `AssetBrowserModal.vue` uses `defineProps<AssetBrowserModalProps>()`. - `GraphView.vue`: registers `AssetBrowserModal` next to the other core registrations. - `show()` no longer forwards `inputName`/`currentValue` to the modal. The modal never declared them, so they only landed as fallthrough DOM attributes. `ShowOptions` keeps the fields: `createAssetWidget` passes them, filled from its `inputNameForBrowser` option that `widgetInputs.ts` and `useComboWidget.ts` set. Dropping them means changing those widget paths, which is left for a follow-up. - Tests: `useAssetBrowserDialog.test.ts` registers a stub before each test, types the dialog props with `AssetBrowserModalProps`, and asserts in the `browse()` test that the stub is the component passed to the dialog; `useAssetBrowserDialog.unregistered.test.ts` checks that `browse()` with nothing registered reports `failure_opening_asset_browser_modal` and opens no dialog; `GraphView.test.ts` stubs the modal module. ## Review Focus - The `AssetBrowserModal.stories.ts` and `useAssetBrowserDialog.stories.ts` stories render the component directly, so they need no registration. - Callers are unchanged: `createAssetWidget.ts` and `openModelLibraryBrowser.ts` call the composable, and `useCoreCommands` reaches it through `openModelLibraryBrowser`. All of them open the dialog from user actions, after `GraphView` setup has registered the modal. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | **Comfy-Org#19108** (this PR) | **Comfy-Org#19107** | **Register asset browser modal from the app shell** | **509 -> 496** | **297 -> 284** | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: AustinMroz <austin@comfy.org>
…9111) ## Summary Stacked on Comfy-Org#19108, in a chain rooted on `main` (Comfy-Org#19091 -> Comfy-Org#19107 -> Comfy-Org#19108 -> Comfy-Org#19111). In the original stack it sat on Comfy-Org#19109. Tracks FE-2769 / FE-3037. Cuts `stores/workspace/bottomPanelStore.ts -> composables/bottomPanelTabs/{useShortcutsTab,useTerminalTabs}.ts`. The store imported the tab composables only to register the core tabs, which pulled the shortcuts and terminal panel components into the stores import cycle. Measured with dependency-cruiser on `src` (the `pnpm lint:cycles` script arrives with Comfy-Org#19085) against Comfy-Org#19108's branch: cyclic modules 759 -> 751, largest cycle 706 -> 698, cyclic edges 3499 -> 3480. Frees 8 modules (`composables/bottomPanelTabs/*`, `components/bottomPanel/tabs/*`). ## Changes - New `composables/bottomPanelTabs/registerCoreBottomPanelTabs.ts` holds the former store action (shortcuts tabs, then lazily loaded terminal tabs outside cloud, command terminal on desktop). Same shape as `registerCoreSidebarTabs` from Comfy-Org#19091. One behaviour change: a terminal tab load failure now goes through `reportError` (`errorType: 'error_loading_terminal_tabs'`, `surface: 'platform'`) instead of `console.error`, so it reaches telemetry; `reportError` still logs to the console. - `bottomPanelStore` drops `registerCoreBottomPanelTabs` and its `isDesktop`/`useShortcutsTab` imports; `GraphView.vue` calls the new function at startup, and `GraphView.test.ts` mocks the new module instead of the store action. - The tab-composable and `isDesktop` mocks in `bottomPanelStore.test.ts` were left over from the action (no test there called it), so they move to `registerCoreBottomPanelTabs.test.ts`. That file adds coverage the action did not have: the registered tab ids per panel for a local build with and without desktop and for a cloud build (no terminal tabs), and the failure path (shortcuts tabs kept, no terminal tabs, one `reportError` call with the error type above). ## Review Focus - `registerCoreBottomPanelTabs` was a store action, so it was reachable as `app.extensionManager.bottomPanel.registerCoreBottomPanelTabs()`. No caller in `src/`, `browser_tests/`, or the public extension types uses it; `registerBottomPanelTab` and `registerExtensionBottomPanelTabs` stay on the store. - The file sits in the frozen `src/composables/` tree next to the tab composables it registers, matching `registerCoreSidebarTabs`; the pre-commit hook warns but allows it. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | **Comfy-Org#19111** (this PR) | **Comfy-Org#19108 (measured on Comfy-Org#19109)** | **Register core bottom panel tabs from GraphView** | **484 -> 476** | **272 -> 264** | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
…sion (Comfy-Org#19109) ## Summary Cuts `services/litegraphService.ts -> composables/maskeditor/useMaskEditor.ts`, the edge that pulled the mask editor composables and components into the services import cycle. Import cycles in the original stack, on top of Comfy-Org#19108: 496 -> 484 cyclic modules, largest SCC 284 -> 272; frees 12 modules (`composables/maskeditor/*`, `components/maskeditor/*`). Alone on current `main` the counts do not change (1027 cyclic modules, largest SCC 983, 4562 cyclic edges). Targets `main` directly; in the original stack it sat on Comfy-Org#19108. Tracks FE-2769 / FE-3037. ## Changes - `Comfy.MaskEditor` extension contributes the "Open in MaskEditor | Image Canvas" node menu item from `beforeRegisterNodeDef`, wrapping `nodeType.prototype.getExtraMenuOptions` (calls the existing handler, keeps its return value, then pushes the item), with the same `clipspace_return_node` and `isImageNode` guards and the same `'preview'` media-action marking. - `litegraphService.ts` drops the item and the `useMaskEditor` import. - `maskeditor.test.ts` covers the guards, the callback target, the preview marking, and chaining with an existing `getExtraMenuOptions` handler. ## Review Focus - Extension contract: the item stays in the `options` array that `getExtraMenuOptions` fills, so custom nodes that wrap `getExtraMenuOptions` and look the item up by label (ComfyUI-prompt-formula, ComfyUI-PreviewBridgeExtended) keep working. Core extensions register before custom ones, so `litegraphService` installs the prototype handler, this wrapper runs next, and later wrappers see the item. Menu position is unchanged in both the litegraph and the Vue menu. - Blueprint subgraph node classes (`litegraphService` creates them without calling `beforeRegisterNodeDef`) do not get the item. Before, they got it only with an image preview, which blueprints do not have. - `filterUnavailableCoreMediaMenuActions` in `useMoreOptionsMenu` still hides the item when the node has no preview, because the callback keeps the `'preview'` mark. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | **Comfy-Org#19109** (this PR) | **`main`** | **Mask editor menu item into `Comfy.MaskEditor` extension** | **1027 -> 1027** | **983 -> 983** | **4562 -> 4562** | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
…omfy-Org#19088) ## Summary Second slice of FE-3037. `src/lib/litegraph/src/interfaces.ts` (589 lines) mixed geometry primitives, utility types, slot data, link-network contracts, context-menu options, panel widgets, and node-creation options. Its type imports of `LGraphNode`, `LLink`, `Reroute`, `ContextMenu`, `Rectangle`, `types/widgets` and `types/events` put every importer of `Point` or `ReadOnlyRect` into the largest import cycle. This PR keeps `interfaces.ts` as a leaf (it now imports only branded IDs from `src/types/*` and `types/globalEnums`) and moves the graph-bound contracts into files named by responsibility. Measured with dependency-cruiser on `src` (the Comfy-Org#19085 config, run locally), rebased on `main` at 03bca8a: cyclic modules 660 -> 653, largest SCC 444 (unchanged), cyclic edges 2577 -> 2520. Originally cycle-free after this slice, before the merged slices above it moved the numbers: `Rectangle`, `measure`, `ConstrainedSize`, `LGraphBadge`, `LGraphButton`, `node/SlotBase`, `interfaces` inside litegraph; `linkStore`, `rerouteStore`, `linkTopology`, `mathUtil`, `positionBounds`, `nodeDefUtil`, `boundsCalculator`, `marqueeSelectionUtil`, `useAssetGridSelection`, `useTimelineScrub`, `gradients`, `GradientSlider.vue`, `NodeBadge.vue`, `GizmoManager`, `load3dViewport` in the app. Rebased onto `main` after Comfy-Org#19085 was closed in favour of Comfy-Org#20461 (warn-only `pnpm deps:audit`). Targets `main` directly; the rest of the stack (Comfy-Org#19092 and up) is rebased on this branch. Tracks FE-2769 / FE-3037. ## Changes - `interfaces.ts`: leaf. Keeps `Point`, `Size`, `Rect`, `ReadOnlyRect`, `Positionable`, `HasBoundingRect`, `INodeSlot`, `INodeFlags`, `ISlotType`, `IWidgetLocator`, `LinkSegment`, `DefaultConnectionColors`, colour and utility types. `LinkId`/`RerouteId` now come from `@/types/linkId` and `@/types/rerouteId` instead of via `LLink`/`Reroute`. - `types/slots.ts`: `INodeInputSlot`, `INodeOutputSlot`, `IWidgetInputSlot`, `ISubgraphInput`, `IFoundSlot`, `INodeSlotContextItem`, `ConnectingLink`. `INodeInputSlot` cannot be a leaf because `_widget?: IBaseWidget` references `types/widgets`, which references `LGraphNode`/`LGraphCanvas`. - `types/linkNetwork.ts`: `LinkNetwork`, `ReadonlyLinkNetwork`, `ItemLocator`. - `types/contextMenu.ts`: `IContextMenuOptions`, `IContextMenuValue`, `ContextMenuDivElement`. - `types/panel.ts`: `Panel*`. - `CreateNodeOptions` -> `LiteGraphGlobal.ts`; `NewNodePosition`, `IBoundaryNodes` -> `utils/arrange.ts`; `Hoverable` -> `types/events.ts`. - 94 files repointed (98 changed, 4 new), including `node/widgetsView.ts`, `contextMenuFilter.ts`, and the agent CRDT files added on `main` since the branch forked. Declarations moved verbatim. The `litegraph.ts` barrel exports the same names, so the extension API is unchanged. ## Review Focus - `pnpm typecheck`, `oxlint --type-aware`, `eslint` (warnings only, same as main), `pnpm knip`, `fallow audit`, litegraph and touched-area unit tests (217 files) pass on the rebased head. - `git diff -M --stat` is mostly import-line churn; the only new code is import headers in the four new files. - Rebase conflicts resolved by hand: `interfaces.ts` re-applies main's `ISlotType = number | string | string[]` and `slot_index?: SlotIndex` on `INodeSlot`; `types/slots.ts` carries main's `_pendingDemotionToken` on `INodeInputSlot`; `types/panel.ts` carries main's widened `PanelWidgetOptions.values`; `nodeDataStore.ts` is taken from main. - Next slice: `types/widgets.ts` (657 lines) and the `simplifiedWidget` two-cycle, which is what keeps `INodeInputSlot` and the ~26 widget classes in the SCC. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | **Comfy-Org#19088** (this PR) | **Comfy-Org#19085** | **Split litegraph `interfaces.ts` into leaf types** | **967 -> 949** | **923 -> 905** | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
…ab (Comfy-Org#19113) ## Summary Stacked on Comfy-Org#19111, in a chain rooted on `main` (Comfy-Org#19091 -> Comfy-Org#19107 -> Comfy-Org#19108 -> Comfy-Org#19111 -> Comfy-Org#19113). In the original stack it sat on Comfy-Org#19112. Tracks FE-2769 / FE-3037. `sidebarTabStore` hard-coded the model-library tab: when `Comfy.ModelLibrary.UseAssetBrowser` and the `assetsEnabled` flag were set, its toggle command opened the asset browser instead of the sidebar. That single tab pulled `openModelLibraryBrowser`, `useFeatureFlags`, and `settingStore` into the store and into the stores/scripts import cycle. Import cycles, measured with dependency-cruiser on `src` (the `pnpm lint:cycles` script arrives with Comfy-Org#19085) against Comfy-Org#19111's branch: cyclic modules 751 -> 747, largest cycle 698 -> 694, cyclic edges 3480 -> 3460. ## Changes - `SidebarTabExtension` gains an optional `onToggle?: () => boolean | Promise<boolean>` hook. The toggle command calls it first and only toggles the sidebar when the hook returns false or is absent. - `useModelLibrarySidebarTab` sets `onToggle` with the asset browser routing that used to live in the store. - `sidebarTabStore` loses the tab-id special case and its three imports. - Tests: the model-library cases move to `useModelLibrarySidebarTab.test.ts`; `sidebarTabStore.test.ts` covers the hook contract (absent, declines, handles) as a table. ## Review Focus - `onToggle` is new public API: `SidebarTabExtension` is exported from `src/types`, so the field ships in the published types package. Extensions that register a sidebar tab can now intercept the toggle by returning true; nothing else changes for them. - The routing now belongs to the core tab object, not to the `model-library` id. A tab registered under that id by anything other than `useModelLibrarySidebarTab` no longer opens the asset browser. - The tab and its `Workspace.ToggleSidebarTab.model-library` command keep their ids, so the keybinding default is unaffected. `missingModelDownload` sets `activeSidebarTabId` directly and never ran the toggle command, so it opens the sidebar tree as before. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | **Comfy-Org#19113** (this PR) | **Comfy-Org#19111 (measured on Comfy-Org#19112)** | **Model library asset-browser routing onto the sidebar tab** | **471 -> 467** | **257 -> 253** | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
…ce (Comfy-Org#19092) ## Summary Targets `main` (Comfy-Org#19088, Comfy-Org#19089 and Comfy-Org#19091 merged; rebased onto `main` at 0ef0276). Moves `loadExtensions` out of `extensionService` into `src/services/extensionLoader.ts`, called from `GraphCanvas.vue` before `app.setup()`. `extensionService` imported `extensions/core/index` so `loadExtensions` could pull the core extensions in. Every core extension imports `app`, which imports `extensionService`, so the whole `extensions/core` tree and the UI it reaches (load3d, mask editor, painter, image compare, agent panel, ...) sat in the same import cycle as the app object. `GraphCanvas.vue` already owns the bootstrap sequence and is outside the cycle, so it is the right owner of the "load extensions" step. Measured with dependency-cruiser on `src` (the Comfy-Org#19085 config, run locally), against `main` at 0ef0276: | | before | after | | --- | --- | --- | | modules in any cycle | 631 | 500 | | largest cycle | 421 | 285 | | cyclic edges | 2451 | 2034 | Tracks FE-2769 / FE-3037. ## Changes - New `src/services/extensionLoader.ts` with `loadExtensions()`, `shouldLoadExtension()`, `importCustomExtension()` and `reportExtensionLoadFailures()` (moved verbatim from `main`, including the `extensions-load-core` / `extensions-load-custom` subphases from Comfy-Org#19888 and the aggregate failure report). `extensionService.test.ts` becomes `extensionLoader.test.ts`. - `extensionService` drops `loadExtensions` and its `api`, `bootstrapTracer`, `reportError` and `getErrorMessage` imports; it keeps `registerExtension`, `invokeExtensions`, `invokeExtensionsAsync`. - Comfy-Org#19730 (subphase timings, previously merged into this branch) is dropped from the branch because `main` carries the same instrumentation via Comfy-Org#19888. - `GraphCanvas.vue` runs `bootstrapTracer.settle('bootstrap/extensions-load', loadExtensions)` right before `comfyApp.setup()`. `app.setup()` no longer loads extensions. - `GraphCanvas.test.ts` mocks the loader; `SelectionToolbox.test.ts` drops `loadExtensions` from its service mock. - `browser_tests/types/globals.d.ts` imports `@/types` explicitly. The browser typecheck (`lint-pr / typecheck-aux`) only reached the app's `Window` augmentation through `app -> extensionService -> extensions/core`, and that path is gone. ## Review Focus - Ordering change: extension modules now import before `app.setup()` runs `syncWorkflows()` and `fetchSubgraphs()` and before `bodyTop`/`canvasContainer`/`canvasElRef` are assigned, instead of after. Extension hooks (`init`, `setup`, `registerCustomNodes`, `addCustomNodeDefs`) still run inside `app.setup()` exactly as before, so an extension only notices if it reads those at module top level. Nothing in `extensions/core` does. - The `bootstrap/extensions-load` tracer phase keeps its name and position between `workflows` and `extensions-init`. - `src/services/` is a frozen directory per the pre-commit hook; the loader sits next to `extensionService`, which it was split from. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | **Comfy-Org#19092** (this PR) | **Comfy-Org#19091** | **Load extensions from bootstrap, not `extensionService`** | **669 -> 580** | **465 -> 371** | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> Co-authored-by: Amp <amp@ampcode.com>
…fy-Org#19118) ## Summary Re-implemented on current `main` (the original commit no longer applied after `api.ts` gained `authCredential`, the web-session fetch and unified remint). Now targets `main` directly. Tracks FE-2769 / FE-3037. `ComfyApi` reached into the auth layer itself: it lazily imported `authStore` for the Firebase header and WebSocket token, and imported `remintRetry` for the 401 re-mint fetch. Both pull the cloud auth graph (workspace store, session cookie, feature flags, SSO dialogs) into `api.ts`, the most imported module in `src/`. The client now takes an `ApiAuthProvider`; the cloud provider is installed from `main.ts`. Import cycles (dependency-cruiser on `src`, against `main` at 18a9c42): 511 -> 457 cyclic modules, largest SCC 296 -> 232, cyclic edges 2121 -> 1811 (15 -> 17 cycles: the big SCC splits). ## Changes - `src/platform/auth/apiAuthProvider.ts` (leaf): `ApiAuthProvider` interface (`waitForInitialization`, `getAuthHeader`, `getAuthToken`, `shouldRetryOn401`, `fetch`), `RetrySignalLifecycle`, and `anonymousApiAuthProvider` (no header, no token, no retry, plain `fetch`). - `src/platform/auth/cloudApiAuthProvider.ts`: the moved token logic (auth-store wait bounded by `AUTH_INIT_TIMEOUT_MS` from `@/scripts/apiTimeouts`, header/token lookup with the same `console.warn` fallbacks, WebSocket token telemetry, `shouldRemintCloudRequest`, `fetchWithUnifiedRemint`). `installCloudApiAuth()` sets it on `api`. - `api.ts`: `setAuthProvider`; `addCloudAuthHeader`, `addSocketAuth` and the token-path `fetch` delegate to the provider. No more `authStore` or `remintRetry` imports. The web-session path (`webSessionRequests`, `scopeMediaRoute`), `authCredentialOf` / `notifyAuthCredential` reporting and the `isCloud` gates stay where they are: those modules are leaves. - `main.ts`: `installCloudApiAuth()` in the existing `isCloud` block, before any request. - `remintRetry.ts` imports `RetrySignalLifecycle` from the leaf instead of declaring it. - Second commit: `ToastAction` / `ToastOptions` move from `types/extensionTypes.ts` to a new leaf `types/toastOptions.ts` (`extensionTypes` re-exports them, so `@/types` is unchanged). Comfy-Org#16313 made `api.ts` import `components/ui/toast/toastStore`, which took these types from `extensionTypes`, and `extensionTypes` reaches `workflowStore`, `dialogService` and `commandStore` through type imports. Without this move the provider split leaves `api.ts` inside the application SCC and the numbers above do not change at all. - Tests: cloud integration suites (`api.fetchApi`, `api.socketReset`, `webSessionFlagOff`, `webSessionFlagOn`, `nonWebClientsStayOnTokens`) call `installCloudApiAuth()` where they previously relied on the lazy import; the localhost row installs the anonymous provider, as a local build does. New `it.for` table in `api.fetchApi.test.ts` checks the header is applied, the retry decision is consulted only for authenticated requests, and the request goes through the provider's `fetch`. ## Review Focus - Install ordering. Requests made before `installCloudApiAuth()` are anonymous. `main.ts` installs it first thing in the cloud block; `refreshRemoteConfig({ useAuth: false })` uses bare `fetch`, so nothing earlier needs credentials. - Difference from the first version of this PR: `fetchApi` and `createSocket` keep their `isCloud` gates. On `main` the web session is switched on by a server feature flag, not by distribution, so dropping the gate could route a local build's requests through the session. Keeping it also leaves the local `createSocket` path synchronous, so `api.featureFlags.test.ts` needs no change. - Behavior moved, not changed: same timeout, warnings, and telemetry event for a missing WebSocket token. The telemetry import in the provider is static; `api.ts` already imported `useTelemetry` statically, so the old dynamic import saved nothing. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | **Comfy-Org#19118** (this PR) | **Comfy-Org#19116** | **Inject the api auth provider from `main.ts`** | **464 -> 447** | **250 -> 233** | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end -->
… of scripts/widgets (Comfy-Org#19093) ## Summary Targets `main` (Comfy-Org#19092 merged). Splits `src/scripts/widgets.ts` into the `ComfyWidgets` registry, a leaf type module, and the control_after_generate helpers. `widgets.ts` imported all 22 widget composables to build the registry, and every composable imported `ComfyWidgetConstructorV2` from `widgets.ts`. That type edge put the whole `vueNodes/widgets/composables` tree into the app import cycle even though the type only needs `LGraphNode`, `InputSpec` and `IBaseWidget`. Measured with dependency-cruiser on `src` (the Comfy-Org#19085 config, run locally), against `main` at 18a9c42: | | before | after | | --- | --- | --- | | modules in any cycle | 511 | 496 | | largest cycle | 296 | 281 | | cyclic edges | 2121 | 2085 | Tracks FE-2769 / FE-3037. ## Changes - New `src/types/widgetConstructor.ts` with `ComfyWidgetConstructorV2`. The 22 composables and `widgets.ts` import it from there. `ComfyWidgetConstructor` (V1) and `CustomComfyWidgetConstructor` stay in `widgets.ts` because they take `ComfyApp`. - New `src/core/graph/widgets/valueControlWidgets.ts` with `addValueControlWidget`, `addValueControlWidgets`, `updateControlWidgetLabel` and their private helpers, moved verbatim from current `main` (including `controlAfterGenerateNameOverride` and the `isValueControlMode` handling added since the branch forked). `useIntWidget`, `useFloatWidget`, `useComboWidget`, `widgetInputs.ts` and `GraphCanvas.vue` import from it. `widgets.controlAfterGenerateName.test.ts` moves with them as `valueControlWidgets.controlAfterGenerateName.test.ts`. - `useLightInfoWidget.ts` (added on `main` since the original PR) imports `ComfyWidgetConstructorV2` from `@/types/widgetConstructor` like the other composables. - `widgets.ts` no longer re-exports `IS_CONTROL_WIDGET`; `GraphCanvas.vue` imports it from `core/graph/widgets/controlWidgetMarker`. - `valueControl.ts`, `controlWidgetMarker.ts` and `promotedWidgetControl.ts` move out of `scripts/` into `core/graph/widgets` and `core/graph/subgraph`; `health.json` follows `valueControl.ts`. - `widgets.ts` keeps `export const` declarations of the three value-control helpers because `comfyAPIPlugin` only exposes declarations through the `scripts/widgets.js` shim that custom nodes import (`.fallowrc.jsonc` lists them as public, `build/plugins/comfyAPIPlugin.test.ts` asserts them). `useComboWidget.test.ts` mocks all three, since the shim reads them at module load. - `useIntWidget.test.ts` and `useFloatWidget.test.ts` add `vi.mock(import('@/scripts/app'))` (the repo's manual mock). Their old `vi.mock('@/scripts/widgets')` had also been preventing the registry from evaluating; with the registry no longer mocked, the pre-existing `settingStore -> app -> extensionService -> widgetStore -> widgets` runtime cycle reached `useIntWidget()` before its definition. Production import order is unaffected: `app.ts` is entered first there, as before. ## Review Focus - `valueControlWidgets.ts` stays in the cycle (it needs `useSettingStore`); it did not go into `valueControl.ts` because that would have pulled `valueControl.ts` and `promotedWidgetControl.ts` into the cycle too. - The 7 composables still in the cycle (`useComboWidget`, `useIntWidget`, `useFloatWidget`, `useImageUploadWidget`, ...) reach it through `settingStore`, `assetService` or node output stores, not through `widgets.ts`. - `src/types/` was chosen for the type because `simplifiedWidget.ts` and `widgetState.ts` already live there as widget leaf types. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | **Comfy-Org#19093** (this PR) | **Comfy-Org#19092** | **Split `scripts/widgets.ts` registry, types, helpers** | **580 -> 566** | **371 -> 357** | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
…Comfy-Org#19121) ## Summary Re-implemented on current `main` (the original commit no longer applied after `workspaceApi` gained the web-session adapter path). Comfy-Org#19118 has merged, so this is now one commit on `main`. Tracks FE-2769 / FE-3037. `workspaceApi` imported `authStore` for its request headers and `remintRetry` to attach the 401 re-mint interceptor at module load. Both edges put the workspace billing SDK, capability composables, and churnkey modules inside the auth cycle. The client now receives its credentials through `setWorkspaceApiAuth`, wired from `main.ts`, the same shape as Comfy-Org#19118. Import cycles (dependency-cruiser on `src`, against `origin/main` at b835c9d): 459 -> 439 cyclic modules, largest SCC 234 -> 214, cyclic edges 1815 -> 1730. ## Changes - `workspaceApi.ts`: module-private `WorkspaceApiAuth` (`getWorkspaceAuthHeader`, `getFirebaseAuthHeader`, `attachRetryInterceptor`) and exported `setWorkspaceApiAuth`, which stores the auth and attaches the interceptor to the axios client. `requestAuth` keeps its web-session adapter branch and falls back to the installed workspace header; `acceptInvite` uses the installed Firebase header. Calls that reach the token path before installation throw `WorkspaceApiError('Workspace API auth is not installed', 401)`. No more `authStore` or `remintRetry` imports; `capabilityRevision` still attaches at module load because it has no auth dependency. - New `workspaceApiAuth.ts`: `installWorkspaceApiAuth()` binds the auth-store `*OrThrow` getters and `attachUnifiedRemintInterceptor`. - `main.ts` calls `installWorkspaceApiAuth()` on every distribution, right after the cloud block. It cannot share the `isCloud` gate with `installCloudApiAuth()`: `authStore.getWorkspaceAuthToken` initializes `teamWorkspaceStore` (and so calls `workspaceApi.list()`) for a signed-in user on desktop/local too. - `workspaceApi.test.ts` installs the auth once at module scope; the store actions it stubs are the same ones the installer binds. `webSessionFlagOn.test.ts` installs it next to `installCloudApiAuth()` so the suite runs the production wiring. ## Review Focus - The interceptor is attached in `setWorkspaceApiAuth`, so calling it twice attaches two re-mint interceptors. `main.ts` calls it once; the test files install once at module scope for the same reason. - Unconfigured state only exists before `main.ts` runs. Previously a header lookup in that window would have thrown `AuthStoreError`; it now throws `WorkspaceApiError`. The web-session path never needed the auth store and is unaffected. - `WorkspaceApiAuth` is module-private; nothing outside `workspaceApi.ts` names the type. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | **Comfy-Org#19121** (this PR) | **Comfy-Org#19118** | **Install workspace api credentials from `main.ts`** | **447 -> 428** | **233 -> 214** | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end -->
…g#19116) ## Summary Targets `main`; the rest of this chain (Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19113) has merged. Tracks FE-2769 / FE-3037. `executionStore` drove the node text preview widget itself: it bound the `progress_text` socket event, resolved the node on the canvas, called `showTextPreview`, and on job reset walked the job's nodes to `removeTextPreview`. That pulled `useNodeProgressText` (and through it the widget layer and `app`) plus `canvasStore` into the store. Separately, `workflowStore` imported `executionStore` to rewrite session job paths on rename, while `executionStore` imports `workflowStore`; fallow flags that two-module cycle once this PR touches `executionStore`. Import cycles, measured with dependency-cruiser on `src` (the `pnpm lint:cycles` script arrives with Comfy-Org#19085) against `main`: cyclic modules 421 -> 418, largest cycle 196 -> 193, cyclic edges 1687 -> 1679. The rename change removes one of those edges; both stores stay in the large cycle through other paths. ## Changes - `executionStore` exposes `onJobReset` (vueuse `createEventHook`) and triggers it with the finished `QueuedJob` inside `resetExecutionState`, before the job is dropped. `QueuedJob` is exported for the listener type. The store no longer imports `useNodeProgressText`, `canvasStore`, or `parseNodeId`, and `progress_text` is no longer bound in `bindExecutionEvents`. - New `useProgressTextPreviews` composable listens to `api` `progress_text` and `executionStore.onJobReset` and owns the widget calls. GraphView mounts it next to `useProgressFavicon`. `GraphView.test.ts` is unchanged. - `workflowStore` no longer imports `executionStore`. `renameWorkflow` triggers a new `onWorkflowRenamed` hook where it used to call `rewriteSessionWorkflowPaths`, and `executionStore` subscribes in its setup. `rewriteSessionWorkflowPaths` is now private. - Tests: the progress_text and widget-removal cases move to `useProgressTextPreviews.test.ts` (real execution store, the shared `api` automock, fixtures built in each test, scope stopped with `onTestFinished`), which adds cases for the active-prompt filter, for mapping a nested execution id, and for disposal removing both listeners. Removal there is driven through `clearActiveJobIfStale`. `executionStore.test.ts` keeps one table asserting `onJobReset` fires with the job after success, interrupt, and error, and drops `progress_text` from the unbind list. Its session-path tests now drive a real `renameWorkflow`; the matching rename test in `workflowStore.test.ts` is removed and its duplicate-graph-id case lives in `executionStore.test.ts`. - E2E: the Flux2 rerun spec's progress-text test now checks the status line is visible on the node while it runs, then hidden and gone from the widget store after `execution_success`. Before, it only checked removal, so it passed even if the preview never appeared. ## Review Focus - `createEventHook` follows the existing pattern in `cloudWebSessionStore` (`onSignedOutElsewhere`). Its `on` auto-unsubscribes when the calling scope (GraphView) is disposed, and `trigger` calls listeners synchronously, so the listener sees the job before `resetExecutionState` deletes it. - Listener lifetime: `useEventListener(api, 'progress_text')` binds at GraphView setup and unbinds when GraphView's scope is disposed. Before, the store bound it in `bindExecutionEvents` (GraphView `onMounted`) and unbound it in `unbindExecutionEvents` (`onBeforeUnmount`). `progress_text` only matters once the canvas exists, and the handler already ignores events with no canvas. - Rename timing: the hook fires synchronously at the point the direct call ran, right after `workflow.rename` and before the lookup swap and bookmark awaits, so linear-mode outputs keep matching the renamed workflow. When `executionStore` does not exist yet there is no session state to rewrite. - Behavior is otherwise unchanged. The filters (active prompt only, nested execution ids mapped through `workflowStore`, active workflow only on reset) keep the same logic; node lookup is now one shared `findNode` helper. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | **Comfy-Org#19116** (this PR) | **Comfy-Org#19113** | **Progress text previews out of `executionStore`** | **467 -> 464** | **253 -> 250** | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
## Summary Targets `main` directly, rebased onto cb72d45 after Comfy-Org#19093 merged (6067dee). The original sat on Comfy-Org#19121; Comfy-Org#19118 and Comfy-Org#19121 are no longer in this chain. Tracks FE-2769 / FE-3037. `dialogService` bundled the core prompt/confirm/error dialogs with every auth, billing, workspace, cloud-notification and ComfyHub dialog. Any module that called `confirm()` transitively imported the billing and workspace layers, and `workspaceStore -> dialogService -> useBillingContext -> ... -> workspaceStore` held the whole platform layer in the app SCC. The core service keeps `showExecutionErrorDialog`, `showErrorDialog`, `prompt`, `confirm`, `showExtensionDialog`, `showLayoutDialog` and `showSmallLayoutDialog`. Feature dialogs move verbatim into per-feature composables. Extensions still see every dialog on `app.extensionManager.dialog`. Import cycles on `main` cb72d45: 421 -> 412 cyclic modules, largest SCC 196 -> 187, 1687 -> 1648 cyclic edges. ## Changes - `dialogService.ts`: core dialogs only. Declares `ExtensionDialogService` (core + feature signatures, leaf types only), `registerExtensionDialogService()` and `useExtensionDialogService()`. - `extensionDialogService.ts`: `createExtensionDialogService()` spreads the core service and the feature composables. `App.vue` registers it before `useWorkspaceStore()` is created; `workspaceStore.dialog` reads the registry. `ExtensionManager.dialog` is typed `ExtensionDialogService`. - New composables, functions moved unchanged: `composables/auth/useAuthDialogs.ts`, `composables/billing/useBillingDialogs.ts`, `platform/workspace/composables/useWorkspaceDialogs.ts`, `platform/cloud/notification/composables/useCloudNotificationDialog.ts`; `showPublishDialog` joins `useComfyHubPublishDialog`. The shared `workspaceDialogProps` object becomes `SELF_STYLED_PANEL_DIALOG_PROPS` in `components/ui/dialog/dialog.variants.ts`, next to `HUG_CONTENT_CLASS` and `SELF_STYLED_PANEL_CONTENT_CLASS`, which `main` already has there. - `composables/billing/types.ts` gains `TopUpCreditsDialogOptions`, `SubscriptionDialogOptions`, `DowngradeToPersonalResult`. `ConfirmationDialogType` moves to `components/dialog/content/confirmationDialogTypes.ts`. - `useSettingsDialog` calls `dialogStore.showDialog` directly with the same renderer/headless/closable props `showLayoutDialog` applied. - Callers switch from `useDialogService().showX` to the owning composable. Tests get a `__mocks__` per feature composable; billing dialog tests move next to `useBillingDialogs` (`git mv`), and the two `showCancelSubscriptionDialog` guard tests move from `dialogService.concurrency.test.ts` into `useBillingDialogs.cancelSubscription.test.ts`. `useInviteUrlLoader` and `UserPanel` (added on `main` since the original) switch to `useWorkspaceDialogs` / `useAuthDialogs` too. The downgrade-failure toast in `useBillingDialogs` uses the `useToast()` API from Comfy-Org#16313, as the moved code on `main` does. ## Review Focus - Registry over direct import: `workspaceStore` importing the aggregator directly keeps every feature composable in the SCC (in the original stack, simulated 185 vs 172). The registry is a module-level `let` guarded by `assert` from `@/base/assert`; `App.vue` is the only registration site. - `useExtensionDialogService()` before registration is a programming error: `assert` throws in DEV and reports in production. - Browser test fixtures (`PublishDialog.ts`, `CloudNotification.ts`) call `window.app.extensionManager.dialog.showPublishDialog/showCloudNotification`; both remain on the extension surface. - Feature dialog composables are still in the SCC through their dialog components, which import `app`. That is the next PR (`app` -> root graph leaf). - `.fallow-baselines/health.json`: one `crap_high` entry added for `useBillingDialogs.ts`; `showTopUpCreditsDialog` moved verbatim, fallow re-estimates coverage per file from export references, and the composable has fewer importers than `dialogService`. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | **Comfy-Org#19131** (this PR) | **Comfy-Org#19121 (measured on Comfy-Org#19127)** | **Feature dialogs out of `dialogService`** | **400 -> 391** | **181 -> 172** | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> Co-authored-by: Amp <amp@ampcode.com>
…omfy-Org#19143) ## Summary Modules below `scripts/app.ts` in the import graph stop importing the `app` value from it. They call `useApp()` from `scripts/appInstance`, which reads a registry that `app.ts` fills right after constructing `ComfyApp`. Type-only consumers import the new `ComfyApp` interface from `types/comfy`. Clipspace state moves out of the class into `scripts/clipspace`. Import cycles: 409 -> 371 cyclic modules, largest SCC 184 -> 154 (litegraph is now the largest), 1640 -> 1451 cyclic edges, measured with dependency-cruiser on `main` a2dba8f. Targets `main` directly, rebased onto a2dba8f. Tracks FE-2769 / FE-3037. ## Changes - `types/comfy.ts`: `ComfyApp` interface (public instance surface), `QueuePromptOptions`, `LoadGraphDataOptions`. `types/index.ts` re-exports the type from here instead of from `scripts/app`. - `scripts/appRegistry.ts`: `registerApp` / `useApp` (asserts registration). `scripts/appInstance.ts` re-exports `useApp` as the consumer-facing seam so tests can mock it without re-entering `app.ts`. - `scripts/clipspace.ts`: clipspace state plus `copyToClipspace` / `pasteFromClipspace`. `ComfyApp` statics stay as accessors for custom-node compatibility; `litegraphService` and `changeTracker` use the leaf directly. - `class ComfyApp implements ComfyApp` (aliased `IComfyApp` inside `app.ts`). `ANIM_PREVIEW_WIDGET` now lives in `useNodeAnimatedImage.ts` and is re-exported from `app.ts`. - ~40 SCC importers switched to `useApp()` (all call sites are inside functions). On the current base that includes the mask editor composables, `useNodeProgressText` and `useProgressTextWidget`, which joined the SCC after the original PR. Type positions use `ComfyApp['rootGraph']` / `Parameters<ComfyApp['loadGraphData']>[0]`. - `commandStore.loadExtensionCommands` takes `{ name; commands? }` so it no longer imports `ComfyExtension`. - `vitest.setup.ts`: global mock of `@/scripts/appInstance` that resolves `useApp()` to whatever `@/scripts/app` is in the test file (real or per-file mock), awaited in `beforeAll` / `beforeEach`. `firstRunEntry.test.ts`'s `createSharedComposable` stand-in now resets every composable it created rather than only the last one registered. - `scripts/README.md`: documents the interface / `useApp()` / clipspace pattern. - Baselines: `.fallow-baselines/dead-code.json` gains 32 pre-existing cycles (auth, billing, `workflowStore` <-> `executionStore`, the billing paths through `useBillingDialogs`, and `comfyWorkflow -> changeTracker -> workflowStore`) that fallow only enumerates once the hub edges are gone; every entry's modules sit in one SCC on `main`; the entries use fallow's sorted-path key. `health.json` entry for `clipspace.ts`. ## Review Focus - Only modules below `app.ts` use `useApp()`. Top-level code (extensions, components, `App.vue`) keeps `import { app }`. - `useApp()` asserts that `registerApp` has run; every migrated call site runs after `app.ts` evaluates. `appRegistry.test.ts` covers both branches. - The vitest bridge loads `@/scripts/app` asynchronously, so modules in its tree now evaluate after the test subject's imports. `firstRunEntry.test.ts` was the one test sensitive to that ordering. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | **Comfy-Org#19143** (this PR) | **Comfy-Org#19131** | **Invert `scripts/app` behind `useApp()`** | **391 -> 352** | **172 -> 149** | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
## Summary `types/comfy.ts` is the public extension contract, yet it imported `scripts/widgets`, `scripts/ui`, and the workflow store, so every module that typed against `ComfyApp` was pulled into the app's largest import cycle. This PR makes `types/comfy.ts`, `types/extensionTypes.ts`, and `comfyWorkflow.ts` leaves: they no longer reach `scripts/appInstance`. Before the review fixes, depcruise measured the 273-module app SCC splitting into 119 + 58 modules. Import-cycle measurements before the review fixes: 371 -> 341 cyclic modules, largest SCC 154 -> 154 (litegraph), 1451 -> 1335 cyclic edges, on `main` df4ea6d (Comfy-Org#19143 merged as cdc9fe0). These counts have not been remeasured after restoring the extension hooks. `workflowStoreTypes.ts` carries main's `nodeLocatorIdToNodeId: ... => NodeId | null` signature, which landed on `main` after the interface moved. Targets `main` directly, rebased onto df4ea6d after Comfy-Org#19143 merged (cdc9fe0). Tracks FE-2769 / FE-3037. ## Changes - `ComfyWidgetConstructor` / `CustomComfyWidgetConstructor` are declared in `types/comfy.ts`; `scripts/widgets.ts` imports them. `ComfyApp.widgets` is typed as `Record<string, ComfyWidgetConstructor | CustomComfyWidgetConstructor>` instead of `typeof ComfyWidgets`, and `dynamicComboWidget` narrows the result of `app.widgets.COMBO`. - `MissingModelPipelineResult` moves to `platform/missingModel/types.ts`; `groupCandidatesByName` moves into `missingModelGrouping.ts` so grouping stops importing scan. - `scripts/ui.ts`: `ComfyUI(app, host)` takes the app and a `LegacyMenuHost` (`resetView`, `restoreOutputs`, `trackRunButton`, `enterFocusMode`) instead of calling `useApp()`, `litegraphService`, `nodeOutputStore`, `workspaceStore`, and `useRunButtonTelemetry`. `app.ts` wires the host. - `comfyWorkflow.ts` becomes a leaf. `WorkflowChangeTracker` is an interface `ChangeTracker` implements. A `WorkflowRuntime` (`createChangeTracker`, draft get/remove/markUsed, `isDraftPersistenceEnabled`) is registered by `workflowStore.ts` at module scope, replacing the dynamic `import('@/scripts/changeTracker')` and the direct settings/draft-store imports. - `ComfyWorkflow.promptSave()` remains an extension override point. Its default delegates to the registered `WorkflowRuntime`, which opens the dialog using `saveNamePrompt` i18n keys, overridden by `SubgraphBlueprint`. `workflowService.saveWorkflowAs` continues calling the hook. - Clipspace editor save honors `ComfyApp.pasteFromClipspace` overrides. Image paste updates store-backed outputs without requiring legacy previews and skips absent selections while still pasting widget values. - New leaf `workflowStoreTypes.ts` exports the `WorkflowStore` interface; `ExtensionManager.workflow` is typed as `WorkflowStore`. - New leaf `services/dialogServiceTypes.ts` with `CoreDialogService`, `ExtensionDialogService`, `ConfirmOptions`, `ExecutionErrorDialogInput`; `useDialogService()` returns `CoreDialogService` and `extensionTypes.ts` imports the leaf. `ExtensionDialogService` carries main's current signatures (`showCancelSubscriptionDialog` scope/confirmed args, `paymentIntentSource`, `showInviteLinkInvalidDialog`, `showInviteWrongAccountDialog`). - `comfyWorkflow.test.ts` deleted (it tested the dynamic-import failure path that no longer exists); `workflowService.test.ts` mocks `useDialogService().prompt` and asserts the save-name copy; `ui.test.ts` / `ui.setStatus.test.ts` pass the app and a stub host. ## Review Focus - `ComfyApp.widgets` loses the `typeof ComfyWidgets` key typing. Core widget constructors are still reachable as `useWidgetStore().coreWidgets`; extension code indexing `app.widgets.<Name>` now gets the union type. - `ExtensionManager.workflow` no longer exposes Pinia `$`-methods on the public type. Extensions calling `app.extensionManager.workflow.$patch` would be a type break (runtime unchanged). - `ComfyWorkflow.promptSave` is preserved because [RigShare](https://github.com/xiaodoudou/ComfyUI-RigShare/blob/3de3cc32e2a5bd266879dd6b346f8960ad4dd619/web/rigshare/save-dialog.js#L22) and [Bada-Utils](https://github.com/bada-ya/ComfyUI-Bada-Utils/blob/0898b33e803df8e169501d8fe0cf1fd04044f7bf/web/workflow_organizer.js#L2996) wrap its prototype implementation to customize Save As. A regression test checks that an override's filename reaches the save path. - `workflowStore.ts` now imports `ChangeTracker` statically. fallow sees the previously dynamic `comfyWorkflow -> workflowStore -> changeTracker` 3-cycle reshaped into two short `workflowStore <-> changeTracker` cycles; this plus 28 pre-existing cycles fallow newly enumerates (auth/session, api <-> authStore <-> dialogService, promotionUtils through canvasStore and litegraphService, useAppMode -> workflowStore -> changeTracker -> executionStore, workflowStore <-> executionStore, canvasStore <-> litegraphUtil) are baselined in `.fallow-baselines/dead-code.json`. Breaking `changeTracker -> workflowStore` needs a host injection into `ChangeTracker` and a rewrite of its 1400-line test, so it is left for a follow-up. - `dynamicComboWidget` keeps the runtime lookup through `app.widgets.COMBO`. A static import of `useComboWidget` or `widgetStore` from `dynamicWidgets.ts` creates a module-evaluation cycle with `scripts/widgets.ts` (`...dynamicWidgets` spread sees an uninitialised binding), which is why the assert-based narrowing is used instead. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | **Comfy-Org#19153** (this PR) | **Comfy-Org#19148** | **`types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves** | **324 -> 293** | **149 (baseline)** | | Comfy-Org#19186 | Comfy-Org#19153 | Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves | 293 -> 259 | 149 (baseline) | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
## Summary Removes the import cycles left inside `src/workbench`: the 28-module manager cycle and the agent CRDT status cycle. `workbench/` is now cycle-free, which is a prerequisite for giving it its own TypeScript project reference. Import cycles: 341 -> 311 cyclic modules, 20 -> 18 cycles, largest SCC 154 -> 154 (litegraph), 1335 -> 1262 cyclic edges, on top of Comfy-Org#19153 (rebased onto `main` df4ea6d). Stacked on Comfy-Org#19153 (rebased onto the `drjkl/comfy-types-leaf` chain). Tracks FE-2769 / FE-3037. ## Changes - Manager: `useManagerState` had two responsibilities, deriving the manager UI state and opening the manager. Opening needs `useManagerDialog`, which imports `ManagerDialog.vue`, whose subtree imports `useManagerState` again. `openManager` moves to `useManagerDialog`, which already owns `show()`/`hide()`. `useManagerState` keeps the state derivations and the once-per-session upgrade toast, and exports `showIncompatibleManagerToast({ force })` so the explicit-click re-emit lives with `openManager`. - Callers (`useCoreCommands`, `TopMenuSection`, `ComfyMenuButton`, `HelpCenterMenuContent`, `ErrorGroupList`, `MissingPackGroupRow`) call `useManagerDialog().openManager(...)`. `ComfyMenuButton` no longer needs `useManagerState`. The legacy-menu error toast in `openManager` uses the `useToast()` API from Comfy-Org#16313, as `useManagerState` does on `main`. - Tests: `openManager` coverage moves from `useManagerState.test.ts` to `useManagerDialog.test.ts` and now covers all four states (DISABLED, INCOMPATIBLE, LEGACY_UI with and without `showToastOnLegacyError`, NEW_UI with and without `isLegacyOnly`) by driving the real `useManagerState` through `systemStatsStore` and spied `api` feature flags. The shared `__mocks__/useManagerState.ts` drops `openManager`; a new `__mocks__/useManagerDialog.ts` covers component tests. - Agent composer: the `ComposerAttachment` leaf this PR originally introduced already landed on main (`types/composerAttachment.ts`), so that part is dropped. - Agent CRDT: `AgentCrdtStatus` and `AgentCrdtOutcomeCounters` move to a new leaf `crdt/agentCrdtStatus.ts` so `crdtSnapshot.ts` stops importing `useAgentCrdtFollower.ts`. - fallow baselines: `dead-code.json` is unchanged (the stale manager entries stay as unused baseline rows); the `crap_high` entry for `openManager` moves from `useManagerState.ts` to `useManagerDialog.ts` in `health.json` (same function, new file). ## Review Focus - `openManager` now calls `useManagerState()` per invocation. Its `watch(..., { immediate: true })` runs once per call and can fire the once-per-session INCOMPATIBLE toast if no component had instantiated the composable yet. That matches the previous behaviour, where every caller instantiated `useManagerState()` before calling `openManager`. - `useManagerDialog` now imports `useManagerState`; the dependency direction is dialog -> state, matching `useManagerDialog -> ManagerDialog.vue -> ... -> useManagerState`. <!-- stack-table:start --> ## Stack Import-cycle progress for FE-3037, measured with `pnpm lint:cycles` (dependency-cruiser on `src`). ### Standalone PRs targeting `main` Each is one commit on current `main` and can merge on its own. Numbers are that PR alone against `origin/main` (1027 cyclic modules, largest cycle 983, 4562 cyclic edges). | PR | Base | Change | Cyclic modules | Largest cycle | Cyclic edges | | --- | --- | --- | --- | --- | --- | | Comfy-Org#19089 | `main` | `ServerFeatureFlag` enum to a leaf module | 1027 -> 884 | 983 -> 677 | 4562 -> 3382 | | Comfy-Org#19094 | `main` | Empty-workflow dialog out of `appModeStore` | 1027 -> 1026 | 983 -> 982 | 4562 -> 4558 | | Comfy-Org#19109 | `main` | Mask editor menu item into `Comfy.MaskEditor` extension | 1027 -> 1027 | 983 -> 983 | 4562 -> 4562 | | Comfy-Org#19112 | `main` | `PositionConfig` and layer editor dialog key to leaf modules | 1027 -> 1027 | 983 -> 983 | 4562 -> 4558 | | Comfy-Org#19122 | `main` | `settingStore` off `scripts/app`; `$el` to a leaf | 1027 -> 1025 | 983 -> 981 | 4562 -> 4552 | | Comfy-Org#19124 | `main` | `MissingNodeType` to the nodeReplacement leaf | 1027 -> 1027 | 983 -> 983 | 4562 -> 4555 | | Comfy-Org#19125 | `main` | Blueprint node defs owned by `nodeDefStore` | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | | Comfy-Org#19127 | `main` | Thumbnail and minimap data from explicit inputs | 1027 -> 1027 | 983 -> 983 | 4562 -> 4561 | All eight together on `main`, plus Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19108, Comfy-Org#19111, Comfy-Org#19116 and Comfy-Org#19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges. ### Remaining stack Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older `main` the stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses. Comfy-Org#19091, Comfy-Org#19107, Comfy-Org#19111, Comfy-Org#19113 and Comfy-Org#19131 still carry the old commits of the PRs they were moved off (Comfy-Org#19131 carries Comfy-Org#19122, Comfy-Org#19124, Comfy-Org#19125 and Comfy-Org#19127), so their GitHub diffs are wider than one PR until the stack is rebased. | PR | Base | Change | Cyclic modules | Largest cycle | | --- | --- | --- | --- | --- | | Comfy-Org#19085 | `main` | Import-cycle baseline check (`pnpm lint:cycles`) | 967 (baseline) | 923 (baseline) | | Comfy-Org#19088 | Comfy-Org#19085 | Split litegraph `interfaces.ts` into leaf types | 967 -> 949 | 923 -> 905 | | Comfy-Org#19091 | Comfy-Org#19088 (measured on Comfy-Org#19089) | Register core sidebar tabs outside `sidebarTabStore` | 816 -> 669 | 618 -> 465 | | Comfy-Org#19092 | Comfy-Org#19091 | Load extensions from bootstrap, not `extensionService` | 669 -> 580 | 465 -> 371 | | Comfy-Org#19093 | Comfy-Org#19092 | Split `scripts/widgets.ts` registry, types, helpers | 580 -> 566 | 371 -> 357 | | Comfy-Org#19107 | Comfy-Org#19093 (measured on Comfy-Org#19094) | Register settings dialog from the app shell | 558 -> 509 | 349 -> 297 | | Comfy-Org#19108 | Comfy-Org#19107 | Register asset browser modal from the app shell | 509 -> 496 | 297 -> 284 | | Comfy-Org#19111 | Comfy-Org#19108 (measured on Comfy-Org#19109) | Register core bottom panel tabs from GraphView | 484 -> 476 | 272 -> 264 | | Comfy-Org#19113 | Comfy-Org#19111 (measured on Comfy-Org#19112) | Model library asset-browser routing onto the sidebar tab | 471 -> 467 | 257 -> 253 | | Comfy-Org#19116 | Comfy-Org#19113 | Progress text previews out of `executionStore` | 467 -> 464 | 253 -> 250 | | Comfy-Org#19118 | Comfy-Org#19116 | Inject the api auth provider from `main.ts` | 464 -> 447 | 250 -> 233 | | Comfy-Org#19121 | Comfy-Org#19118 | Install workspace api credentials from `main.ts` | 447 -> 428 | 233 -> 214 | | Comfy-Org#19131 | Comfy-Org#19121 (measured on Comfy-Org#19127) | Feature dialogs out of `dialogService` | 400 -> 391 | 181 -> 172 | | Comfy-Org#19143 | Comfy-Org#19131 | Invert `scripts/app` behind `useApp()` | 391 -> 352 | 172 -> 149 | | Comfy-Org#19148 | Comfy-Org#19143 | Billing rails announce refreshes; dialogs above the facade | 352 -> 324 | 149 (baseline) | | Comfy-Org#19153 | Comfy-Org#19148 | `types/comfy`, `comfyWorkflow`, dialog/workflow contracts as leaves | 324 -> 293 | 149 (baseline) | | **Comfy-Org#19186** (this PR) | **Comfy-Org#19153** | **Workbench cycles: `openManager` onto `useManagerDialog`, agent leaves** | **293 -> 259** | **149 (baseline)** | | Comfy-Org#19189 | Comfy-Org#19186 | Thirteen small app cycles: ui, nodeDef, auth dialogs, menu, and more | 259 -> 211 | 149 (baseline) | <!-- stack-table:end --> --------- Co-authored-by: Amp <amp@ampcode.com>
Summary
Targets
mainas a single commit; in the original stack it sat on #19124. Tracks FE-2769 / FE-3037.nodeDefStore.nodeDefsprependedsubgraphStore.subgraphBlueprints, so the node-def registry depended onsubgraphStore, and through it on the workflow store, dialog service, canvas store and the rest of the app cycle. Blueprint node defs are node defs; the registry now owns them andsubgraphStorewrites into it, so the dependency points one way.Import cycles in the original stack, on top of #19124: 411 -> 403 cyclic modules, largest SCC 197 -> 184. Alone on current
main: cyclic modules and largest SCC unchanged (1027, 983), 4562 -> 4561 cyclic edges.Changes
nodeDefStore.ts: owns blueprint defs in a private map keyed by def name (SubgraphBlueprint.<name>, likenodeDefsByName), replacingsubgraphStore's privatesubgraphDefCache. It exposes a read-onlyblueprintNodeDefsByNameplusregisterBlueprintNodeDefandremoveBlueprintNodeDef.nodeDefsreads the map directly, and thesubgraphStoreimport is gone.subgraphStore.ts: registers, checks and removes blueprint defs through those actions and getter, reading through the store on every access. The now-unusedsubgraphBlueprintsexport is removed; no production code read it oncenodeDefStorestopped.subgraphStore.test.ts: new tests for deleting a blueprint, and for confirming or declining an overwrite on publish. Blueprint counts are asserted throughuseNodeDefStore().Review Focus
k, so their def name isSubgraphBlueprint.<k>. The overwrite check andisGlobalBlueprintadd the prefix to the bare name;deleteBlueprintremoves by thenodeTypeit already receives.Stack
Import-cycle progress for FE-3037, measured with
pnpm lint:cycles(dependency-cruiser onsrc).Standalone PRs targeting
mainEach is one commit on current
mainand can merge on its own. Numbers are that PR alone againstorigin/main(1027 cyclic modules, largest cycle 983, 4562 cyclic edges).mainServerFeatureFlagenum to a leaf modulemainappModeStoremainComfy.MaskEditorextensionmainPositionConfigand layer editor dialog key to leaf modulesmainsettingStoreoffscripts/app;$elto a leafmainMissingNodeTypeto the nodeReplacement leafmainnodeDefStoremainAll eight together on
main, plus #19091, #19107, #19108, #19111, #19116 and #19113 (checked locally; those six are not retargeted yet): 630 cyclic modules, largest cycle 412, 2476 cyclic edges.Remaining stack
Bottom to top, with current bases. Numbers are from the original 26-PR stack, each PR against its parent at the time, on the older
mainthe stack forked from (967 cyclic modules then). They have not been remeasured since the eight PRs above left the stack. Where the base changed, the parent the numbers were measured on is in parentheses.#19091, #19107, #19111, #19113 and #19131 still carry the old commits of the PRs they were moved off (#19131 carries #19122, #19124, #19125 and #19127), so their GitHub diffs are wider than one PR until the stack is rebased.
mainpnpm lint:cycles)interfaces.tsinto leaf typessidebarTabStoreextensionServicescripts/widgets.tsregistry, types, helpersexecutionStoremain.tsmain.tsdialogServicescripts/appbehinduseApp()types/comfy,comfyWorkflow, dialog/workflow contracts as leavesopenManagerontouseManagerDialog, agent leaves