Repository navigation
billing: add the server-resolved capabilities source - #15803
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Important Approval pendingCodeRabbit has no unresolved comments, but it has not reviewed the latest commit. Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.
📝 WalkthroughWalkthroughCloud workspace initialization now starts billing-capability resolution. The workspace API fetches typed capabilities with cancellation and timeout support. The shared composable manages permissions, caching, refreshes, stale requests, revisions, and failures. Non-cloud environments retain role-based behavior. ChangesWorkspace billing capabilities
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: 🟠 High · up to The new capability-fetching behavior can continuously refetch after each successful response, creating request churn and preventing stable billing capability state. An unresolved payment-credential serialization issue also remains in the changed API path, so the PR should not merge until these issues are fixed or explicitly accepted. Sequence Diagram(s)sequenceDiagram
participant WorkspaceAuthGate
participant useBillingCapabilities
participant workspaceApi
participant capabilityRevision
WorkspaceAuthGate->>useBillingCapabilities: initialize(abortSignal)
useBillingCapabilities->>workspaceApi: getBillingCapabilities(abortSignal)
workspaceApi-->>useBillingCapabilities: BillingCapabilitiesResponse
workspaceApi-->>capabilityRevision: mutation response with revision
capabilityRevision->>useBillingCapabilities: publish capability revision
useBillingCapabilities->>workspaceApi: refresh capabilities
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (6 passed)
Full details: Description checkExplanation The description is detailed and directly covers the new composable, API behavior, freshness rules, fallback policy, review considerations, and verification results. It does not use every template heading, but it provides the required information and is mostly complete. Full details: End-To-End Regression Coverage For FixesExplanation The changed-file list and PR description are available, but the PR title and commit subjects are not provided. The check requires commit-subject evidence when deciding whether bug-fix language is present, and it explicitly requires INCONCLUSIVE when commit subjects are unavailable. Full details: Website End-To-End Regression CoverageExplanation The changed-file list contains only files under Full details: Adr Compliance For Entity/Litegraph ChangesExplanation The changed-file list contains only workspace API, authentication, composable, mock, and capability-revision files. No changed file is under ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 2006 passed, 0 failed📊 Browser Reports
📦 Bundle: 9.36 MB gzip 🔴 +2.95 kBDetailsSummary
Category Glance App Entry Points — 3.78 kB (baseline 3.78 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.39 MB (baseline 1.39 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 124 kB (baseline 124 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 13 added / 13 removed / 4 unchanged Panels & Settings — 592 kB (baseline 592 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 11 added / 11 removed / 16 unchanged User & Accounts — 27.5 kB (baseline 27.5 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 6 added / 6 removed / 5 unchanged Editors & Dialogs — 126 kB (baseline 126 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 7 added / 7 removed / 1 unchanged UI Components — 115 kB (baseline 115 kB) • ⚪ 0 BReusable component library chunks
Status: 7 added / 7 removed / 8 unchanged Data & Services — 3.49 MB (baseline 3.49 MB) • 🔴 +2.37 kBStores, services, APIs, and repositories
Status: 14 added / 14 removed / 3 unchanged Utilities & Hooks — 555 kB (baseline 555 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 18 added / 18 removed / 19 unchanged Vendor & Third-Party — 18.1 MB (baseline 18.1 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 18 unchanged Other — 15.1 MB (baseline 15.1 MB) • 🔴 +7.67 kBBundles that do not match a named category
Status: 72 added / 72 removed / 220 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-25T19:06:57.552Z",
"gitSha": "dbf9aac318c286ceac446f3849cb32e98973d47f",
"branch": "wei/be-8716-b-capability-source",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2077.069999999992,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.842000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 652.778,
"heapDeltaBytes": 10798780,
"heapUsedBytes": 79645476,
"domNodes": -282,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 13.924000000000001,
"eventListeners": -157,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2056.2039999999797,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.821000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 580.6510000000001,
"heapDeltaBytes": -1344104,
"heapUsedBytes": 61377808,
"domNodes": -282,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 12.47,
"eventListeners": -187,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2297.0789999999965,
"styleRecalcs": 81,
"styleRecalcDurationMs": 47.36800000000001,
"layouts": 12,
"layoutDurationMs": 3.6330000000000005,
"taskDurationMs": 1377.5,
"heapDeltaBytes": 3168824,
"heapUsedBytes": 72136232,
"domNodes": -279,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 180.66,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2237.218999999982,
"styleRecalcs": 77,
"styleRecalcDurationMs": 43.143,
"layouts": 12,
"layoutDurationMs": 3.508,
"taskDurationMs": 1337.508,
"heapDeltaBytes": 5124296,
"heapUsedBytes": 73962028,
"domNodes": -282,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 172.64300000000003,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1737.7109999999902,
"styleRecalcs": 33,
"styleRecalcDurationMs": 19.346,
"layouts": 6,
"layoutDurationMs": 0.6419999999999999,
"taskDurationMs": 454.737,
"heapDeltaBytes": 4011876,
"heapUsedBytes": 72963476,
"domNodes": 77,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 18.871,
"eventListeners": 21,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1751.7370000000483,
"styleRecalcs": 30,
"styleRecalcDurationMs": 18.830999999999996,
"layouts": 6,
"layoutDurationMs": 0.7010000000000001,
"taskDurationMs": 436.40599999999995,
"heapDeltaBytes": 4067460,
"heapUsedBytes": 72983268,
"domNodes": 75,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 15.908999999999999,
"eventListeners": 21,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "dom-widget-clipping",
"durationMs": 768.7159999999835,
"styleRecalcs": 9,
"styleRecalcDurationMs": 6.608000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 484.452,
"heapDeltaBytes": -6744972,
"heapUsedBytes": 62229172,
"domNodes": 14,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 38.025000000000006,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 738.597000000027,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.112000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 463.74799999999993,
"heapDeltaBytes": -6813832,
"heapUsedBytes": 62696880,
"domNodes": 16,
"jsHeapTotalBytes": 6291456,
"scriptDurationMs": 34.038,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2068.9080000000217,
"styleRecalcs": 3,
"styleRecalcDurationMs": 2.8290000000000015,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 695.903,
"heapDeltaBytes": -21168220,
"heapUsedBytes": 69813132,
"domNodes": -280,
"jsHeapTotalBytes": 4186112,
"scriptDurationMs": 46.212999999999994,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2039.1650000000254,
"styleRecalcs": 3,
"styleRecalcDurationMs": 3.049000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 641.227,
"heapDeltaBytes": -16595512,
"heapUsedBytes": 73956544,
"domNodes": -273,
"jsHeapTotalBytes": -1581056,
"scriptDurationMs": 42.492000000000004,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 3975.9919999999624,
"styleRecalcs": 64,
"styleRecalcDurationMs": 10.134,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2974.0520000000006,
"heapDeltaBytes": -6743144,
"heapUsedBytes": 84738896,
"domNodes": -279,
"jsHeapTotalBytes": 741376,
"scriptDurationMs": 1044.5369999999998,
"eventListeners": -149,
"totalBlockingTimeMs": 1,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-pan",
"durationMs": 4268.681999999899,
"styleRecalcs": 64,
"styleRecalcDurationMs": 10.769999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3152.5190000000002,
"heapDeltaBytes": -12323972,
"heapUsedBytes": 79140308,
"domNodes": -284,
"jsHeapTotalBytes": 1003520,
"scriptDurationMs": 1126.752,
"eventListeners": -149,
"totalBlockingTimeMs": 26,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 4856.153999999947,
"styleRecalcs": 66,
"styleRecalcDurationMs": 12.525000000000002,
"layouts": 60,
"layoutDurationMs": 7.989999999999998,
"taskDurationMs": 2925.2909999999997,
"heapDeltaBytes": 17220848,
"heapUsedBytes": 86901144,
"domNodes": 24,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 983.747,
"eventListeners": 12,
"totalBlockingTimeMs": 1,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 4755.062000000066,
"styleRecalcs": 66,
"styleRecalcDurationMs": 12.295,
"layouts": 60,
"layoutDurationMs": 7.913,
"taskDurationMs": 2858.391,
"heapDeltaBytes": 7948120,
"heapUsedBytes": 74223380,
"domNodes": 24,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 967.888,
"eventListeners": 12,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 3585.831999999982,
"styleRecalcs": 41,
"styleRecalcDurationMs": 5.0459999999999985,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2360.0699999999997,
"heapDeltaBytes": 13070428,
"heapUsedBytes": 80437032,
"domNodes": 0,
"jsHeapTotalBytes": 2252800,
"scriptDurationMs": 266.685,
"eventListeners": 190,
"totalBlockingTimeMs": 7,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3639.067000000068,
"styleRecalcs": 41,
"styleRecalcDurationMs": 5.083000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2466.258,
"heapDeltaBytes": -1132784,
"heapUsedBytes": 71221264,
"domNodes": -285,
"jsHeapTotalBytes": -45056,
"scriptDurationMs": 277.327,
"eventListeners": 31,
"totalBlockingTimeMs": 1,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "minimap-idle",
"durationMs": 2058.0269999999814,
"styleRecalcs": 3,
"styleRecalcDurationMs": 3.516000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 688.7249999999999,
"heapDeltaBytes": -20657760,
"heapUsedBytes": 71737904,
"domNodes": -280,
"jsHeapTotalBytes": 3923968,
"scriptDurationMs": 41.870000000000005,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2042.190000000005,
"styleRecalcs": 3,
"styleRecalcDurationMs": 3.2990000000000035,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 708.849,
"heapDeltaBytes": -21239684,
"heapUsedBytes": 71247136,
"domNodes": -280,
"jsHeapTotalBytes": 3137536,
"scriptDurationMs": 47.878,
"eventListeners": -183,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 822.2529999999892,
"styleRecalcs": 46,
"styleRecalcDurationMs": 13.732000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 600.912,
"heapDeltaBytes": 18204076,
"heapUsedBytes": 87812924,
"domNodes": 18,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 150.18400000000003,
"eventListeners": 10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 782.675999999924,
"styleRecalcs": 46,
"styleRecalcDurationMs": 11.110999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 573.861,
"heapDeltaBytes": 17935404,
"heapUsedBytes": 87496064,
"domNodes": 18,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 148.046,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2016.5580000000318,
"styleRecalcs": 9,
"styleRecalcDurationMs": 9.421000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 588.7150000000001,
"heapDeltaBytes": -11077468,
"heapUsedBytes": 58517372,
"domNodes": -298,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 11.103,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2023.0920000000197,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.892000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 596.2950000000001,
"heapDeltaBytes": -10248652,
"heapUsedBytes": 60305872,
"domNodes": -296,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 12.559000000000003,
"eventListeners": -203,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1957.8970000000027,
"styleRecalcs": 78,
"styleRecalcDurationMs": 43.948,
"layouts": 16,
"layoutDurationMs": 4.915,
"taskDurationMs": 1226.61,
"heapDeltaBytes": -5259452,
"heapUsedBytes": 65338892,
"domNodes": -297,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 125.81,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1974.3500000000722,
"styleRecalcs": 77,
"styleRecalcDurationMs": 40.662000000000006,
"layouts": 16,
"layoutDurationMs": 4.771,
"taskDurationMs": 1202.426,
"heapDeltaBytes": -4997252,
"heapUsedBytes": 64772316,
"domNodes": -295,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 125.34599999999999,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 1434.1170000000147,
"styleRecalcs": 20,
"styleRecalcDurationMs": 33.89399999999999,
"layouts": 15,
"layoutDurationMs": 15.150999999999998,
"taskDurationMs": 1055.25,
"heapDeltaBytes": -7701668,
"heapUsedBytes": 85477072,
"domNodes": 13671,
"jsHeapTotalBytes": 10747904,
"scriptDurationMs": 32.86,
"eventListeners": 2383,
"totalBlockingTimeMs": 145,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 13404.413000000033,
"styleRecalcs": 246,
"styleRecalcDurationMs": 38.778999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 10531.637999999999,
"heapDeltaBytes": 10103128,
"heapUsedBytes": 93810400,
"domNodes": -280,
"jsHeapTotalBytes": 6176768,
"scriptDurationMs": 3525.1769999999997,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 14574.147000000039,
"styleRecalcs": 246,
"styleRecalcDurationMs": 38.667,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 11040.299,
"heapDeltaBytes": -6376420,
"heapUsedBytes": 84653688,
"domNodes": -281,
"jsHeapTotalBytes": 6475776,
"scriptDurationMs": 3860.4120000000003,
"eventListeners": -153,
"totalBlockingTimeMs": 24,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 18549.162999999964,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17755.418999999998,
"heapDeltaBytes": -34337884,
"heapUsedBytes": 177130580,
"domNodes": -6548,
"jsHeapTotalBytes": -5967872,
"scriptDurationMs": 379.225,
"eventListeners": -7471,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-idle",
"durationMs": 18464.23399999992,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17711.487,
"heapDeltaBytes": -42906888,
"heapUsedBytes": 175000212,
"domNodes": -6548,
"jsHeapTotalBytes": 249856,
"scriptDurationMs": 401.40200000000004,
"eventListeners": -7475,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.333333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 22425.263000000028,
"styleRecalcs": 172,
"styleRecalcDurationMs": 22.335999999999967,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 22073.273,
"heapDeltaBytes": -27329212,
"heapUsedBytes": 177387036,
"domNodes": -6548,
"jsHeapTotalBytes": 1036288,
"scriptDurationMs": 976.0949999999999,
"eventListeners": -7469,
"totalBlockingTimeMs": 246,
"frameDurationMs": 17.77666666666652,
"p95FrameDurationMs": 16.700000000004366
},
{
"name": "vue-large-graph-pan",
"durationMs": 22604.88099999998,
"styleRecalcs": 174,
"styleRecalcDurationMs": 23.794999999999956,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 22322.969,
"heapDeltaBytes": -30633044,
"heapUsedBytes": 180498420,
"domNodes": -6548,
"jsHeapTotalBytes": -5443584,
"scriptDurationMs": 974.293,
"eventListeners": -7467,
"totalBlockingTimeMs": 79,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "workflow-execution",
"durationMs": 472.49199999998837,
"styleRecalcs": 16,
"styleRecalcDurationMs": 26.288,
"layouts": 3,
"layoutDurationMs": 0.998,
"taskDurationMs": 136.98,
"heapDeltaBytes": 5503992,
"heapUsedBytes": 71946328,
"domNodes": 124,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 9.311,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 125.30700000002071,
"styleRecalcs": 8,
"styleRecalcDurationMs": 19.553999999999995,
"layouts": 3,
"layoutDurationMs": 0.7990000000000002,
"taskDurationMs": 91.70299999999999,
"heapDeltaBytes": 3447404,
"heapUsedBytes": 69909400,
"domNodes": 110,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 4.589000000000001,
"eventListeners": 49,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
}
]
} |
Generated output only - no hand-written changes.
Adds the capabilities composable, its API call, and the auth-gate wiring that populates it. The gate's abort signal is threaded through to the request. No consumer reads the resolved values yet - they migrate separately.
5ef0618 to
0377f9e
Compare
9cc5ec6 to
402766b
Compare
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #15803 +/- ##
==========================================
+ Coverage 80.13% 82.53% +2.39%
==========================================
Files 2260 1934 -326
Lines 115350 110808 -4542
Branches 32866 32599 -267
==========================================
- Hits 92436 91451 -985
+ Misses 22427 19018 -3409
+ Partials 487 339 -148
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 366 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…types # Conflicts: # packages/ingest-types/src/index.ts # packages/ingest-types/src/types.gen.ts # packages/ingest-types/src/zod.gen.ts
christian-byrne
left a comment
There was a problem hiding this comment.
Lightweight pass as part of the stack review (full review on #15804). Singleton state, in-flight dedup, Cloud/auth gating, workspace-switch refetch, and abort cleanup all check out, as does the failure-mode test coverage. One design question below.
When the capabilities read fails for a non-auth reason (5xx, network, workspace-mismatched body), canTopUp fell back to true for every role, so a transient outage showed the owner-only Add credits action to workspace members. The fallback now requires an owner, matching the role gate the non-Cloud branch already applies; owners keep top-up during an outage.
dante01yoon
left a comment
There was a problem hiding this comment.
The wire itself is well built — typed generated client, resolved_for scope re-validation, race/abort handling on auth and workspace changes, and the denied-vs-unavailable failure split that fails closed on privilege while staying open on ability to pay. Two contract-consumption gaps below, anchored inline. Also a stack note: the base PR #15802 is now obsolete — its regenerated types landed on main via #15855 (byte-identical, verified) — so this PR can retarget/rebase onto main directly and #15802 can be closed.
…types # Conflicts: # packages/ingest-types/src/index.ts # packages/ingest-types/src/types.gen.ts # packages/ingest-types/src/zod.gen.ts
rollout_defaults_applied, revision and expires_at became required when the ingest types were regenerated against the current spec.
dante01yoon
left a comment
There was a problem hiding this comment.
Re-reviewed at 4b8193f after the retarget and your replies. The composable changes are right and verified — but the branch is now carrying something that has to come out before merge.
issue (blocking): packages/ingest-types diverges from main by ~16k lines and is not pipeline output
The merge chain kept #15802's hand-run regeneration alive over main's bot-projected types. The result is not just formatting drift — the branch's generated files contain types that do not exist in the projection at all (e.g. HubUsernameCheckResponse), which means the snapshot was regenerated outside the push-ingest-types-to-frontend pipeline and without its FE projection filter. Generated files change only through the bot's [chore] PRs; a feature PR must not carry them. Fix is mechanical: git checkout origin/main -- packages/ingest-types (plus whatever the test: satisfy the newly required capability response fields commit needs — likely nothing, since main's type is the same 5-field shape).
Correction to the two factual blockers — both disappear once you take main's types
Main's BillingCapabilitiesResponse (packages/ingest-types/src/types.gen.ts:3883, landed via #15855, projected from cloud@2f554c4 which includes cloud#7229) already carries revision, expires_at, and rollout_defaults_applied — I verified this byte-level when #15855 merged, and cloud has had zero openapi.yaml commits since. So: the freshness fix is not blocked on a regeneration, and rollout_defaults_applied is readable today. The "~12.7k drift" you measured was against the stale, unfiltered snapshot this branch is carrying.
Agreements
- Visibility-gated expiry timer: agreed, and your push-not-pull correction is right — a
computedcan't observe wall-clock expiry, and unconditional 2 req/min from hidden tabs would be worse than the staleness. Since the fix is unblocked, my preference is to land it in this PR while the source has zero renderers; a fast-follow before #15804 is acceptable if you'd rather keep this one small — say which. X-Capability-Revisionvia the existing response-interceptor seam: agreed, including all three caveats (CORS-bypassed local origins degrade silently; pre-handler stamping means failed mutations carry it; GET-only declaration keeps the read hand-written).- Flags-on-at-merge with staging flags mirrored: accepted as the provenance answer — please put the merge checklist in #15804's description so it travels with the PR that needs it.
payment-portalmissingcapabilityMutationRevision: good catch and I agree it's an oversight — changing a payment method can flipcan_top_up. I can file the cloud fix if you want to keep momentum here.
Once the generated files are reset to main, I'm ready to approve same-day.
…Comfy-Org#16067) ## Why this is needed Enterprise workspaces exist in production (`enterprise_monthly` / `enterprise_annual`, provisioned through the comfy-admin console) but the frontend still renders them as a self-serve catalog plan. FE-1662 verified three gaps against the tree, and re-verification after the capabilities migration (Comfy-Org#15803/Comfy-Org#15804/Comfy-Org#15675) and the ENTERPRISE contract landing (Comfy-Org#15855) found the surviving surface smaller but real. Supersedes Comfy-Org#15403 — same behavioral spec and design of record ([Figma 4404-13011](https://www.figma.com/design/CkFTD4c20PyRGpNVAJgpfV/Team-Plan---Workspaces?node-id=4404-13011), DES-782), rebuilt on the server-capabilities architecture that merged underneath it. Co-authored with @comfydesigner, whose branch this replaces. - Fixes FE-1662 ## Root cause Three distinct causes, one per change group: 1. **Label fallbacks assume the catalog is total.** `resolveSubscriptionTierKey` falls back to `'standard'` for any unmapped tier, so an ENTERPRISE workspace's plan card renders **"Standard"**, Standard's **$20 USD/mo** price (`useWorkspacePlanPricing` has the same fallback), Standard's feature list, and the credits bar borrows Standard's 4,200-credit monthly pool (`CreditsTile.tierKey ?? DEFAULT_TIER_KEY`). A scheduled change to an enterprise plan falls through the `team`-prefix check and labels itself "Standard". 2. **Pricing-table entry points gate on membership, not on whether a catalog exists.** The `?pricing=` deep link (`usePricingTableUrlLoader`), the profile menu's "Plans & pricing", and settings' "View more details about plans & pricing" all gate on `canManageSubscription` (owner), so an Enterprise owner can still open the self-serve pricing table. The subscribe-to-run upsell (`CloudRunButtonWrapper`, `useCoreCommands`) gates only on `canAccessSubscriptionFeatures`, so a lapsed Enterprise workspace is offered a self-serve checkout it must not use. 3. **No representation for a tier outside the catalog.** A tier the build doesn't recognize (server ahead of client) borrowed all of the above from Standard — price and feature claims for a plan the frontend cannot identify. Lifecycle actions (cancel / reactivate / plan change / member invites) are **not** part of this PR's policy surface: the server already resolves them (`hideLifecycleCapabilities` in billing-api keeps `can_top_up=true` and closes the rest), and main already consumes those capabilities. This PR covers rendering and the pricing-catalog entry points only. ## How **One derived policy for every pricing-table entry point.** `useWorkspaceUI.canOpenPricingSurface` reads the server-resolved `can_subscribe_self_serve` on the workspace rail and falls back to membership on `legacy_stripe` — the exact shape of `canReactivatePlan` (Comfy-Org#15967), so the legacy-rail regression class that Comfy-Org#15967/Comfy-Org#16043/Comfy-Org#16046 fixed cannot recur here. Consumers: profile-menu "Plans & pricing", settings "View more details", and the `?pricing=` deep link (which now awaits capability initialization before deciding, like the `?topup=` loader, so a pre-load deep link can't slip through). **Tier drives rendering only.** `isSalesManagedTier` (ENTERPRISE or unmapped) hides the catalog price row, benefits list, and borrowed credit pool; `planDisplayName` renders "Enterprise" / "Current plan"; the scheduled-change label resolves enterprise slugs (the only signal on that path — enterprise plans are absent from `plans`); `formatTierName` gains a `te()` guard so an unknown tier degrades to a capitalized string instead of a raw i18n key. The subscribe-to-run upsell and the run-command dialog stay hidden on sales-managed plans (`SubscribeToRun` requires a catalog to sell into); the run button remains a run button. **Capability-driven credits tile.** The inactive-plan zero-state now applies only when the server also withholds top-up (`inactivePlan && !canTopUp`): lapsed self-serve plans keep today's reactivate-to-use-credits treatment (`lapsedSelfServeCapabilities` withholds top-up), while a sales-managed plan — whose top-up stays open whatever the subscription row says — keeps its real balance and Add credits. **Delete workspace hides on Enterprise** (DES-782): deletion requires a cancellation only sales can perform, so the disabled menu item was a permanent dead end. ## Behavioral spec (from Comfy-Org#15403, verified by tests) 1. Enterprise owner cannot self-serve any plan change — no upgrade, downgrade, cancel, or reactivate (server capabilities; regression-tested here). 2. The pricing table never appears for an Enterprise workspace — settings, profile menu, or `?pricing=` deep link (quiet no-op). 3. The plan reads "Enterprise" with its renewal date — never another tier's name, price, credits, or feature list. 4. Money-in stays open: top-up and Billing & invoices always reachable. 5. A cancelled or ended Enterprise subscription shows the standard state with no Reactivate/Subscribe action. 6. An unrecognized tier renders as "Current plan" with no borrowed catalog content and no self-serve actions; credits, top-up, and runs keep working, no crash. > Story 5's amended form (ended Enterprise → Subscribe returns, per the 2026-08-21 decision with Justin) is **deliberately out of scope**: billing-api resolves `can_subscribe_self_serve=false` for any enterprise subscription row including ended ones, so that behavior needs a backend change first (contract-first). Tracked as a follow-up. ## Tests - **Unit (321 passing across the 11 touched suites):** new coverage in `tierPricing` (helpers), `useWorkspaceUI` (`canOpenPricingSurface` rail split), `SubscriptionPanelContentWorkspace` (stories 1, 3, 4, 5, 6 + scheduled-change label), `CurrentUserPopoverWorkspace` (menu entry + resubscribe), `usePricingTableUrlLoader` (deep-link no-op + pre-load race), `CreditsTile` (sales-managed pool + inactive state), `CloudRunButtonWrapper` / `useCoreCommands` (upsell suppression), `useWorkspaceMenuItems` (cancel/delete/leave). - **E2E (`browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts`, 7 tests, @cloud):** one per user story against the real cloud build with server-shaped capability mocks (`hideLifecycleCapabilities` shape), plus a Pro-team self-serve regression and an unrecognized-tier no-crash regression. `endedSubscription.spec.ts` additionally pins that a non-enterprise inactive team keeps its Reactivate button. All 10 pass locally against a ComfyUI server serving the cloud dist. - `CloudWorkspaceMockHelper` gained an optional capability-overrides parameter so specs can mock the server's sales-managed shape. ## AS IS / TO BE Screenshots from the real app (cloud dist served by ComfyUI) being attached in a follow-up edit to this description: Plan & Credits panel (Standard-mislabel → Enterprise card), profile menu (Plans & pricing removed), ended-enterprise run button (subscribe upsell removed). Co-authored-by: comfydesigner <247099495+comfydesigner@users.noreply.github.com>
…redits on Local (#16087) Backport of #15799 to `cloud/1.52`. ## Merge order — this PR is stacked Base is deliberately `cloud/1.52`, not `cloud/1.52`. GitHub retargets this PR to `cloud/1.52` once its parent merges. `cloud/1.52` → #15799 → #15803 → #15804 → #15675 → #15967 → #16043 → #16046 → #16067 Every commit in this chain cherry-picks cleanly; there are no hand-resolved conflicts anywhere in the stack. ## Verification Run at the tip of the full stack: 93 unit test files, 1745 tests, 0 failures (`src/platform/workspace`, `src/platform/cloud/subscription`, `src/composables/useCoreCommands.test.ts`, `src/components/actionbar`). ## Why this is in the chain Prerequisite found while backporting #16067. `cloud/1.52` carries `useBillingPolicyCapabilities.ts` but never adopted it in `CurrentUserPopoverWorkspace.vue` / `CreditsTile.vue`. Without this commit #15804 conflicts in both files.
…ource (#16088) Backport of #15803 to `cloud/1.52`. ## Merge order — this PR is stacked Base is deliberately `backport-15799-to-cloud-1.52`, not `cloud/1.52`. GitHub retargets this PR to `cloud/1.52` once its parent merges. `cloud/1.52` → #15799 → #15803 → #15804 → #15675 → #15967 → #16043 → #16046 → #16067 Every commit in this chain cherry-picks cleanly; there are no hand-resolved conflicts anywhere in the stack. ## Verification Run at the tip of the full stack: 93 unit test files, 1745 tests, 0 failures (`src/platform/workspace`, `src/platform/cloud/subscription`, `src/composables/useCoreCommands.test.ts`, `src/components/actionbar`). --------- Co-authored-by: Wei Hai <hai.vincent@gmail.com>
…p the client-side policy (#16089) Backport of #15804 to `cloud/1.52`. ## Merge order — this PR is stacked Base is deliberately `backport-15803-to-cloud-1.52`, not `cloud/1.52`. GitHub retargets this PR to `cloud/1.52` once its parent merges. `cloud/1.52` → #15799 → #15803 → #15804 → #15675 → #15967 → #16043 → #16046 → #16067 Every commit in this chain cherry-picks cleanly; there are no hand-resolved conflicts anywhere in the stack. ## Verification Run at the tip of the full stack: 93 unit test files, 1745 tests, 0 failures (`src/platform/workspace`, `src/platform/cloud/subscription`, `src/composables/useCoreCommands.test.ts`, `src/components/actionbar`). Co-authored-by: Wei Hai <hai.vincent@gmail.com>
…lities (#16090) Backport of #15675 to `cloud/1.52`. ## Merge order — this PR is stacked Base is deliberately `backport-15804-to-cloud-1.52`, not `cloud/1.52`. GitHub retargets this PR to `cloud/1.52` once its parent merges. `cloud/1.52` → #15799 → #15803 → #15804 → #15675 → #15967 → #16043 → #16046 → #16067 Every commit in this chain cherry-picks cleanly; there are no hand-resolved conflicts anywhere in the stack. ## Verification Run at the tip of the full stack: 93 unit test files, 1745 tests, 0 failures (`src/platform/workspace`, `src/platform/cloud/subscription`, `src/composables/useCoreCommands.test.ts`, `src/components/actionbar`). Co-authored-by: Wei Hai <hai.vincent@gmail.com>
…#16067) ## Why this is needed Enterprise workspaces exist in production (`enterprise_monthly` / `enterprise_annual`, provisioned through the comfy-admin console) but the frontend still renders them as a self-serve catalog plan. FE-1662 verified three gaps against the tree, and re-verification after the capabilities migration (#15803/#15804/#15675) and the ENTERPRISE contract landing (#15855) found the surviving surface smaller but real. Supersedes #15403 — same behavioral spec and design of record ([Figma 4404-13011](https://www.figma.com/design/CkFTD4c20PyRGpNVAJgpfV/Team-Plan---Workspaces?node-id=4404-13011), DES-782), rebuilt on the server-capabilities architecture that merged underneath it. Co-authored with @comfydesigner, whose branch this replaces. - Fixes FE-1662 ## Root cause Three distinct causes, one per change group: 1. **Label fallbacks assume the catalog is total.** `resolveSubscriptionTierKey` falls back to `'standard'` for any unmapped tier, so an ENTERPRISE workspace's plan card renders **"Standard"**, Standard's **$20 USD/mo** price (`useWorkspacePlanPricing` has the same fallback), Standard's feature list, and the credits bar borrows Standard's 4,200-credit monthly pool (`CreditsTile.tierKey ?? DEFAULT_TIER_KEY`). A scheduled change to an enterprise plan falls through the `team`-prefix check and labels itself "Standard". 2. **Pricing-table entry points gate on membership, not on whether a catalog exists.** The `?pricing=` deep link (`usePricingTableUrlLoader`), the profile menu's "Plans & pricing", and settings' "View more details about plans & pricing" all gate on `canManageSubscription` (owner), so an Enterprise owner can still open the self-serve pricing table. The subscribe-to-run upsell (`CloudRunButtonWrapper`, `useCoreCommands`) gates only on `canAccessSubscriptionFeatures`, so a lapsed Enterprise workspace is offered a self-serve checkout it must not use. 3. **No representation for a tier outside the catalog.** A tier the build doesn't recognize (server ahead of client) borrowed all of the above from Standard — price and feature claims for a plan the frontend cannot identify. Lifecycle actions (cancel / reactivate / plan change / member invites) are **not** part of this PR's policy surface: the server already resolves them (`hideLifecycleCapabilities` in billing-api keeps `can_top_up=true` and closes the rest), and main already consumes those capabilities. This PR covers rendering and the pricing-catalog entry points only. ## How **One derived policy for every pricing-table entry point.** `useWorkspaceUI.canOpenPricingSurface` reads the server-resolved `can_subscribe_self_serve` on the workspace rail and falls back to membership on `legacy_stripe` — the exact shape of `canReactivatePlan` (#15967), so the legacy-rail regression class that #15967/#16043/#16046 fixed cannot recur here. Consumers: profile-menu "Plans & pricing", settings "View more details", and the `?pricing=` deep link (which now awaits capability initialization before deciding, like the `?topup=` loader, so a pre-load deep link can't slip through). **Tier drives rendering only.** `isSalesManagedTier` (ENTERPRISE or unmapped) hides the catalog price row, benefits list, and borrowed credit pool; `planDisplayName` renders "Enterprise" / "Current plan"; the scheduled-change label resolves enterprise slugs (the only signal on that path — enterprise plans are absent from `plans`); `formatTierName` gains a `te()` guard so an unknown tier degrades to a capitalized string instead of a raw i18n key. The subscribe-to-run upsell and the run-command dialog stay hidden on sales-managed plans (`SubscribeToRun` requires a catalog to sell into); the run button remains a run button. **Capability-driven credits tile.** The inactive-plan zero-state now applies only when the server also withholds top-up (`inactivePlan && !canTopUp`): lapsed self-serve plans keep today's reactivate-to-use-credits treatment (`lapsedSelfServeCapabilities` withholds top-up), while a sales-managed plan — whose top-up stays open whatever the subscription row says — keeps its real balance and Add credits. **Delete workspace hides on Enterprise** (DES-782): deletion requires a cancellation only sales can perform, so the disabled menu item was a permanent dead end. ## Behavioral spec (from #15403, verified by tests) 1. Enterprise owner cannot self-serve any plan change — no upgrade, downgrade, cancel, or reactivate (server capabilities; regression-tested here). 2. The pricing table never appears for an Enterprise workspace — settings, profile menu, or `?pricing=` deep link (quiet no-op). 3. The plan reads "Enterprise" with its renewal date — never another tier's name, price, credits, or feature list. 4. Money-in stays open: top-up and Billing & invoices always reachable. 5. A cancelled or ended Enterprise subscription shows the standard state with no Reactivate/Subscribe action. 6. An unrecognized tier renders as "Current plan" with no borrowed catalog content and no self-serve actions; credits, top-up, and runs keep working, no crash. > Story 5's amended form (ended Enterprise → Subscribe returns, per the 2026-08-21 decision with Justin) is **deliberately out of scope**: billing-api resolves `can_subscribe_self_serve=false` for any enterprise subscription row including ended ones, so that behavior needs a backend change first (contract-first). Tracked as a follow-up. ## Tests - **Unit (321 passing across the 11 touched suites):** new coverage in `tierPricing` (helpers), `useWorkspaceUI` (`canOpenPricingSurface` rail split), `SubscriptionPanelContentWorkspace` (stories 1, 3, 4, 5, 6 + scheduled-change label), `CurrentUserPopoverWorkspace` (menu entry + resubscribe), `usePricingTableUrlLoader` (deep-link no-op + pre-load race), `CreditsTile` (sales-managed pool + inactive state), `CloudRunButtonWrapper` / `useCoreCommands` (upsell suppression), `useWorkspaceMenuItems` (cancel/delete/leave). - **E2E (`browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts`, 7 tests, @cloud):** one per user story against the real cloud build with server-shaped capability mocks (`hideLifecycleCapabilities` shape), plus a Pro-team self-serve regression and an unrecognized-tier no-crash regression. `endedSubscription.spec.ts` additionally pins that a non-enterprise inactive team keeps its Reactivate button. All 10 pass locally against a ComfyUI server serving the cloud dist. - `CloudWorkspaceMockHelper` gained an optional capability-overrides parameter so specs can mock the server's sales-managed shape. ## AS IS / TO BE Screenshots from the real app (cloud dist served by ComfyUI) being attached in a follow-up edit to this description: Plan & Credits panel (Standard-mislabel → Enterprise card), profile menu (Plans & pricing removed), ended-enterprise run button (subscribe upsell removed). Co-authored-by: comfydesigner <247099495+comfydesigner@users.noreply.github.com> (cherry picked from commit bab0873)
… rail and centralize the policy (#16091) Backport of #15967 to `cloud/1.52`. ## Merge order — this PR is stacked Base is deliberately `backport-15675-to-cloud-1.52`, not `cloud/1.52`. GitHub retargets this PR to `cloud/1.52` once its parent merges. `cloud/1.52` → #15799 → #15803 → #15804 → #15675 → #15967 → #16043 → #16046 → #16067 Every commit in this chain cherry-picks cleanly; there are no hand-resolved conflicts anywhere in the stack. ## Verification Run at the tip of the full stack: 93 unit test files, 1745 tests, 0 failures (`src/platform/workspace`, `src/platform/cloud/subscription`, `src/composables/useCoreCommands.test.ts`, `src/components/actionbar`). Co-authored-by: Wei Hai <hai.vincent@gmail.com>
… with the centralized rail policy (#16092) Backport of #16043 to `cloud/1.52`. ## Merge order — this PR is stacked Base is deliberately `backport-15967-to-cloud-1.52`, not `cloud/1.52`. GitHub retargets this PR to `cloud/1.52` once its parent merges. `cloud/1.52` → #15799 → #15803 → #15804 → #15675 → #15967 → #16043 → #16046 → #16067 Every commit in this chain cherry-picks cleanly; there are no hand-resolved conflicts anywhere in the stack. ## Verification Run at the tip of the full stack: 93 unit test files, 1745 tests, 0 failures (`src/platform/workspace`, `src/platform/cloud/subscription`, `src/composables/useCoreCommands.test.ts`, `src/components/actionbar`). --------- Co-authored-by: Wei Hai <hai.vincent@gmail.com>
…centralized rail policy (#16093) Backport of #16046 to `cloud/1.52`. ## Merge order — this PR is stacked Base is deliberately `backport-16043-to-cloud-1.52`, not `cloud/1.52`. GitHub retargets this PR to `cloud/1.52` once its parent merges. `cloud/1.52` → #15799 → #15803 → #15804 → #15675 → #15967 → #16043 → #16046 → #16067 Every commit in this chain cherry-picks cleanly; there are no hand-resolved conflicts anywhere in the stack. ## Verification Run at the tip of the full stack: 93 unit test files, 1745 tests, 0 failures (`src/platform/workspace`, `src/platform/cloud/subscription`, `src/composables/useCoreCommands.test.ts`, `src/components/actionbar`). Co-authored-by: Wei Hai <hai.vincent@gmail.com>
…#16067) ## Why this is needed Enterprise workspaces exist in production (`enterprise_monthly` / `enterprise_annual`, provisioned through the comfy-admin console) but the frontend still renders them as a self-serve catalog plan. FE-1662 verified three gaps against the tree, and re-verification after the capabilities migration (#15803/#15804/#15675) and the ENTERPRISE contract landing (#15855) found the surviving surface smaller but real. Supersedes #15403 — same behavioral spec and design of record ([Figma 4404-13011](https://www.figma.com/design/CkFTD4c20PyRGpNVAJgpfV/Team-Plan---Workspaces?node-id=4404-13011), DES-782), rebuilt on the server-capabilities architecture that merged underneath it. Co-authored with @comfydesigner, whose branch this replaces. - Fixes FE-1662 ## Root cause Three distinct causes, one per change group: 1. **Label fallbacks assume the catalog is total.** `resolveSubscriptionTierKey` falls back to `'standard'` for any unmapped tier, so an ENTERPRISE workspace's plan card renders **"Standard"**, Standard's **$20 USD/mo** price (`useWorkspacePlanPricing` has the same fallback), Standard's feature list, and the credits bar borrows Standard's 4,200-credit monthly pool (`CreditsTile.tierKey ?? DEFAULT_TIER_KEY`). A scheduled change to an enterprise plan falls through the `team`-prefix check and labels itself "Standard". 2. **Pricing-table entry points gate on membership, not on whether a catalog exists.** The `?pricing=` deep link (`usePricingTableUrlLoader`), the profile menu's "Plans & pricing", and settings' "View more details about plans & pricing" all gate on `canManageSubscription` (owner), so an Enterprise owner can still open the self-serve pricing table. The subscribe-to-run upsell (`CloudRunButtonWrapper`, `useCoreCommands`) gates only on `canAccessSubscriptionFeatures`, so a lapsed Enterprise workspace is offered a self-serve checkout it must not use. 3. **No representation for a tier outside the catalog.** A tier the build doesn't recognize (server ahead of client) borrowed all of the above from Standard — price and feature claims for a plan the frontend cannot identify. Lifecycle actions (cancel / reactivate / plan change / member invites) are **not** part of this PR's policy surface: the server already resolves them (`hideLifecycleCapabilities` in billing-api keeps `can_top_up=true` and closes the rest), and main already consumes those capabilities. This PR covers rendering and the pricing-catalog entry points only. ## How **One derived policy for every pricing-table entry point.** `useWorkspaceUI.canOpenPricingSurface` reads the server-resolved `can_subscribe_self_serve` on the workspace rail and falls back to membership on `legacy_stripe` — the exact shape of `canReactivatePlan` (#15967), so the legacy-rail regression class that #15967/#16043/#16046 fixed cannot recur here. Consumers: profile-menu "Plans & pricing", settings "View more details", and the `?pricing=` deep link (which now awaits capability initialization before deciding, like the `?topup=` loader, so a pre-load deep link can't slip through). **Tier drives rendering only.** `isSalesManagedTier` (ENTERPRISE or unmapped) hides the catalog price row, benefits list, and borrowed credit pool; `planDisplayName` renders "Enterprise" / "Current plan"; the scheduled-change label resolves enterprise slugs (the only signal on that path — enterprise plans are absent from `plans`); `formatTierName` gains a `te()` guard so an unknown tier degrades to a capitalized string instead of a raw i18n key. The subscribe-to-run upsell and the run-command dialog stay hidden on sales-managed plans (`SubscribeToRun` requires a catalog to sell into); the run button remains a run button. **Capability-driven credits tile.** The inactive-plan zero-state now applies only when the server also withholds top-up (`inactivePlan && !canTopUp`): lapsed self-serve plans keep today's reactivate-to-use-credits treatment (`lapsedSelfServeCapabilities` withholds top-up), while a sales-managed plan — whose top-up stays open whatever the subscription row says — keeps its real balance and Add credits. **Delete workspace hides on Enterprise** (DES-782): deletion requires a cancellation only sales can perform, so the disabled menu item was a permanent dead end. ## Behavioral spec (from #15403, verified by tests) 1. Enterprise owner cannot self-serve any plan change — no upgrade, downgrade, cancel, or reactivate (server capabilities; regression-tested here). 2. The pricing table never appears for an Enterprise workspace — settings, profile menu, or `?pricing=` deep link (quiet no-op). 3. The plan reads "Enterprise" with its renewal date — never another tier's name, price, credits, or feature list. 4. Money-in stays open: top-up and Billing & invoices always reachable. 5. A cancelled or ended Enterprise subscription shows the standard state with no Reactivate/Subscribe action. 6. An unrecognized tier renders as "Current plan" with no borrowed catalog content and no self-serve actions; credits, top-up, and runs keep working, no crash. > Story 5's amended form (ended Enterprise → Subscribe returns, per the 2026-08-21 decision with Justin) is **deliberately out of scope**: billing-api resolves `can_subscribe_self_serve=false` for any enterprise subscription row including ended ones, so that behavior needs a backend change first (contract-first). Tracked as a follow-up. ## Tests - **Unit (321 passing across the 11 touched suites):** new coverage in `tierPricing` (helpers), `useWorkspaceUI` (`canOpenPricingSurface` rail split), `SubscriptionPanelContentWorkspace` (stories 1, 3, 4, 5, 6 + scheduled-change label), `CurrentUserPopoverWorkspace` (menu entry + resubscribe), `usePricingTableUrlLoader` (deep-link no-op + pre-load race), `CreditsTile` (sales-managed pool + inactive state), `CloudRunButtonWrapper` / `useCoreCommands` (upsell suppression), `useWorkspaceMenuItems` (cancel/delete/leave). - **E2E (`browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts`, 7 tests, @cloud):** one per user story against the real cloud build with server-shaped capability mocks (`hideLifecycleCapabilities` shape), plus a Pro-team self-serve regression and an unrecognized-tier no-crash regression. `endedSubscription.spec.ts` additionally pins that a non-enterprise inactive team keeps its Reactivate button. All 10 pass locally against a ComfyUI server serving the cloud dist. - `CloudWorkspaceMockHelper` gained an optional capability-overrides parameter so specs can mock the server's sales-managed shape. ## AS IS / TO BE Screenshots from the real app (cloud dist served by ComfyUI) being attached in a follow-up edit to this description: Plan & Credits panel (Standard-mislabel → Enterprise card), profile menu (Plans & pricing removed), ended-enterprise run button (subscribe upsell removed). Co-authored-by: comfydesigner <247099495+comfydesigner@users.noreply.github.com> (cherry picked from commit bab0873)
…gh server capabilities (#16094) Backport of #16067 to `cloud/1.52`. ## Merge order — this PR is stacked Base is deliberately `backport-16046-to-cloud-1.52`, not `cloud/1.52`. GitHub retargets this PR to `cloud/1.52` once its parent merges. `cloud/1.52` → #15799 → #15803 → #15804 → #15675 → #15967 → #16043 → #16046 → #16067 Every commit in this chain cherry-picks cleanly; there are no hand-resolved conflicts anywhere in the stack. ## Verification Run at the tip of the full stack: 93 unit test files, 1745 tests, 0 failures (`src/platform/workspace`, `src/platform/cloud/subscription`, `src/composables/useCoreCommands.test.ts`, `src/components/actionbar`). ## Also carries #16032 and #16041 #16067's unit tests need mocks (`app.queuePrompt`, `trackWorkflowExecution`, `useQueueSettingsStore`) that #16032 introduced, and its run-gate coverage comes from #16041. Both are already backported independently as #16084 and #16059. This branch therefore contains them; whichever lands first makes the other's patch a no-op. Without #16032 the `useCoreCommands` hunks conflict and 8 tests fail. --------- Co-authored-by: comfydesigner <247099495+comfydesigner@users.noreply.github.com>
…#16067) ## Why this is needed Enterprise workspaces exist in production (`enterprise_monthly` / `enterprise_annual`, provisioned through the comfy-admin console) but the frontend still renders them as a self-serve catalog plan. FE-1662 verified three gaps against the tree, and re-verification after the capabilities migration (#15803/#15804/#15675) and the ENTERPRISE contract landing (#15855) found the surviving surface smaller but real. Supersedes #15403 — same behavioral spec and design of record ([Figma 4404-13011](https://www.figma.com/design/CkFTD4c20PyRGpNVAJgpfV/Team-Plan---Workspaces?node-id=4404-13011), DES-782), rebuilt on the server-capabilities architecture that merged underneath it. Co-authored with @comfydesigner, whose branch this replaces. - Fixes FE-1662 ## Root cause Three distinct causes, one per change group: 1. **Label fallbacks assume the catalog is total.** `resolveSubscriptionTierKey` falls back to `'standard'` for any unmapped tier, so an ENTERPRISE workspace's plan card renders **"Standard"**, Standard's **$20 USD/mo** price (`useWorkspacePlanPricing` has the same fallback), Standard's feature list, and the credits bar borrows Standard's 4,200-credit monthly pool (`CreditsTile.tierKey ?? DEFAULT_TIER_KEY`). A scheduled change to an enterprise plan falls through the `team`-prefix check and labels itself "Standard". 2. **Pricing-table entry points gate on membership, not on whether a catalog exists.** The `?pricing=` deep link (`usePricingTableUrlLoader`), the profile menu's "Plans & pricing", and settings' "View more details about plans & pricing" all gate on `canManageSubscription` (owner), so an Enterprise owner can still open the self-serve pricing table. The subscribe-to-run upsell (`CloudRunButtonWrapper`, `useCoreCommands`) gates only on `canAccessSubscriptionFeatures`, so a lapsed Enterprise workspace is offered a self-serve checkout it must not use. 3. **No representation for a tier outside the catalog.** A tier the build doesn't recognize (server ahead of client) borrowed all of the above from Standard — price and feature claims for a plan the frontend cannot identify. Lifecycle actions (cancel / reactivate / plan change / member invites) are **not** part of this PR's policy surface: the server already resolves them (`hideLifecycleCapabilities` in billing-api keeps `can_top_up=true` and closes the rest), and main already consumes those capabilities. This PR covers rendering and the pricing-catalog entry points only. ## How **One derived policy for every pricing-table entry point.** `useWorkspaceUI.canOpenPricingSurface` reads the server-resolved `can_subscribe_self_serve` on the workspace rail and falls back to membership on `legacy_stripe` — the exact shape of `canReactivatePlan` (#15967), so the legacy-rail regression class that #15967/#16043/#16046 fixed cannot recur here. Consumers: profile-menu "Plans & pricing", settings "View more details", and the `?pricing=` deep link (which now awaits capability initialization before deciding, like the `?topup=` loader, so a pre-load deep link can't slip through). **Tier drives rendering only.** `isSalesManagedTier` (ENTERPRISE or unmapped) hides the catalog price row, benefits list, and borrowed credit pool; `planDisplayName` renders "Enterprise" / "Current plan"; the scheduled-change label resolves enterprise slugs (the only signal on that path — enterprise plans are absent from `plans`); `formatTierName` gains a `te()` guard so an unknown tier degrades to a capitalized string instead of a raw i18n key. The subscribe-to-run upsell and the run-command dialog stay hidden on sales-managed plans (`SubscribeToRun` requires a catalog to sell into); the run button remains a run button. **Capability-driven credits tile.** The inactive-plan zero-state now applies only when the server also withholds top-up (`inactivePlan && !canTopUp`): lapsed self-serve plans keep today's reactivate-to-use-credits treatment (`lapsedSelfServeCapabilities` withholds top-up), while a sales-managed plan — whose top-up stays open whatever the subscription row says — keeps its real balance and Add credits. **Delete workspace hides on Enterprise** (DES-782): deletion requires a cancellation only sales can perform, so the disabled menu item was a permanent dead end. ## Behavioral spec (from #15403, verified by tests) 1. Enterprise owner cannot self-serve any plan change — no upgrade, downgrade, cancel, or reactivate (server capabilities; regression-tested here). 2. The pricing table never appears for an Enterprise workspace — settings, profile menu, or `?pricing=` deep link (quiet no-op). 3. The plan reads "Enterprise" with its renewal date — never another tier's name, price, credits, or feature list. 4. Money-in stays open: top-up and Billing & invoices always reachable. 5. A cancelled or ended Enterprise subscription shows the standard state with no Reactivate/Subscribe action. 6. An unrecognized tier renders as "Current plan" with no borrowed catalog content and no self-serve actions; credits, top-up, and runs keep working, no crash. > Story 5's amended form (ended Enterprise → Subscribe returns, per the 2026-08-21 decision with Justin) is **deliberately out of scope**: billing-api resolves `can_subscribe_self_serve=false` for any enterprise subscription row including ended ones, so that behavior needs a backend change first (contract-first). Tracked as a follow-up. ## Tests - **Unit (321 passing across the 11 touched suites):** new coverage in `tierPricing` (helpers), `useWorkspaceUI` (`canOpenPricingSurface` rail split), `SubscriptionPanelContentWorkspace` (stories 1, 3, 4, 5, 6 + scheduled-change label), `CurrentUserPopoverWorkspace` (menu entry + resubscribe), `usePricingTableUrlLoader` (deep-link no-op + pre-load race), `CreditsTile` (sales-managed pool + inactive state), `CloudRunButtonWrapper` / `useCoreCommands` (upsell suppression), `useWorkspaceMenuItems` (cancel/delete/leave). - **E2E (`browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts`, 7 tests, @cloud):** one per user story against the real cloud build with server-shaped capability mocks (`hideLifecycleCapabilities` shape), plus a Pro-team self-serve regression and an unrecognized-tier no-crash regression. `endedSubscription.spec.ts` additionally pins that a non-enterprise inactive team keeps its Reactivate button. All 10 pass locally against a ComfyUI server serving the cloud dist. - `CloudWorkspaceMockHelper` gained an optional capability-overrides parameter so specs can mock the server's sales-managed shape. ## AS IS / TO BE Screenshots from the real app (cloud dist served by ComfyUI) being attached in a follow-up edit to this description: Plan & Credits panel (Standard-mislabel → Enterprise card), profile menu (Plans & pricing removed), ended-enterprise run button (subscribe upsell removed). Co-authored-by: comfydesigner <247099495+comfydesigner@users.noreply.github.com>
|
|
|
|
|
|
Summary
Adds the client-side source for server-resolved billing capabilities: a shared composable that fetches
GET /api/billing/capabilities, keeps one snapshot per (auth, workspace) scope, and keeps that snapshot fresh.Nothing renders from it yet — the consumers migrate in #15804. The only production caller here is
WorkspaceAuthGate, which kicks offinitialize()and never reads the values.What's in it
The capability source —
useBillingCapabilities, acreateSharedComposablesingleton with in-flight request dedupe, abort handling, alatestRequestIdguard against out-of-order responses, and a scope watch that refetches on workspace or auth change and discards reads resolved for a different workspace.Freshness (originally #15880, merged in) — the response's
expires_atandrevisionare consumed rather than ignored, so a snapshot can't outlive a webhook-processed billing change or a mutation made in another tab:setTimeoutfromexpires_at, gated on document visibility — scheduled only while the tab is visible, cleared when it hides, and on return either refetched (if expired) or rescheduled for the remainder. This is push rather than pull deliberately:capabilitiesis acomputed, so wall-clock time is not a reactive dependency and a lazy check would stay memoized while the UI renders stale values. Visibility gating keeps an unconditional 2 requests/minute per session out of hidden tabs, where staleness is unobservable.refreshAt. If the apparent remaining lifetime clears a 5s floor it is used (capped at 1h); otherwise — negative, tiny, or an unparseable timestamp — it falls back to a fixed 60s. No wall-clock arithmetic is redone later, so a skewed clock cannot feed a negative delay into a clamp.capabilities,canTopUpandisReadystay stable across it; only a scope change (auth or workspace) resets immediately, because there the old answer is wrong rather than merely stale. A failed refresh keeps the last good snapshot and retries in 60s; a denial (401/403) still replaces it, since that is the server answering about this actor rather than an absence of an answer.workspaceApiClientreadsX-Capability-Revisionand invalidates on a change. It sits beside the existingattachUnifiedRemintInterceptorrather than adding a layer; the notifier is its own module becauseworkspaceApicannot import the composable that imports it.Fallback policy. An unreadable capability keeps top-up available only for owners, and fails closed for every other role including an unresolved one —
role === 'owner'rather than!== 'member', becauseactiveWorkspacecan be null whileactiveWorkspaceIdis set. Failing fully closed would block an owner from adding credits during an outage, turning a partial outage into a total billing outage for the only people who can pay.Contract details worth a reviewer's eye
X-Capability-Revisionis absent on desktop, where CORS is bypassed for local origins — the read is defensive and degrades silently.POST /api/billing/payment-portalhas no revision middleware yet, so portal-driven changes invalidate via the expiry timer rather than instantly. Known backend gap, tracked separately.readStatetopendingand the listener ignores anything notresolved.Verification
pnpm typecheck,typecheck:browser,lint,format:check,knip— clean.--coverage: 17,509 passed, 0 coverage-threshold errors. The 12check-binary-sizefailures are pre-existing and environmental.