Repository navigation
fix(billing): make the Credits panel follow the active billing rail - #15151
Conversation
The Credits panel took its initial activity load and its post-top-up refresh from authStore.lastBalanceUpdateTime, which only the legacy /customers/balance path writes. On the workspace rail nothing ever wrote it, so UsageLogsTable stayed on its initial loading=true and spun forever. Invoice History had the same legacy assumption baked in and opened the /customers portal, which is a different Stripe customer than the workspace being displayed. - UsageLogsTable owns its first load via an immediate watch on the billing route - CreditsPanel refreshes activity off the balance it renders, not the legacy-only timestamp - Invoice History goes through useBillingContext().manageSubscription(), matching SubscriptionFooterLinks
|
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; 3 remain after this review. 📝 WalkthroughWalkthroughThe billing settings use ChangesBilling usage refresh
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized change makes Credits activity and Invoice History follow the active billing rail; no actionable merge-blocking risk remains after normal checks and review. Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (6 passed)
✨ 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 |
🎭 Playwright: ✅ 1977 passed, 0 failed · 3 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle: 9.13 MB gzip 🔴 +34 BDetailsSummary
Category Glance App Entry Points — 3.71 kB (baseline 3.71 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.37 MB (baseline 1.37 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 — 566 kB (baseline 566 kB) • 🟢 -81 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 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 — 125 kB (baseline 125 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 7 added / 7 removed / 1 unchanged UI Components — 67.1 kB (baseline 67.1 kB) • ⚪ 0 BReusable component library chunks
Status: 6 added / 6 removed / 8 unchanged Data & Services — 3.53 MB (baseline 3.53 MB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 14 added / 14 removed / 3 unchanged Utilities & Hooks — 549 kB (baseline 549 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 — 14.2 MB (baseline 14.2 MB) • ⚪ 0 BBundles that do not match a named category
Status: 69 added / 69 removed / 219 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-21T21:41:04.096Z",
"gitSha": "b000a9f5bbce45c3ae15e216bb38b7fe491346dc",
"branch": "dante01yoon/fe-1584-credits-follow-billing-rail",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2022.7570000000128,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.475,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 468.261,
"heapDeltaBytes": -5666500,
"heapUsedBytes": 56006392,
"domNodes": -283,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 6.2189999999999985,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2040.3559999999743,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.977,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 484.06699999999995,
"heapDeltaBytes": 16792588,
"heapUsedBytes": 78139012,
"domNodes": -281,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 6.397,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1946.916999999985,
"styleRecalcs": 77,
"styleRecalcDurationMs": 42.068,
"layouts": 12,
"layoutDurationMs": 3.5500000000000003,
"taskDurationMs": 977.427,
"heapDeltaBytes": -3980556,
"heapUsedBytes": 57634808,
"domNodes": -282,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 115.10400000000001,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1809.0369999999893,
"styleRecalcs": 72,
"styleRecalcDurationMs": 37.333999999999996,
"layouts": 12,
"layoutDurationMs": 3.307,
"taskDurationMs": 814.3620000000001,
"heapDeltaBytes": -1767284,
"heapUsedBytes": 60048384,
"domNodes": -282,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 103.21600000000001,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1708.5990000000493,
"styleRecalcs": 31,
"styleRecalcDurationMs": 14.950999999999999,
"layouts": 6,
"layoutDurationMs": 0.6169999999999999,
"taskDurationMs": 333.80199999999996,
"heapDeltaBytes": 3284212,
"heapUsedBytes": 65510580,
"domNodes": 76,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 8.588000000000001,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1712.242999999944,
"styleRecalcs": 31,
"styleRecalcDurationMs": 15.552000000000001,
"layouts": 6,
"layoutDurationMs": 0.569,
"taskDurationMs": 338.291,
"heapDeltaBytes": 2978572,
"heapUsedBytes": 65419640,
"domNodes": 76,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 8.494,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 556.9610000000011,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.3660000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 345.50499999999994,
"heapDeltaBytes": 10911168,
"heapUsedBytes": 73119680,
"domNodes": 16,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 54.815000000000005,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 563.4840000000167,
"styleRecalcs": 12,
"styleRecalcDurationMs": 7.793000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 349.051,
"heapDeltaBytes": 10618932,
"heapUsedBytes": 73275608,
"domNodes": 20,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 54.529999999999994,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-idle",
"durationMs": 2022.9590000000144,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.689999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 592.674,
"heapDeltaBytes": 13209448,
"heapUsedBytes": 89000444,
"domNodes": -282,
"jsHeapTotalBytes": 4452352,
"scriptDurationMs": 13.270000000000003,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-idle",
"durationMs": 2056.026000000088,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.189999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 588.447,
"heapDeltaBytes": -4350332,
"heapUsedBytes": 72465948,
"domNodes": -279,
"jsHeapTotalBytes": -1839104,
"scriptDurationMs": 13.556999999999997,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-pan",
"durationMs": 2217.802000000006,
"styleRecalcs": 68,
"styleRecalcDurationMs": 13.739999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1199.366,
"heapDeltaBytes": 12003280,
"heapUsedBytes": 88871452,
"domNodes": -283,
"jsHeapTotalBytes": 3891200,
"scriptDurationMs": 341.97700000000003,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2163.1929999999784,
"styleRecalcs": 70,
"styleRecalcDurationMs": 15.450999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1168.698,
"heapDeltaBytes": -8081448,
"heapUsedBytes": 69936368,
"domNodes": -270,
"jsHeapTotalBytes": -303104,
"scriptDurationMs": 329.34000000000003,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-zoom",
"durationMs": 3149.489000000017,
"styleRecalcs": 63,
"styleRecalcDurationMs": 12.609999999999996,
"layouts": 60,
"layoutDurationMs": 7.097000000000001,
"taskDurationMs": 1354.773,
"heapDeltaBytes": -13866388,
"heapUsedBytes": 65028064,
"domNodes": -287,
"jsHeapTotalBytes": 5500928,
"scriptDurationMs": 382.269,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3151.471000000015,
"styleRecalcs": 64,
"styleRecalcDurationMs": 13.749,
"layouts": 60,
"layoutDurationMs": 7.274000000000001,
"taskDurationMs": 1377.7740000000001,
"heapDeltaBytes": -12946320,
"heapUsedBytes": 64863756,
"domNodes": -288,
"jsHeapTotalBytes": 4452352,
"scriptDurationMs": 390.741,
"eventListeners": -183,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 2322.213999999974,
"styleRecalcs": 46,
"styleRecalcDurationMs": 10.056,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1418.436,
"heapDeltaBytes": -20725984,
"heapUsedBytes": 63976488,
"domNodes": -248,
"jsHeapTotalBytes": 8122368,
"scriptDurationMs": 461.64500000000004,
"eventListeners": 33,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 2240.542000000005,
"styleRecalcs": 47,
"styleRecalcDurationMs": 10.252,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1355.1159999999998,
"heapDeltaBytes": -15322312,
"heapUsedBytes": 69794452,
"domNodes": 14,
"jsHeapTotalBytes": 7901184,
"scriptDurationMs": 441.90799999999996,
"eventListeners": 186,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2013.9479999999708,
"styleRecalcs": 7,
"styleRecalcDurationMs": 5.826999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 575.485,
"heapDeltaBytes": -13808220,
"heapUsedBytes": 64755332,
"domNodes": -285,
"jsHeapTotalBytes": 3403776,
"scriptDurationMs": 12.118000000000004,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2043.523999999934,
"styleRecalcs": 8,
"styleRecalcDurationMs": 10.942,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 597.025,
"heapDeltaBytes": -10806144,
"heapUsedBytes": 74002072,
"domNodes": -273,
"jsHeapTotalBytes": 3403776,
"scriptDurationMs": 15.597,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 558.6199999999621,
"styleRecalcs": 44,
"styleRecalcDurationMs": 7.998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 370.11799999999994,
"heapDeltaBytes": 11800552,
"heapUsedBytes": 74347276,
"domNodes": 14,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 113.72399999999999,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 572.7520000000368,
"styleRecalcs": 46,
"styleRecalcDurationMs": 9.284999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 373.255,
"heapDeltaBytes": 11378600,
"heapUsedBytes": 74017624,
"domNodes": 18,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 112.44200000000001,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2021.331000000032,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.642999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 469.50900000000007,
"heapDeltaBytes": 18943508,
"heapUsedBytes": 81740036,
"domNodes": -279,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 5.852999999999999,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2040.3929999999946,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.208,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 467.56600000000003,
"heapDeltaBytes": -4084900,
"heapUsedBytes": 58352140,
"domNodes": -281,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 5.592,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1717.534999999998,
"styleRecalcs": 75,
"styleRecalcDurationMs": 33.406,
"layouts": 16,
"layoutDurationMs": 3.847,
"taskDurationMs": 746.633,
"heapDeltaBytes": 19565436,
"heapUsedBytes": 82074256,
"domNodes": -280,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 80.055,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1718.9120000000457,
"styleRecalcs": 75,
"styleRecalcDurationMs": 34.72599999999999,
"layouts": 16,
"layoutDurationMs": 4.554,
"taskDurationMs": 757.711,
"heapDeltaBytes": 17317756,
"heapUsedBytes": 79820564,
"domNodes": -281,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 81.07499999999999,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 1400.1439999999548,
"styleRecalcs": 19,
"styleRecalcDurationMs": 31.351999999999997,
"layouts": 14,
"layoutDurationMs": 14.433,
"taskDurationMs": 874.3310000000002,
"heapDeltaBytes": -5790228,
"heapUsedBytes": 82494496,
"domNodes": 13673,
"jsHeapTotalBytes": 11534336,
"scriptDurationMs": 15.241000000000005,
"eventListeners": 2373,
"totalBlockingTimeMs": 141,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8211.715000000026,
"styleRecalcs": 250,
"styleRecalcDurationMs": 38.788000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4007.917000000001,
"heapDeltaBytes": 8637308,
"heapUsedBytes": 84953484,
"domNodes": -271,
"jsHeapTotalBytes": -1089536,
"scriptDurationMs": 1024.7450000000001,
"eventListeners": -131,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8177.475000000072,
"styleRecalcs": 250,
"styleRecalcDurationMs": 36.239999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4039.4579999999996,
"heapDeltaBytes": 6473324,
"heapUsedBytes": 83200996,
"domNodes": -239,
"jsHeapTotalBytes": 483328,
"scriptDurationMs": 1021.846,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 16804.40900000002,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16078.057999999999,
"heapDeltaBytes": -39582844,
"heapUsedBytes": 179126888,
"domNodes": -8312,
"jsHeapTotalBytes": -21651456,
"scriptDurationMs": 104.44399999999999,
"eventListeners": -16391,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-idle",
"durationMs": 16902.775999999903,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16105.053999999998,
"heapDeltaBytes": -42557560,
"heapUsedBytes": 177378604,
"domNodes": -8312,
"jsHeapTotalBytes": -11472896,
"scriptDurationMs": 115.39200000000001,
"eventListeners": -16387,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 19903.411000000007,
"styleRecalcs": 160,
"styleRecalcDurationMs": 15.423999999999992,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 19455.894,
"heapDeltaBytes": -22579580,
"heapUsedBytes": 192488512,
"domNodes": -8312,
"jsHeapTotalBytes": -20312064,
"scriptDurationMs": 382.868,
"eventListeners": -16389,
"totalBlockingTimeMs": 102,
"frameDurationMs": 17.77333333333336,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 15409.942000000001,
"styleRecalcs": 83,
"styleRecalcDurationMs": 12.431999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14788.415,
"heapDeltaBytes": -30879188,
"heapUsedBytes": 180950960,
"domNodes": -8312,
"jsHeapTotalBytes": -15622144,
"scriptDurationMs": 385.86400000000003,
"eventListeners": -16393,
"totalBlockingTimeMs": 8,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "workflow-execution",
"durationMs": 473.8190000000486,
"styleRecalcs": 17,
"styleRecalcDurationMs": 20.659,
"layouts": 3,
"layoutDurationMs": 1.3119999999999998,
"taskDurationMs": 111.876,
"heapDeltaBytes": 5197836,
"heapUsedBytes": 67633696,
"domNodes": 148,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 8.835999999999999,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 100.75300000005427,
"styleRecalcs": 6,
"styleRecalcDurationMs": 16.432000000000002,
"layouts": 3,
"layoutDurationMs": 1.3940000000000001,
"taskDurationMs": 77.57300000000002,
"heapDeltaBytes": 2893580,
"heapUsedBytes": 64394488,
"domNodes": 125,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 3.979999999999999,
"eventListeners": 27,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
}
]
} |
🎨 Storybook: 🚧 Building... |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/dialog/content/setting/CreditsPanel.vue`:
- Around line 58-60: Update the balance watcher in
src/components/dialog/content/setting/CreditsPanel.vue:58-60 to call
UsageLogsTable.refresh only when both the previous and next balance values are
present, skipping null-to-object hydration while preserving refreshes for
subsequent updates. In
src/components/dialog/content/setting/CreditsPanel.test.ts:106-114, initialize
balance before rendering, change it afterward to model a top-up, and verify
initial hydration does not call refresh while the later update does.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: c50a1e64-893c-40bf-8b15-05d399f45ece
📒 Files selected for processing (4)
src/components/dialog/content/setting/CreditsPanel.test.tssrc/components/dialog/content/setting/CreditsPanel.vuesrc/components/dialog/content/setting/UsageLogsTable.test.tssrc/components/dialog/content/setting/UsageLogsTable.vue
UsageLogsTable now loads itself, so refreshing again when the balance first resolves fetched activity twice per panel open.
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #15151 +/- ##
==========================================
+ Coverage 79.34% 81.83% +2.48%
==========================================
Files 2217 1887 -330
Lines 112195 107186 -5009
Branches 35562 33451 -2111
==========================================
- Hits 89025 87718 -1307
+ Misses 22690 19121 -3569
+ Partials 480 347 -133
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 344 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…fy-Org#15164) ## Why Local/Desktop users cannot select the workspace that owns their subscription or credits. The existing workspace and billing clients also resolve through `api.apiURL()`, which points at the local ComfyUI server off Cloud, so simply exposing the Cloud switcher leaves workspace hydration dormant and returns 404s. ## Root cause The Cloud-only UI guard hid the switcher, but the deeper boundary was also Cloud-only: - workspace token exchange, workspace listing, and `/billing/*` used same-origin URLs - generic auth helpers mixed Firebase user identity with workspace-scoped identity - Cloud workspace switching reloads the app and changes workflow-persistence namespaces, which is incorrect for Local/Desktop where workspaces are credit wallets only ## Change - Expose the existing workspace switcher in Local/Desktop after Firebase auth hydrates; keep workspace creation Cloud-only. - Route workspace auth, listing, and billing requests to the build's Firebase-paired Cloud gateway (`cloud.comfy.org` in production, `testcloud.comfy.org` in non-production) while Cloud remains same-origin. - Separate Firebase-authenticated `/customers/*` calls from workspace-authenticated billing and partner-node execution. - Switch the active local credit context without reloading or moving local workflow persistence; persist the selected wallet per device. - Keep Add credits permission-aware and return completed/pending top-ups to Settings → Credits on Local/Desktop. ### Implementation scope and rationale | Area | Change | Why it is required | | --- | --- | --- | | Workspace API routing | Resolve workspace and billing requests through the Firebase-paired Cloud gateway outside the Cloud distribution. | Local `/api` targets the local ComfyUI server, while workspace and billing state is owned by Cloud ingest. | | Authentication boundary | Separate Firebase user authentication from workspace-scoped authentication, including partner-node queue execution. | A Firebase token identifies the user; the workspace token deterministically identifies the wallet that owns credits and receives usage charges. | | Workspace bootstrap | Share and await the in-flight Local workspace initialization, and fail closed when no active workspace can be established. | Prompt submission during bootstrap must not run without credentials or silently fall back to the personal workspace. | | Local switch lifecycle | Switch the active credit workspace without reloading the document. | Cloud reload semantics are unnecessary for Local and would interrupt the current local workflow. | | Workflow persistence | Keep Local workflow storage in the personal namespace when the credit workspace changes. | Local workspace selection changes the billing wallet only; it must not move, clear, or split locally stored workflows. | | Billing routing | Use workspace billing after Local workspace hydration. | Balances, plans, billing events, and top-ups must follow the selected credit workspace rather than the personal account. | | Billing permissions | Keep Credits visible while hiding Add credits for members who cannot top up. | Backend top-up operations are owner-only, so the UI must not offer an action the selected workspace role cannot perform. | | Top-up completion | Return completed or pending Local top-ups to Settings → Credits. | Local does not expose the Cloud workspace-management destination used by the existing Cloud flow. | | Cloud customer endpoints | Explicitly retain Firebase authentication for user-scoped customer and subscription calls. | Changing generic auth precedence must not send a workspace token to endpoints whose contract is user-scoped. | | Feature-flag isolation | Disable `unified_cloud_auth` outside the Cloud distribution. | Unified Cloud JWT minting is not available in Local/Desktop; accepting that flag there would break workspace discovery and execution authentication. | | Regression coverage | Add focused unit tests and a Local Playwright workspace-switching flow. | The tests protect workspace attribution, Cloud-gateway routing, no-reload switching, workflow retention, permissions, and bootstrap race handling. | Backend dependency: [cloud#6635](Comfy-Org/cloud#6635) is required and merged. Its Local/Desktop CORS scope covers `POST /api/auth/token`, `GET /api/workspaces`, and `GET`/`POST /api/billing/*`; Local keeps workspace creation hidden. The backend PR is merged into `main`, and its production manifest contains the loopback origins. A live preflight currently passes on `testcloud.comfy.org`, while `cloud.comfy.org` still omits `Access-Control-Allow-Origin` for loopback origins. No additional backend code change is currently identified; the remaining release check is to confirm the merged configuration has rolled out to the production runtime and repeat the preflight. [Comfy-Org#15151](Comfy-Org#15151) independently fixes the existing Settings → Credits activity spinner and billing-portal rail. ## Plan / QA 1. Review the auth and persistence boundaries in this PR. 2. Land Comfy-Org#15151 so activity and Invoice History follow the selected billing rail. 3. Confirm the merged cloud#6635 configuration has rolled out to the production runtime and repeat the live preflight. 4. Verify on a Desktop build against the deployed gateway: switch/relaunch, popover and Settings balances, top-up attribution, partner-node debit and allowlist, member permissions, and zero-credit local runs. Regression audit added a focused Local Playwright flow. It caught and fixed two release blockers: Local rendered the legacy profile popover even after workspace hydration, and `unified_cloud_auth=true` incorrectly selected an unavailable Cloud JWT outside the Cloud distribution. The E2E verifies workspace/role rendering, workspace token exchange, Cloud-gateway billing routing, and that switching neither reloads the document nor loses the open workflow tab. A second auth/accounting audit found two queue-time races: a prompt could be submitted without a workspace token while Local workspace bootstrap was in flight, or fall back to the personal Firebase identity after bootstrap failed. Queue authentication now shares and awaits the in-flight workspace initialization and fails closed if no active workspace can be established. Identity-generation guards prevent a previous user's initialization from overwriting the next user's state. Design of record: [MVP before/after](https://www.figma.com/design/CkFTD4c20PyRGpNVAJgpfV/Team-Plan---Workspaces?node-id=5874-73181) · [popover and switcher](https://www.figma.com/design/CkFTD4c20PyRGpNVAJgpfV/Team-Plan---Workspaces?node-id=5874-72771) The implementation references those prototype states: the profile popover gains the workspace row, the selector opens to the left, and the selected workspace is highlighted with a check while roles remain visible. Local-specific adaptations are the compact single-line trigger and the retained Credits entry, because this scope adds wallet switching without exposing Cloud workspace management. | AS IS — Local profile menu | TO BE — Local workspace selector | | --- | --- | |  |  | Captured from the actual Local frontend at 1920×1200 with deterministic auth/workspace/billing API fixtures; no Figma image is substituted for the implementation capture. ## Validation - Focused Local workspace Playwright E2E: 1/1 passed on Chromium before the final auth-race patch; final local rerun was blocked during fixture setup because the 8188 ComfyUI test backend was unavailable, before any product assertion ran - Final focused workspace/auth/queue unit suites: 316/316 passed when run in their stable focused groups - Earlier affected unit/component suites: 650/650 passed before rebase; 594/594 passed after rebase - `pnpm typecheck` - targeted ESLint and oxfmt checks - `pnpm knip` reports only existing repository-wide unused dependency/export findings - Real-app screenshot Playwright run: 2/2 passed (AS IS without a workspace roster; TO BE with the selector open) - Live CORS preflight: staging passes; production runtime rollout/sync verification remains the release blocker Linear: [FE-1584](https://linear.app/comfyorg/issue/FE-1584/add-workspace-switcher-to-localdesktop-credits-only-no-settings) --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: comfydesigner <alextov@comfy.org>
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
@dante01yoon Successfully backported to #15598 |
|
@dante01yoon Successfully backported to #15599 |
Illustrative refactor for an architecture discussion, per docs/guidance/state-and-effects.md. Rebased onto main now that #15151 has merged (as 7494f71) and FE-1609 (#15239) added an `embedded` prop to CreditsPanel in the meantime. - UsageLogsTable owned pagination as a mutable {page, limit, total, totalPages} ref written from three places (a click handler, refresh(), and the server response echo), plus a hand-rolled loadToken race guard duplicated per-component. - CreditsPanel, and separately PlanCreditsPanelContent, each drove a reload by reaching into UsageLogsTable via a template ref and calling an exposed refresh() method. usePaginatedQuery now owns page/limit/total/first as computed values derived from the last response (one source of truth, not several fields kept in sync by hand), bakes the request-token guard in once, and resets/refetches through a single reactive `key`. UsageLogsTable loads itself on mount (no external refresh() needed); CreditsPanel passes a plain `refetchKey` prop instead of imperatively calling into the child, and PlanCreditsPanelContent's now-redundant refresh-on-mount is removed. Behavior is unchanged: same initial load, same refresh triggers, same error messages.
## Summary Fixes QA finding #4 after #15151: the Local profile popover now shows the Local-specific **Plans and credits** action instead of Cloud-only billing actions. ## Regression origin The regression was introduced by [#15164](#15164) (`848cd39ed06a2da6fea389305cf7210a0a18c5ee`), not #15151. Before #15164, Local rendered `CurrentUserPopoverLegacy`; #15164 changed `CurrentUserButton` to render `CurrentUserPopoverWorkspace` in Local after workspace initialization. That shared popover already contained **Plans & pricing** and **Manage plan** rows whose visibility depended only on workspace permissions and subscription state, with no distribution boundary. Consequently, switching Local to that popover also exposed its Cloud-only billing navigation. [#15151](#15151) independently fixed loading and billing-rail behavior inside Settings → Credits; it did not introduce the profile-menu regression. ## Changes - **Root cause**: `CurrentUserPopoverWorkspace` selected billing rows only from workspace permissions and subscription state, so Local reused Cloud's **Plans & pricing** and **Manage plan** rows once workspace initialization completed. - **What**: Gate those existing rows to Cloud, and render the [Local Figma design](https://www.figma.com/design/CkFTD4c20PyRGpNVAJgpfV/Profile-Menu-Updates?node-id=6322-39073) action that opens Local Plan & Credits settings. - **Regression coverage**: Added distribution-specific component coverage and updated the Local credits browser flow to enter settings through the new action. Cloud behavior remains unchanged. ## Review Focus Confirm the distribution boundary: Cloud keeps **Plans & pricing** / **Manage plan**; Local gets one **Plans and credits** action opening `Settings > Credits`. ## Validation - `pnpm exec vitest run src/platform/workspace/components/CurrentUserPopoverWorkspace.test.ts` - related popover, user-button, and settings regression suites (70/70) - `pnpm typecheck` - `pnpm typecheck:browser` - targeted ESLint and formatting checks - `pnpm locale:check` - Local Playwright regression flow (Chromium) - Local and Cloud production builds - pre-push `pnpm knip` ## Screenshots | AS IS | TO BE | | --- | --- | | Local incorrectly exposes Cloud billing actions | Local shows the Figma-defined Plan & Credits action | |  |  | --------- Co-authored-by: Amp <amp@ampcode.com>
Summary
Settings → Credits still assumed the legacy
/customersrail, so its activity table never loaded when the balance came from anywhere else, and Invoice History opened the wrong Stripe customer.Changes
UsageLogsTableowns its first load (immediatewatch on the billing route). It previously started atloading = trueand waited for a parentrefresh(), whichCreditsPanelonly fired fromauthStore.lastBalanceUpdateTime— written solely by the legacy/customers/balancesuccess path (authStore.ts:374). Any path that does not write it leaves the spinner up forever.CreditsPanelrefreshes activity off the balance it renders instead of that legacy-only timestamp, so a top-up refreshes the table on both rails. First hydration is skipped, since the table now loads itself.useBillingContext().manageSubscription(), matchingSubscriptionFooterLinks. The legacy/customersportal bills a different Stripe customer than the workspace on screen.Review Focus
Two independent ways to reach the stuck spinner on
main:authStore.fetchBalance()returns early on a404from/customers/balance(authStore.ts:355-358), solastBalanceUpdateTimeis never written. A user with no customer record yet gets a Credits tab that spins forever.billing_control_enabledoff the standalone Credits panel stays in the sidebar (useSettingUI.ts:325) whileuseWorkspaceBilling.fetchBalance()supplies the balance from/billing/balanceand never touches the timestamp. This also becomes the default failure once the workspace switcher is exposed on Local/Desktop (feat(workspace): expose workspace switcher on desktop/local for credit selection #15051).Other notes:
AutoRefreshWrapperis gone from theUsageLogsTabletests; the component no longer needs a parent to drive its first fetch. Reverting theimmediateflag alone fails 19 of the 21 tests.manageSubscription()also starts the cancellation watcher, which the rawaccessBillingPortal()call did not.SubscriptionFooterLinksalready accepts that for the same action, andbrowser_tests/tests/localCreditsNoSubscribeUi.spec.ts(which asserts Invoice History issuesPOST /customers/billing) still passes.Screenshots
Captured from the same local dev-server setup and viewport with a fully mocked Personal workspace on the workspace billing rail.
billing_control_enabledis off so the standalone Settings → Credits panel is visible. AS-IS uses base085c6ec51; TO-BE uses this PR's heade9fcd6adc./api/billing/eventson mount.Linear: FE-1584
Prototype this supports: #15051