Repository navigation
billing: consume the remaining workspace capabilities - #15675
Conversation
🎭 Playwright: ✅ 2003 passed, 0 failed · 2 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle: 9.37 MB gzip 🔴 +500 BDetailsSummary
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.4 MB (baseline 1.4 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.53 MB (baseline 3.53 MB) • 🔴 +93 BStores, services, APIs, and repositories
Status: 14 added / 14 removed / 3 unchanged Utilities & Hooks — 555 kB (baseline 555 kB) • 🔴 +92 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) • 🔴 +2.19 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-26T01:30:52.030Z",
"gitSha": "163cd4f1c4096d171a8ea208191020e17c17313f",
"branch": "wei/be-8841-remaining-billing-capabilities",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2050.175999999965,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.821999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 489.46500000000003,
"heapDeltaBytes": -15213100,
"heapUsedBytes": 56160368,
"domNodes": -281,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 8.099000000000002,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2031.4610000000357,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.041,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 525.937,
"heapDeltaBytes": -15011468,
"heapUsedBytes": 56761632,
"domNodes": -281,
"jsHeapTotalBytes": 4186112,
"scriptDurationMs": 9.363999999999997,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2330.8289999999943,
"styleRecalcs": 82,
"styleRecalcDurationMs": 44.707,
"layouts": 12,
"layoutDurationMs": 3.628,
"taskDurationMs": 1359.223,
"heapDeltaBytes": 4129548,
"heapUsedBytes": 76398320,
"domNodes": -277,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 173.988,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2118.588999999929,
"styleRecalcs": 78,
"styleRecalcDurationMs": 38.243,
"layouts": 12,
"layoutDurationMs": 3.152,
"taskDurationMs": 1165.9959999999999,
"heapDeltaBytes": 3593908,
"heapUsedBytes": 75413092,
"domNodes": -282,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 144.26799999999997,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1721.2339999999813,
"styleRecalcs": 32,
"styleRecalcDurationMs": 17.253999999999998,
"layouts": 6,
"layoutDurationMs": 0.686,
"taskDurationMs": 358.815,
"heapDeltaBytes": 4523624,
"heapUsedBytes": 76471548,
"domNodes": 77,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 10.861000000000002,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1756.2940000000253,
"styleRecalcs": 32,
"styleRecalcDurationMs": 16.528000000000002,
"layouts": 6,
"layoutDurationMs": 0.597,
"taskDurationMs": 370.603,
"heapDeltaBytes": 4212780,
"heapUsedBytes": 76451628,
"domNodes": 77,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 10.627,
"eventListeners": 21,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 908.9390000000321,
"styleRecalcs": 12,
"styleRecalcDurationMs": 6.3519999999999985,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 669.793,
"heapDeltaBytes": 6756180,
"heapUsedBytes": 78593284,
"domNodes": 16,
"jsHeapTotalBytes": 7340032,
"scriptDurationMs": 139.714,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 957.1569999999383,
"styleRecalcs": 12,
"styleRecalcDurationMs": 7.443999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 669.654,
"heapDeltaBytes": 5524652,
"heapUsedBytes": 75741184,
"domNodes": 16,
"jsHeapTotalBytes": 6553600,
"scriptDurationMs": 139.201,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-idle",
"durationMs": 2072.025999999994,
"styleRecalcs": 5,
"styleRecalcDurationMs": 5.264000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 578.7280000000001,
"heapDeltaBytes": -5456904,
"heapUsedBytes": 73702520,
"domNodes": -278,
"jsHeapTotalBytes": -569344,
"scriptDurationMs": 35.387,
"eventListeners": -185,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2041.5419999999358,
"styleRecalcs": 4,
"styleRecalcDurationMs": 3.5549999999999993,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 538.9019999999999,
"heapDeltaBytes": -2292456,
"heapUsedBytes": 77030432,
"domNodes": -273,
"jsHeapTotalBytes": -1355776,
"scriptDurationMs": 36.67600000000001,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 3230.122999999992,
"styleRecalcs": 64,
"styleRecalcDurationMs": 8.729999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2449.495,
"heapDeltaBytes": 14546676,
"heapUsedBytes": 94175876,
"domNodes": -274,
"jsHeapTotalBytes": 3063808,
"scriptDurationMs": 868.8050000000001,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 3218.369999999936,
"styleRecalcs": 62,
"styleRecalcDurationMs": 8.321000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2451.805,
"heapDeltaBytes": 79664,
"heapUsedBytes": 65699488,
"domNodes": 0,
"jsHeapTotalBytes": 2883584,
"scriptDurationMs": 869.634,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 4211.516999999958,
"styleRecalcs": 66,
"styleRecalcDurationMs": 10.925,
"layouts": 60,
"layoutDurationMs": 6.990999999999999,
"taskDurationMs": 2341.138,
"heapDeltaBytes": -2501740,
"heapUsedBytes": 67491216,
"domNodes": 24,
"jsHeapTotalBytes": 2883584,
"scriptDurationMs": 804.573,
"eventListeners": 12,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 4355.952000000002,
"styleRecalcs": 69,
"styleRecalcDurationMs": 14.231,
"layouts": 60,
"layoutDurationMs": 7.330000000000001,
"taskDurationMs": 2473.964,
"heapDeltaBytes": 3432980,
"heapUsedBytes": 88422608,
"domNodes": -260,
"jsHeapTotalBytes": 1003520,
"scriptDurationMs": 818.485,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 4762.62399999996,
"styleRecalcs": 41,
"styleRecalcDurationMs": 6.593000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3519.9179999999997,
"heapDeltaBytes": -4528504,
"heapUsedBytes": 81374196,
"domNodes": -284,
"jsHeapTotalBytes": 372736,
"scriptDurationMs": 968.58,
"eventListeners": 3,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 4772.918000000004,
"styleRecalcs": 40,
"styleRecalcDurationMs": 4.076,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3495.934,
"heapDeltaBytes": 23729640,
"heapUsedBytes": 91552908,
"domNodes": 0,
"jsHeapTotalBytes": 2514944,
"scriptDurationMs": 976.0900000000001,
"eventListeners": 192,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "minimap-idle",
"durationMs": 2096.1919999999736,
"styleRecalcs": 3,
"styleRecalcDurationMs": 5.966999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 585.119,
"heapDeltaBytes": -6335056,
"heapUsedBytes": 74655688,
"domNodes": -281,
"jsHeapTotalBytes": -1617920,
"scriptDurationMs": 36.01100000000001,
"eventListeners": -185,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2030.6830000000673,
"styleRecalcs": 3,
"styleRecalcDurationMs": 3.047000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 523.3580000000001,
"heapDeltaBytes": -3441848,
"heapUsedBytes": 77747640,
"domNodes": -273,
"jsHeapTotalBytes": -1880064,
"scriptDurationMs": 36.73700000000001,
"eventListeners": -185,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 666.9280000000413,
"styleRecalcs": 46,
"styleRecalcDurationMs": 10.016,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 482.324,
"heapDeltaBytes": -7709368,
"heapUsedBytes": 64838304,
"domNodes": 18,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 139.34199999999998,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 693.0399999999963,
"styleRecalcs": 46,
"styleRecalcDurationMs": 9.680000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 504.6330000000001,
"heapDeltaBytes": -7576916,
"heapUsedBytes": 65068196,
"domNodes": 18,
"jsHeapTotalBytes": 6815744,
"scriptDurationMs": 133.322,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2030.2449999999794,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.009999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 481.143,
"heapDeltaBytes": -12493684,
"heapUsedBytes": 59924124,
"domNodes": -298,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 6.946000000000001,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2020.962999999938,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.454999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 471.6360000000001,
"heapDeltaBytes": -11808748,
"heapUsedBytes": 60883252,
"domNodes": -299,
"jsHeapTotalBytes": 4186112,
"scriptDurationMs": 7.5169999999999995,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1899.5530000000258,
"styleRecalcs": 77,
"styleRecalcDurationMs": 40.306999999999995,
"layouts": 16,
"layoutDurationMs": 4.781000000000001,
"taskDurationMs": 1149.1070000000002,
"heapDeltaBytes": -7075632,
"heapUsedBytes": 64594344,
"domNodes": -297,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 120.136,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1856.4750000000458,
"styleRecalcs": 76,
"styleRecalcDurationMs": 37.093,
"layouts": 16,
"layoutDurationMs": 4.567,
"taskDurationMs": 1101.325,
"heapDeltaBytes": 6639904,
"heapUsedBytes": 79659532,
"domNodes": -298,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 113.13199999999999,
"eventListeners": -231,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 1383.9689999999791,
"styleRecalcs": 19,
"styleRecalcDurationMs": 31.495999999999995,
"layouts": 14,
"layoutDurationMs": 14.508000000000001,
"taskDurationMs": 927.7489999999999,
"heapDeltaBytes": -9404644,
"heapUsedBytes": 85170004,
"domNodes": 13671,
"jsHeapTotalBytes": 10223616,
"scriptDurationMs": 30.399000000000008,
"eventListeners": 2381,
"totalBlockingTimeMs": 137,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 12206.619000000046,
"styleRecalcs": 244,
"styleRecalcDurationMs": 32.57500000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8516.062,
"heapDeltaBytes": -11797660,
"heapUsedBytes": 67149088,
"domNodes": -273,
"jsHeapTotalBytes": 1527808,
"scriptDurationMs": 2951.633,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 12310.588999999936,
"styleRecalcs": 246,
"styleRecalcDurationMs": 33.125,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8477.108000000002,
"heapDeltaBytes": 15699064,
"heapUsedBytes": 94791116,
"domNodes": -270,
"jsHeapTotalBytes": 2768896,
"scriptDurationMs": 2941.6479999999997,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333338,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 17134.463999999978,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16624.981,
"heapDeltaBytes": -30143116,
"heapUsedBytes": 176457364,
"domNodes": -6548,
"jsHeapTotalBytes": -262144,
"scriptDurationMs": 340.072,
"eventListeners": -7475,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-idle",
"durationMs": 17080.483000000073,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16614.545,
"heapDeltaBytes": -29205096,
"heapUsedBytes": 177295788,
"domNodes": -6548,
"jsHeapTotalBytes": 2387968,
"scriptDurationMs": 314.0040000000001,
"eventListeners": -7471,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 21210.487,
"styleRecalcs": 173,
"styleRecalcDurationMs": 18.307000000000016,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20847.61,
"heapDeltaBytes": -55215908,
"heapUsedBytes": 169923276,
"domNodes": -6548,
"jsHeapTotalBytes": -5267456,
"scriptDurationMs": 944.54,
"eventListeners": -7469,
"totalBlockingTimeMs": 94,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 20977.39899999999,
"styleRecalcs": 168,
"styleRecalcDurationMs": 17.591999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20599.641000000003,
"heapDeltaBytes": -26228836,
"heapUsedBytes": 180484480,
"domNodes": -6548,
"jsHeapTotalBytes": 28672,
"scriptDurationMs": 924.1550000000001,
"eventListeners": -7469,
"totalBlockingTimeMs": 25,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 137.16199999998935,
"styleRecalcs": 9,
"styleRecalcDurationMs": 17.743000000000002,
"layouts": 3,
"layoutDurationMs": 0.8989999999999999,
"taskDurationMs": 113.60700000000001,
"heapDeltaBytes": 3899432,
"heapUsedBytes": 71774016,
"domNodes": 110,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 6.188999999999998,
"eventListeners": 49,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 463.7599999999793,
"styleRecalcs": 15,
"styleRecalcDurationMs": 24.705000000000005,
"layouts": 3,
"layoutDurationMs": 0.7129999999999999,
"taskDurationMs": 128.84099999999998,
"heapDeltaBytes": 5696168,
"heapUsedBytes": 73650204,
"domNodes": 121,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 8.037999999999998,
"eventListeners": 97,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
}
]
} |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughCloud billing actions now use server-resolved capabilities. Non-Cloud actions retain workspace permission checks. Fixtures, composables, UI controls, tests, and browser mocks were updated. ChangesBilling capability authorization
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: 🔵 Low · up to Several Cloud billing entry points will remain hidden while the rollout flag is disabled, including subscribe, reactivate, and Team-to-personal downgrade. The PR is otherwise mergeable, but release owners should enable the flag as part of deployment coordination. Sequence Diagram(s)sequenceDiagram
participant WorkspaceUI
participant useBillingCapabilities
participant BillingAPI
participant SubscriptionAction
WorkspaceUI->>useBillingCapabilities: read capability flags
useBillingCapabilities->>BillingAPI: request workspace capabilities
BillingAPI-->>useBillingCapabilities: return server capabilities
WorkspaceUI->>SubscriptionAction: initiate subscription action
SubscriptionAction->>useBillingCapabilities: validate capability
useBillingCapabilities-->>SubscriptionAction: allow or deny action
Suggested reviewers: 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 explains the migration scope, non-Cloud behavior, review focus, deferred work, rollout dependency, and verification results. It does not use every template heading, but it provides the required information and is sufficiently complete. Full details: End-To-End Regression Coverage For FixesExplanation The changed-file list is available and includes multiple Full details: Adr Compliance For Entity/Litegraph ChangesExplanation The changed-file list contains no files 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 |
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #15675 +/- ##
==========================================
+ Coverage 80.24% 82.60% +2.35%
==========================================
Files 2269 1939 -330
Lines 116521 111659 -4862
Branches 33748 34563 +815
==========================================
- Hits 93505 92237 -1268
+ Misses 22526 19075 -3451
+ Partials 490 347 -143
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 346 files with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
Points every consumer at the capabilities composable and deletes the local derivation it replaces, including the top-up deep-link loader: that file reads canTopUp off WorkspacePermissions, which this change removes, so it cannot typecheck a commit later. The deep-link loader also awaits capability initialization before reading the flags, so an eligible user does not lose the link while both are still false.
55607fa to
b6ca682
Compare
The spec asserts the new capability-driven deep-link behaviour, so it cannot live a PR later than the implementation - this PR would otherwise run main's old spec against the new loader.
b6ca682 to
00d4e45
Compare
…types # Conflicts: # packages/ingest-types/src/index.ts # packages/ingest-types/src/types.gen.ts # packages/ingest-types/src/zod.gen.ts
…s menu The billing-capabilities migration collapsed two Local-only menu paths into their Cloud counterparts and dropped their isCloud guards along the way: - showSubscribeAction lost its `isCloud &&` guard, so the Subscribe / Resubscribe button could render for Local team workspaces. - The Local-only "Plans & Credits" menu item was merged into manage-plan-menu-item, but that button's visibility still requires an active/delinquent subscription, so an unsubscribed Local user lost access to plan/credits settings entirely (and its data-testid changed under it). Restores the pre-migration split (showLocalPlansAndCredits + plans-credits-menu-item, isCloud-gated manage-plan-menu-item) while keeping the new server-resolved canTopUp/canSubscribeSelfServe capabilities for the add/upgrade-credits buttons, which is unaffected by this bug.
…r menu
The migration commit that broke Subscribe/Plan-Credits gating also deleted
the four unit tests that would have caught it, so the regression shipped
silently. Restores equivalent coverage against the new capability source
(useBillingCapabilities is already mocked in this file; nothing here mocks
the removed client-side policy):
- keeps Subscribe hidden on Local after switching to an unsubscribed workspace
- keeps Resubscribe hidden on Local for a cancelled plan
- opens local Plan and Credits instead of Cloud pricing actions
- hides local Plan and Credits without subscription management permission
(paired with a new positive counterpart -- on its own this assertion
passes vacuously against a renamed/merged testid, so it can't stand alone
as a regression guard)
Restoring the tests surfaced a second, previously-unflagged instance of the
same bug class: the "Plans & pricing" menu item had also lost its isCloud
guard (item was Cloud-only, guard silently dropped in the same migration),
and its Local sibling's label string ("Plans and credits") had been deleted
from the locale file. Both are fixed here alongside the guard test restore.
Verified red-then-green: reverted CurrentUserPopoverWorkspace.vue and the
locale key to their pre-fix (migration) state and confirmed exactly the 4
new discriminating tests fail (19 pre-existing tests still pass); restored
the fix and confirmed all 23 pass under --coverage.
The split checked this file out from a branch based on an older main, which reverted 15 keys instead of adding one. nodeBadge.partnerNodesCount was among them, failing badgeSystem's unit tests on a raw i18n key. Rebased onto main's file and re-added only outOfCredits.upgradeBody, the one key this work introduces.
… into wei/be-8716-can-top-up
00d4e45 to
0539574
Compare
…ing-capabilities Union resolution: this branch's remaining capability accessors plus the base's readiness/refresh machinery. showSubscribeAction keeps the base's isCloud gate (subscribing is Cloud-only) with the server-resolved capabilities inside it.
4187a22 to
c26553f
Compare
…he policy (#15967) ### The bug The cancelled-plan **Resubscribe** action was gated on the server-resolved `can_reactivate`. `legacy_stripe` workspaces have no capability projection row, so it resolves `false` for them and the button disappears for customers who should have it. `CurrentUserPopoverWorkspace` was the third and last site with this problem — the follow-up promised on the #15675 review thread, which deliberately left this file out of scope. ### The refactor (added in review) Fixing the third site would have made a third verbatim copy of the same expression, so per review feedback the policy is now centralized instead of duplicated in views. `useWorkspaceUI` — which already owns `permissions` — exposes one derived value: ```ts // legacy_stripe workspaces have no capability projection row, so the // server-resolved can_reactivate is false for them and cannot gate the // action; that rail stays on the membership check. const canReactivatePlan = computed(() => isCloud && shouldUseWorkspaceBilling.value ? canReactivate.value : permissions.value.canManageSubscriptionLifecycle ) ``` `SubscriptionPanelContentWorkspace`, `BillingStatusBanner` and `CurrentUserPopoverWorkspace` all consume it; their local copies and now-unused `useBillingRouting` / `isCloud` imports are gone. So the third site is fixed **and** the pre-existing duplication is removed. No import cycle — neither `useBillingRouting` nor `useBillingCapabilities` imports `useWorkspaceUI`. ### Deliberately not folded in `useWorkspaceMenuItems` has a similar-looking expression for **cancel**, but it carries an extra free-tier guard (`can_cancel` stays true for an active FREE plan). Same shape, different policy — left alone. ### Verification - Policy tests live in `useWorkspaceUI.test.ts` now, where the policy does: consolidated rail (uses the capability), legacy rail, and off-Cloud (both fall back to membership). Verified they actually bite by stubbing the policy out — **2 failed**. - The off-Cloud case is new: `isCloud` is `false` by default under vitest and the composable test wasn't mocking it, so that branch had never been exercised. - Component tests keep their behavioural cases and drive the shared value. - On this head: `pnpm typecheck` clean; **127 passing** across the four affected files; full suite `1317/1318` files green — the only failures are 12 pre-existing `check-binary-size` cases that fail independently of this change. (cherry picked from commit 0c89141)
…#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>
|
|
|
|
… its backend ticket (Comfy-Org#20680) ## Why ADR-API-SERVER-FACTS-0042 (Comfy-Org#20679) says the frontend renders server facts as received. When the UI needs a fact the API doesn't emit yet, agents have so far reached for the nearest field as a proxy, as Comfy-Org#15675 did with `can_change_seats` for member management (BE-19904). That needs a legal interim path, and the path has to expire, or the proxy becomes permanent. ## How - **`pendingServerFact(ticket, value)`** (`src/platform/serverFacts/`) returns `value` unchanged. The ticket type is `` `BE-${number}` ``, so only a backend ticket typechecks. The server-fact lint rules (S2, FE-3351) ignore anything inside this call. - **`pnpm check:pending-server-facts`** collects every call site and asks Linear for each ticket's state. It fails when a ticket is Done or Canceled, when Linear doesn't know the ticket (a typo must not bridge forever), or when the first argument isn't a `'BE-<n>'` literal. Each failure prints the `file:line` that still uses the bridge. - It uses one `issues(filter: { team: BE, number: { in } })` query, because `issue(id:)` nulls the whole aliased response for one unknown ID. - `--offline` checks only that every ticket is a `'BE-<n>'` literal. It never reads `LINEAR_API_KEY` and makes no network call. - The pure parts (`extractTickets`, `expiredTickets`, `preflight`) are unit-tested. - **`.github/workflows/ci-pending-server-facts.yaml`** has two jobs: - `shape` runs on PRs touching source, with no secret, and runs the check with `--offline`. - `expiry` runs daily and on `workflow_dispatch`, checks out the default branch, and gets `LINEAR_API_KEY`. - The PR job never receives the secret; only scheduled/dispatch runs on default-branch code query Linear. - **Admin step needed:** a `LINEAR_API_KEY` repo secret. Without it, `expiry` passes while there are no call sites (main today) and fails closed as soon as one appears. ## AS IS / TO BE There is no UI change. | | AS IS | TO BE | |---|---|---| | Missing server fact | The agent improvises a proxy field | `pendingServerFact('BE-123', expr)` plus a backend ticket | | Ticket closes | The proxy stays forever | CI goes red at the exact `file:line` until the field is rendered | ## Verification - `vitest run scripts/pending-server-facts.test.ts src/platform/serverFacts`: 24 passed. - With no call sites, `--offline`: `No pendingServerFact call sites. Nothing to check.`, exit 0. - With a temporary `pendingServerFact('BE-19904', 1)`: - `--offline`: `1 pendingServerFact ticket(s) are well-formed; expiry is checked by the scheduled job on main.`, exit 0. - Online with no key: names the missing secret, exit 1. BE-19904 is Done, so with the key it would fail as expired. - With a non-literal ticket, `--offline`: needs-a-literal message with `file:line`, exit 1. - `grep LINEAR_API_KEY` on the workflow matches only the `expiry` job. `actionlint` is clean. - Not verified: the success path against live Linear, because no key is available locally. ## Plan position TDD: [Server-fact guardrails](https://app.notion.com/p/3f46d73d36508162ae1be360e6403b5b). Parent: FE-3349. | Item | Ticket | PR | Status | |---|---|---|---| | S1 ADR + AGENTS.md + guidance | FE-3350 | Comfy-Org#20679 | In review | | S2 oxlint rules, diff-scoped gate | FE-3351 | — | In progress | | S3 write hook | FE-3352 | — | Blocked by S2 | | S4 approve hook | FE-3353 | — | Blocked by S2 | | **S5 `pendingServerFact` + expiry CI** | **FE-3354** | **this PR** | **In review** | | S6 orthogonality tests + CODEOWNERS | FE-3355 | — | After Comfy-Org#20674 | | S7 cloud agent instructions | FE-3356 | cloud#12741 | In review | ```mermaid graph LR S1["S1 ADR (PR 20679)"] --> S7["S7 cloud AGENTS.md (cloud PR 12741)"] S2["S2 oxlint rules"] --> S3["S3 write hook"] S2 --> S4["S4 approve hook"] S5["S5 pendingServerFact (this PR)"]:::current S5 -. "exempted by" .-> S2 P20674["PR 20674 member capabilities"] --> S6["S6 orthogonality tests"] classDef current fill:#f9d71c,stroke:Comfy-Org#333,stroke-width:2px ```
…-fact gates (Comfy-Org#20694) ## Why BE-19903 and BE-19904 shipped because members-panel gates recombined a server capability with plan state, seats and role. Comfy-Org#19455 hid the derivation behind a helper and an `if`/`return`, so the lint rules (Comfy-Org#20679) can't see it. The existing tests also didn't catch it: they mocked the capability at the composable, and one asserted the derivation as expected behaviour. ## Root cause No test asserted the property that matters: **a gate's output depends only on its server fact.** Each test pinned one combination of inputs, so a gate that also read `isPlanEnded` passed every test that didn't happen to flip it. ## How - **`describeServerFactGate`** (`src/utils/__tests__/serverFactGate.ts`, about 50 lines). Given a fact setter, a list of non-fact perturbations, `mount` and `read`, it generates `it.for` cases over both fact values and every perturbation: - Each perturbation must leave `read()` unchanged. - Flipping only the fact must change it. - The fact is set after the perturbation, so a perturbation can't override it. - **Applied to the Cloud members-panel gates** in `useMembersPanel.test.ts`: | Gate | Fact | Reads | |---|---|---| | Invite | `can_invite_members` | `showInviteButton`, `isInviteDisabled`, `permissions.canInviteMembers` | | Member management | `can_manage_members` | `canManageMembers`, `canViewPendingInvites`, `uiConfig.showPendingTab`, member menu non-empty | | Roster visibility | members response (`membersLoaded`) | `canViewOtherMembers`, `showMembersList` | Shared perturbations: - plan ended, Enterprise, ended Enterprise with `maxSeats` 1, `maxSeats` 1 - personal plan, cancel scheduled - not a billing manager, member role - `can_change_seats` flipped Each gate also flips the capabilities it must not depend on. Invite flips `can_manage_members`, management flips `can_invite_members`, and roster flips both, so one capability can't stand in for another. - **`CODEOWNERS`**: `/src/platform/workspace/` gets the billing owners. The incident lived there, and it was the only billing-adjacent path without owners. ## AS IS / TO BE There is no UI change. These are test outcomes on the two historical defects, each reintroduced by hand and not committed: | Mutation | AS IS (tests before this PR) | TO BE | |---|---|---| | Comfy-Org#18662 disjunct back on Cloud `showInviteButton` (`canInviteMembers \|\| (isPlanEnded && canManageSubscription)`) | Existing suite still asserted it pre-Comfy-Org#20674 | 4 failures, including "ignores an ended plan when the fact is false" and "ignores an ended Enterprise plan with one seat when the fact is false" | | Comfy-Org#15675 substitution (`canManageMembers` ← `canChangeSeats`) | Not caught by an orthogonality case | 27 failures, including "ignores a flipped can_change_seats" (fact true and false) and "changes when the fact flips" | | After revert | — | 158 passed | ## Verification - `vitest run src/platform/workspace/composables/useMembersPanel.test.ts`: 158 passed. - oxlint `--type-aware` and oxfmt `--check` pass on touched files. The pre-commit hook ran `typecheck:app`. - No existing Cloud test still asserts a derivation (Comfy-Org#20674 already flipped them), so none were rewritten. ## Plan position TDD: [Server-fact guardrails](https://app.notion.com/p/3f46d73d36508162ae1be360e6403b5b). Parent: FE-3349. | Item | Ticket | PR | Status | |---|---|---|---| | S1 ADR + S2 lint gate + S3/S4 hooks (folded) | FE-3350..FE-3353 | Comfy-Org#20679 | In review | | S5 `pendingServerFact` + expiry CI | FE-3354 | Comfy-Org#20680 | Merged (backports Comfy-Org#20692, Comfy-Org#20693) | | **S6 orthogonality tests + CODEOWNERS** | **FE-3355** | **this PR** | **In review** | | S7 cloud agent instructions | FE-3356 | cloud#12741 | Merged | ```mermaid graph LR S1["S1-S4 ADR, lint gate, hooks (PR 20679)"] S5["S5 pendingServerFact (PR 20680, merged)"] -. "exempted by" .-> S1 P20674["PR 20674 member capabilities (merged)"] --> S6["S6 orthogonality tests (this PR)"]:::current S6 -. "covers what lint cannot" .-> S1 S7["S7 cloud AGENTS.md (merged)"] classDef current fill:#f9d71c,stroke:Comfy-Org#333,stroke-width:2px ```
…DR, changed-line lint gate, agent hooks) (Comfy-Org#20679) > **This PR now carries the whole short-term stack.** The approved children were folded into this branch: Comfy-Org#20681 (S2 server-fact oxlint rules + changed-line gate, FE-3351) and Comfy-Org#20682 (S3/S4 write and approve hooks, FE-3352 / FE-3353). Each was reviewed and approved on its own PR. The reviewer-visible diff since the docs-only version is those two PRs plus two ADR wording commits: `83e85827ef` (rule 1 scoped to entitlement; local UI state may only narrow) and `2c6455a3bd` (enforcement described as planned per ticket, per CodeRabbit). ## Why Agents keep writing, and approving, frontend code that recombines server facts (capabilities, role, tier, plan status, seats, timestamps) into decisions the backend owns. The latest case shipped two billing P0s (BE-19903, BE-19904) through Comfy-Org#15675, Comfy-Org#18662 and Comfy-Org#19455. About 20 fixes since April moved a decision back to the server. ## Root cause There is no repo-level rule for this. The one piece of guidance that touches it points the other way: `docs/guidance/state-and-effects.md` says "Derive everything derivable", and its first example is a `can*` flag. A reviewer-side prose rule existed, and Comfy-Org#18662 and Comfy-Org#19455 were approved anyway. ## How - **`docs/adr/API-SERVER-FACTS-0042`** records the rule (R1–R5): a gate renders one server fact as received; `isCloud` picks the build, not the permission; failed reads use contract defaults, never role or tier fallbacks; a missing fact is a backend ticket plus `pendingServerFact`. It also records the rejected alternatives. - **`AGENTS.md`** gets one Common Pitfalls line linking the ADR, so every author's agent reads it. - **`state-and-effects.md` §4** now scopes "derive everything derivable" to state the feature owns, and sends server facts to the API. The `canTransition` example is dropped. Enforcement (lint rules, write and approve hooks, orthogonality tests, the `pendingServerFact` expiry check) follows in the sibling tickets below. This PR is the text those checks link to. ## AS IS / TO BE Docs only. There is no UI change. | | AS IS | TO BE | |---|---|---| | Repo rule | none | ADR + `AGENTS.md` line | | `state-and-effects.md` §4 | "derive everything derivable", `canTransition` example | feature-owned state only; server facts render the API field | ## Plan position TDD: [Server-fact guardrails](https://app.notion.com/p/3f46d73d36508162ae1be360e6403b5b). Parent: FE-3349. | Item | Ticket | PR | Status | |---|---|---|---| | **S1 ADR + AGENTS.md + guidance** | **FE-3350** | **this PR** | **In review** | | S2 oxlint rules, diff-scoped gate | FE-3351 | — | Next | | S3 write hook | FE-3352 | — | Blocked by S2 | | S4 approve hook | FE-3353 | — | Blocked by S2 | | S5 `pendingServerFact` + expiry CI | FE-3354 | — | Needs `LINEAR_API_KEY` secret | | S6 orthogonality tests + CODEOWNERS | FE-3355 | — | After Comfy-Org#20674 | | S7 cloud agent instructions | FE-3356 | — | Blocked by S1 | ```mermaid graph LR S1["S1 ADR (this PR)"]:::current --> S7["S7 cloud AGENTS.md"] S2["S2 oxlint rules"] --> S3["S3 write hook"] S2 --> S4["S4 approve hook"] S5["S5 pendingServerFact"] S6["S6 orthogonality tests"] P20674["PR 20674 member capabilities"] --> S6 classDef current fill:#f9d71c,stroke:Comfy-Org#333,stroke-width:2px ```
…e them (Comfy-Org#22073) ## Why An Enterprise workspace owner could not see or manage members ([FE-3618](https://linear.app/comfyorg/issue/FE-3618)). He was signed in to a Cloud workspace from a non-Cloud bundle, and in that state the Members entry does not exist. ## Root cause `useSettingUI.ts` gated the Workspace section and the Members entry inside it on two different axes: ```ts const shouldShowWorkspacePanel = computed(() => isLoggedIn.value) // login only const workspacePanels = isCloud ? [planPanel, membersPanel] : [planPanel] // build-time constant ``` `isCloud` is `__DISTRIBUTION__ === 'cloud'`, statically replaced at build and unable to change at runtime. So a user signed in to a Cloud workspace from a non-Cloud bundle gets the Workspace section, gets Plan & Credits — their real Cloud billing, which is why the reporter's screenshot shows 41,419 Cloud credits — and never gets Members. That is the code's intended output, not a regression: the same gate is on `main`, `cloud/1.58`, `1.57` (prod) and `1.56`. On 1.57/1.56 it is formatted across lines, which is worth knowing if you grep for it. The server already owns this decision and publishes it as `can_manage_members` in the generated ingest contract, and the panel itself consumes it (`useMembersPanel.ts:134`, `MembersPanelContent.vue:150,195`). Only the nav entry ignored it, so a build-time constant stood in for a server-owned permission and refused a user the server considers a full owner. ## How ```diff -const workspacePanels = isCloud ? [planPanel, membersPanel] : [planPanel] +const canViewMembers = pendingServerFact( + 'BE-24066', + isCloud || canManageMembers.value +) +const workspacePanels = canViewMembers ? [planPanel, membersPanel] : [planPanel] ``` **The expression is wrapped because the fact it needs does not exist.** The server-fact gate rejected the first version of this PR, correctly: ADR-API-SERVER-FACTS-0042 rule 1 says a gate renders one server fact as received, and rule 2 says `isCloud` decides which build ships, not what a user may do. `isCloud || canManageMembers.value` is a derivation — the same pattern that shipped the two billing P0s in the ADR's own context, one of which (Comfy-Org#15675) also lost member management for Enterprise owners. Viewing the roster is not `can_manage_members`: viewing is gated on `membersLoaded`, the capability gates the actions inside the panel, so Cloud non-owners read a roster today while it is false. Substituting it is exactly what rule 4 warns against. So this is rule 4's case — [BE-24066](https://linear.app/comfyorg/issue/BE-24066) asks the owning team which field should answer it, and `pendingServerFact` makes the gap expire: CI fails once that ticket closes, until the shipped field is rendered and this wrapper is deleted. **Additive, not a replacement, and that distinction is the point.** Viewing the roster is gated on `membersLoaded`, not on `can_manage_members` (`useMembersPanel.ts:143`), so Cloud members who are not owners see a read-only list today. Gating the entry on the capability alone would have silently taken that away from every Cloud non-owner — fixing one bug by introducing another. | | before | after | | --- | --- | --- | | Cloud owner | shown | shown | | Cloud non-owner | shown (read-only) | shown (read-only) | | non-Cloud, server permits | **hidden** | **shown** | | non-Cloud, server refuses | hidden | hidden | `canManageMembers` resolves through `receiveServerFact('can_manage_members', … ?? false)`, so it fails closed: if capabilities do not resolve, the entry stays hidden, which is today's behaviour. ## Tests `useSettingUI.test.ts`: `shows Members off Cloud when the server says the actor can manage them`. Mutation-checked — dropping `|| canManageMembers.value` fails it with `expected [ { id: 'workspace' } ] to deeply equal [ …, { id: 'workspace-members' } ]`. The two existing local cases still assert `workspace-members` is null and now mean "local and the server refuses", since the capability auto-mock defaults to false. 21/21 in that file. Repo typecheck (`scripts/vue-tsc-native.ts`) reports zero `src/` errors; oxlint `--type-aware` and oxfmt clean. ## Not verified here, and it gates the Desktop half Whether `workspaceApi.listMembers` actually serves a **Desktop-origin session**. The capability read works there — Plan & Credits proves the same auth and workspace context resolve — but that is inference, not proof, and I could not run a Desktop build. This is the one case where the change could be worse than today: if the capability is true but `listMembers` does not serve that session, the entry appears and the panel degrades to its minimal layout (`membersLoaded` false → `showMinimalMemberLayout`). No crash, but an entry that leads nowhere. **Please confirm on a real Desktop build signed into a Cloud workspace before merging.** If it does not serve, this becomes a product scope decision and FE-3618 should be retitled to "member management is unavailable on Desktop/local" instead. Cloud is unaffected either way — that path is unchanged. Tracks [FE-3645](https://linear.app/comfyorg/issue/FE-3645).
Comfy-Org#22395) ## Why ADR-API-SERVER-FACTS-0042 is still `Proposed`, and its rule 1 is ambiguous in a way that already caused a wrong block. On Comfy-Org#21858, `deployment.status === 'ready'` was blocked as a derived server fact, although the spec defines `ready` as the only status that takes jobs. The PR ended up wrapped in `pendingServerFact('BE-24332', …)`. The cause was the rule's wording, not the code. This PR removes the ambiguity and proposes moving the ADR to `Accepted`. ## Root cause Rule 1 forbids combining a fact "through `&&`, `||`, `??`, a ternary, arithmetic, a comparison or a helper" and adds that a gate "does not choose which fact answers the question". It doesn't say what either clause applies to: - "a comparison" was read as any comparison, including one field compared with the value its own spec defines; - "choose which fact answers" didn't separate a field the API documents as the answer from a proxy (`role === 'owner'`); - narrowing an action the server permits (hide or disable) wasn't covered, so a UX narrowing that contradicted a spec line ("any status may be picked") read as a violation. The lint gate (`comfy/no-server-fact-literals`, `comfy/no-capability-recombination`) does not draw the same line: it keys on field names, not documentation. It flags tier and billing/subscription-status literals even when the spec documents the value, and it can't see a proxy on any other field. The ADR now says so and says the lint wins on conflict. ## How - Rule 1: the forbidden comparison is one between server facts. - New rule 2, "as received means as the API documents it": comparing one field with a value its API documentation defines as the answer is rendering. A field the API doesn't document as the answer is a proxy. An open `string` compared with a documented literal gets an enum request to the backend, not a block. - Rule 2 also says where a documented-value comparison lives: in the fact provider, minted with `receiveServerFact` for that field. A field with no documentation is a proxy. - New rule 3: narrowing an action the server permits follows rule 2 for the narrower question. The documentation exists before merge; a contradicting spec changes first. - Rule 7 (BE review of field choice): documentation counts as the review only when it names the UI question itself. Reading a doc sentence as the answer to a different question still needs the owning team. - New "Classifying a gate" table built from real cases (Comfy-Org#15675, Comfy-Org#18662, Comfy-Org#21858, `canSetDefault`), plus a requirement that the author cites the documentation that makes the field the answer; a reviewer may block on a missing or mismatched citation. - "Enforcement" section: lists what is in place (lint, hooks, `pendingServerFact` expiry, `ServerFact<Field>`) and what is open (orthogonality tests), and states that the lint wins where it is narrower or broader than rule 2. - Renumbering only for the other rules; no rule removed. - `scripts/hooks/server-fact-hook.ts` agent guidance: names arithmetic, and tells an agent blocked on a tier or status literal to ask the backend or change the lint, not to disable it. - Status `Proposed` → `Accepted`. Open to discussion if anyone wants it kept as Proposed. ## AS IS / TO BE Docs and hook-message change only; no UI. | | Text | |---|---| | AS IS | "…through `&&`, `||`, `??`, a ternary, arithmetic, a comparison or a helper. It also does not choose which fact answers the question." | | TO BE | "…a comparison between them, or a helper." plus rule 2: "Comparing one field with a value its API documentation defines as the answer to this question is rendering, not deriving." | ## Checks - `pnpm adr:check` passes - `vitest run scripts/hooks/`: 51/51 pass
Migrates the last five Cloud billing surfaces onto server-resolved capabilities: cancellation, reactivation, plan and seat changes, member invitations, and Team-to-personal downgrade.
Each reads its matching capability behind the
isCloud ? capability : permissionssplit already established in this stack, anduseWorkspaceUIsheds the fields the server now owns.Review fixes applied
can_cancelencodes role, subscription presence/status and a scheduled cancellation, but not tier: it stays true for an active FREE plan. Re-applied!isFreeTieron top of the capability. The other three predicates the migration dropped are encoded server-side, so re-adding them would have been redundant. The backend now owns this too (cloud#7342), making the guard removable as a follow-up.canTopUpis hard-false off Cloud, so the cancel dialog and pricing table had lost their Local/Desktop path. Restored across seven CTA paths, not the four first identified: personal and team each have their own subscribe, reactivate and change-plan branch.client owner permission = true / server capability = falsecase per migrated branch, every one verified to fail under a reverted consumer.!isCloudmenu-item guard had only same-distribution cases.Deferred, with reasons on the thread
SubscribeToRun.vue,usePricingTableUrlLoader, the popover's Plans & pricing entry). None is broken today. Notably the suggestedcanReactivatemapping forSubscribeToRun.vuewould have introduced a bug — that button also renders for never-subscribed and free-tier-exhausted users, who havecan_reactivate = false.canPerformCheckout('change')gating oncan_change_seats. Not the right long-term semantic — every path it guards ends at the subscribe endpoint — but collapsing it tocan_subscribe_self_servemust wait until the rollout flags are on, or it blocks every plan change today.Release dependency
showSubscribeActionandcanPerformCheckout('new')gate oncan_subscribe_self_serve, which the rollout handler forces false on the wire while its flag is off — the current default. Subscribe and reactivate entry points go dark on Cloud unless that flag is enabled first.can_downgrade_to_personalis gated the same way. Both are on the checklist in #15804.Verification
pnpm typecheck,typecheck:browser,lintclean. Full unit suite: 17,758 passed; the 12check-binary-sizefailures are pre-existing and environmental.