Repository navigation
FE-2218 feat(billing-web): own-origin session, sign-in and the billing SDK composition - #17807
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
🌐 Website E2ETip All tests passed.
🎭 Playwright: ✅ 2014 passed, 0 failed · 3 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-09-16T12:04:22.622Z",
"gitSha": "d4de241a29b3f6a7baac1ca594af52d4ae05eda4",
"branch": "jaewon/fe-2218-billing-web-session",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2035.5200000000195,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.947000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 576.4209999999999,
"heapDeltaBytes": 2769984,
"heapUsedBytes": 65198824,
"domNodes": -263,
"jsHeapTotalBytes": 4186112,
"scriptDurationMs": 11.838000000000001,
"eventListeners": -154,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 1996.403999999984,
"styleRecalcs": 7,
"styleRecalcDurationMs": 7.078999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 508.6090000000001,
"heapDeltaBytes": 6727552,
"heapUsedBytes": 68257044,
"domNodes": -268,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 10.720999999999998,
"eventListeners": -154,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1981.4350000000331,
"styleRecalcs": 77,
"styleRecalcDurationMs": 37.105,
"layouts": 14,
"layoutDurationMs": 5.243,
"taskDurationMs": 975.1519999999999,
"heapDeltaBytes": 10321128,
"heapUsedBytes": 71235532,
"domNodes": -265,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 173.41400000000002,
"eventListeners": -156,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1916.0389999999552,
"styleRecalcs": 78,
"styleRecalcDurationMs": 36.412,
"layouts": 14,
"layoutDurationMs": 5.112,
"taskDurationMs": 896.647,
"heapDeltaBytes": -4596340,
"heapUsedBytes": 58106228,
"domNodes": -262,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 158.84599999999998,
"eventListeners": -186,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1738.3030000000304,
"styleRecalcs": 31,
"styleRecalcDurationMs": 18.334,
"layouts": 6,
"layoutDurationMs": 1.4460000000000002,
"taskDurationMs": 355.80999999999995,
"heapDeltaBytes": 2187952,
"heapUsedBytes": 64625016,
"domNodes": 75,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 13.072000000000005,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1738.8260000000173,
"styleRecalcs": 32,
"styleRecalcDurationMs": 14.86,
"layouts": 6,
"layoutDurationMs": 1.1630000000000003,
"taskDurationMs": 333.45000000000005,
"heapDeltaBytes": 2164256,
"heapUsedBytes": 64443272,
"domNodes": 76,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 11.459,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 678.8070000000062,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.758999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 440.355,
"heapDeltaBytes": 17092756,
"heapUsedBytes": 78340032,
"domNodes": 18,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 158.125,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 662.1350000000348,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.593999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 444.8139999999999,
"heapDeltaBytes": 17863692,
"heapUsedBytes": 80417280,
"domNodes": 16,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 158.143,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2023.2659999999782,
"styleRecalcs": 4,
"styleRecalcDurationMs": 3.653,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 657.633,
"heapDeltaBytes": 3628904,
"heapUsedBytes": 83401228,
"domNodes": -250,
"jsHeapTotalBytes": -794624,
"scriptDurationMs": 42.54999999999999,
"eventListeners": -184,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-idle",
"durationMs": 2024.5160000000624,
"styleRecalcs": 5,
"styleRecalcDurationMs": 4.262000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 590.8729999999998,
"heapDeltaBytes": 3550168,
"heapUsedBytes": 83734560,
"domNodes": -247,
"jsHeapTotalBytes": -1318912,
"scriptDurationMs": 33.51899999999999,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2218.0779999999913,
"styleRecalcs": 68,
"styleRecalcDurationMs": 15.044999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1574.436,
"heapDeltaBytes": -13752208,
"heapUsedBytes": 65592224,
"domNodes": -259,
"jsHeapTotalBytes": 2875392,
"scriptDurationMs": 833.386,
"eventListeners": -182,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2174.54500000008,
"styleRecalcs": 65,
"styleRecalcDurationMs": 11.169000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1600.762,
"heapDeltaBytes": 13800264,
"heapUsedBytes": 78490304,
"domNodes": -253,
"jsHeapTotalBytes": 1273856,
"scriptDurationMs": 796.999,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3618.069999999989,
"styleRecalcs": 62,
"styleRecalcDurationMs": 13.403000000000002,
"layouts": 60,
"layoutDurationMs": 15.265,
"taskDurationMs": 1750.3000000000002,
"heapDeltaBytes": 9856936,
"heapUsedBytes": 75148860,
"domNodes": -256,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 802.609,
"eventListeners": 10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3555.1900000000387,
"styleRecalcs": 60,
"styleRecalcDurationMs": 11.079999999999997,
"layouts": 60,
"layoutDurationMs": 14.668999999999999,
"taskDurationMs": 1694.7210000000002,
"heapDeltaBytes": 8066452,
"heapUsedBytes": 74281044,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 785.78,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3197.575000000029,
"styleRecalcs": 43,
"styleRecalcDurationMs": 8.157000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2055.385,
"heapDeltaBytes": -4384500,
"heapUsedBytes": 78206792,
"domNodes": -267,
"jsHeapTotalBytes": 6438912,
"scriptDurationMs": 1017.372,
"eventListeners": -187,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "legacy-node-drag",
"durationMs": 3074.2910000000165,
"styleRecalcs": 40,
"styleRecalcDurationMs": 5.337999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1930.687,
"heapDeltaBytes": 20804932,
"heapUsedBytes": 87473844,
"domNodes": 0,
"jsHeapTotalBytes": 942080,
"scriptDurationMs": 975.4390000000001,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2037.112000000036,
"styleRecalcs": 5,
"styleRecalcDurationMs": 5.150000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 614.6709999999999,
"heapDeltaBytes": -3477992,
"heapUsedBytes": 83884644,
"domNodes": -248,
"jsHeapTotalBytes": -1019904,
"scriptDurationMs": 34.163,
"eventListeners": -154,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2043.933999999922,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.915000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 606.24,
"heapDeltaBytes": -3240112,
"heapUsedBytes": 77585684,
"domNodes": -261,
"jsHeapTotalBytes": 253952,
"scriptDurationMs": 33.93,
"eventListeners": -184,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 604.5750000000112,
"styleRecalcs": 47,
"styleRecalcDurationMs": 10.775,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 418.91599999999994,
"heapDeltaBytes": 13556344,
"heapUsedBytes": 77169656,
"domNodes": 20,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 146.749,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 620.60299999996,
"styleRecalcs": 47,
"styleRecalcDurationMs": 11.433,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 419.5460000000001,
"heapDeltaBytes": 13205016,
"heapUsedBytes": 76889360,
"domNodes": 20,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 146.57500000000002,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2003.1810000000405,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.636,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 528.946,
"heapDeltaBytes": 1281416,
"heapUsedBytes": 64944452,
"domNodes": -275,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 10.719,
"eventListeners": -230,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 1999.9919999999065,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.716000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 464.23600000000005,
"heapDeltaBytes": 9695520,
"heapUsedBytes": 73320536,
"domNodes": -276,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 8.266000000000002,
"eventListeners": -200,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1730.1009999999906,
"styleRecalcs": 76,
"styleRecalcDurationMs": 30.075,
"layouts": 18,
"layoutDurationMs": 6.308,
"taskDurationMs": 832.875,
"heapDeltaBytes": 7991784,
"heapUsedBytes": 71506588,
"domNodes": -280,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 116.513,
"eventListeners": -202,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1704.1869999999335,
"styleRecalcs": 78,
"styleRecalcDurationMs": 28.599,
"layouts": 18,
"layoutDurationMs": 5.502999999999999,
"taskDurationMs": 770.0559999999999,
"heapDeltaBytes": -3040648,
"heapUsedBytes": 60715932,
"domNodes": -272,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 104.755,
"eventListeners": -232,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-transition-enter",
"durationMs": 1403.825999999981,
"styleRecalcs": 18,
"styleRecalcDurationMs": 28.519000000000002,
"layouts": 5,
"layoutDurationMs": 12.157000000000002,
"taskDurationMs": 981.1189999999998,
"heapDeltaBytes": 19318908,
"heapUsedBytes": 100616136,
"domNodes": 13587,
"jsHeapTotalBytes": 11272192,
"scriptDurationMs": 32.022999999999996,
"eventListeners": 2387,
"totalBlockingTimeMs": 132,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8413.825000000032,
"styleRecalcs": 247,
"styleRecalcDurationMs": 43.035000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5980.9400000000005,
"heapDeltaBytes": -3612236,
"heapUsedBytes": 75926688,
"domNodes": -248,
"jsHeapTotalBytes": -602112,
"scriptDurationMs": 2739.4449999999997,
"eventListeners": -138,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8350.889999999936,
"styleRecalcs": 246,
"styleRecalcDurationMs": 38.378,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5679.145,
"heapDeltaBytes": -4301336,
"heapUsedBytes": 75766084,
"domNodes": -250,
"jsHeapTotalBytes": 479232,
"scriptDurationMs": 2636.7180000000003,
"eventListeners": -138,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 17791.171999999962,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17517.465,
"heapDeltaBytes": -15057816,
"heapUsedBytes": 187044068,
"domNodes": -6542,
"jsHeapTotalBytes": 2826240,
"scriptDurationMs": 306.638,
"eventListeners": -7478,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 17729.799999999956,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17448.197,
"heapDeltaBytes": -30934536,
"heapUsedBytes": 159679864,
"domNodes": -6542,
"jsHeapTotalBytes": 413696,
"scriptDurationMs": 312.718,
"eventListeners": -7480,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.333333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 21915.999,
"styleRecalcs": 157,
"styleRecalcDurationMs": 22.437000000000012,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21790.587000000003,
"heapDeltaBytes": -38510496,
"heapUsedBytes": 176088588,
"domNodes": -6542,
"jsHeapTotalBytes": 2056192,
"scriptDurationMs": 907.752,
"eventListeners": -7470,
"totalBlockingTimeMs": 54,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 21789.817000000083,
"styleRecalcs": 156,
"styleRecalcDurationMs": 21.774000000000015,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21667.579,
"heapDeltaBytes": -16034756,
"heapUsedBytes": 186157724,
"domNodes": -6542,
"jsHeapTotalBytes": -536576,
"scriptDurationMs": 876.129,
"eventListeners": -7474,
"totalBlockingTimeMs": 71,
"frameDurationMs": 18.330000000000048,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 6598.563000000013,
"styleRecalcs": 20,
"styleRecalcDurationMs": 79.36399999999999,
"layouts": 20,
"layoutDurationMs": 29.448,
"taskDurationMs": 6571.754999999999,
"heapDeltaBytes": -43688132,
"heapUsedBytes": 175055612,
"domNodes": -6542,
"jsHeapTotalBytes": 8814592,
"scriptDurationMs": 131.466,
"eventListeners": -7473,
"totalBlockingTimeMs": 442,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 6493.65499999999,
"styleRecalcs": 20,
"styleRecalcDurationMs": 73.83599999999998,
"layouts": 20,
"layoutDurationMs": 25.414999999999992,
"taskDurationMs": 6454.5689999999995,
"heapDeltaBytes": -22217832,
"heapUsedBytes": 173406512,
"domNodes": -6542,
"jsHeapTotalBytes": 19341312,
"scriptDurationMs": 120.593,
"eventListeners": -7476,
"totalBlockingTimeMs": 372,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-zoom-out-idle",
"durationMs": 9032.746999999972,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8925.174,
"heapDeltaBytes": 3108640,
"heapUsedBytes": 190989440,
"domNodes": 0,
"jsHeapTotalBytes": -6815744,
"scriptDurationMs": 144.39800000000002,
"eventListeners": -12,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-zoom-out-idle",
"durationMs": 6888.302000000067,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6753.026999999997,
"heapDeltaBytes": 26022156,
"heapUsedBytes": 185765176,
"domNodes": 0,
"jsHeapTotalBytes": 8126464,
"scriptDurationMs": 115.38800000000005,
"eventListeners": -10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 124.9000000000251,
"styleRecalcs": 8,
"styleRecalcDurationMs": 20.017,
"layouts": 4,
"layoutDurationMs": 2.1639999999999997,
"taskDurationMs": 102.66200000000003,
"heapDeltaBytes": 3147404,
"heapUsedBytes": 65201048,
"domNodes": 131,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 9.174000000000001,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 106.6040000000612,
"styleRecalcs": 7,
"styleRecalcDurationMs": 17.604000000000003,
"layouts": 6,
"layoutDurationMs": 2.5709999999999997,
"taskDurationMs": 84.726,
"heapDeltaBytes": 3009788,
"heapUsedBytes": 64906688,
"domNodes": 126,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 6.1930000000000005,
"eventListeners": 17,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## jaewon/fe-2331-account-ui-hosted-composables #17807 +/- ##
================================================================================
+ Coverage 82.54% 82.55% +0.01%
================================================================================
Files 2841 2844 +3
Lines 141762 141865 +103
Branches 38035 36215 -1820
================================================================================
+ Hits 117012 117113 +101
- Misses 23544 23545 +1
- Partials 1206 1207 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 9 files with indirect coverage changes 🚀 New features to boost your workflow:
|
CodeJuggernaut
left a comment
There was a problem hiding this comment.
The guard and return path fail closed, the credential cache is tab-scoped and uid-guarded, the client is built and disposed once per scope, and both fetches behind it are bearer-authenticated at the fetch default credentials mode. Nothing blocking.
…nd payment-method surfaces (#17809) Linear FE-2331 / FE-2218. Stacked on #17807 (session); carries a cherry-pick of #17795 (billing-contract). ## Why `billing.comfy.org` currently serves one static page: a hard-coded checkout mockup at `/`. Nothing reads the entry URL a product hands it, and nothing renders over the billing SDK. This PR gives the hosted app its `/v1` entry routing plus the first two surfaces that project real SDK state — the subscription catalog with a plan-change quote, and saved payment methods with the provider portal round trip. The entry URL is untrusted routing input. `parseBillingEntry` decides whether it describes a request the contract knows, and a failed parse renders a coded explanation rather than a redirect, so a misdirected link stays visible instead of silently landing the customer somewhere else. ## How - `router.ts` generates a route per `BILLING_INTENTS` entry — `subscription` and `pricing` to `SubscriptionView`, `payment-methods` to `PaymentMethodsView`, `checkout` to the existing `BillingHomeView` (unchanged), `invoices` and `result` to `ComingSoonView`. `/` keeps the scaffold checkout page and stays outside the contract. - A `beforeEach` parses `to.fullPath` and publishes the result into a tab-local module ref (`useBillingEntry`); `App.vue` renders the entry-error surface whenever that parse failed, whatever route matched. No navigation happens on an error. - The entry is read before the session guard from #17807 runs, so a link we cannot read explains itself even to a visitor the guard sends to `/sign-in`: signing in would not repair it. `/` and `/sign-in` carry no product request and leave the entry alone. - `HostedSurface.vue` is the shared shell: the dark full-screen layout, the surface title, the `Return to <product>` link built with `buildReturnUrl` against the resolved `BILLING_WEB_ENV` (default and fail-closed value `test`), and the choice between the entry-error section and the surface itself. Views stay pure projections of composable state, and a surface only ever renders behind the guard and the shell, which always provide a client. - `SubscriptionPanel` reads `usePlans()`, renders each plan as a card (tier + duration, price, monthly credits, seats), disables an unavailable plan with its availability reason as our own copy, and on selection calls `usePreviewSubscribe().quote({ planSlug })` and renders the quote. Confirm is present and disabled behind the scaffold's existing `checkout.sdkPending` line. - `PaymentMethodsPanel` reads `usePaymentMethods()`, marks the default card, and opens the provider portal through `commands.openPaymentPortal` with this page's own href plus a `portal=return` marker. On the way back it invalidates and re-reads once, then strips the marker with `router.replace`. - Every server-chosen value reaches the screen as a coded lookup with a generic fallback: availability reasons, transition types, billing failure codes, entry error codes, saved payment method types. The card brand and its last four digits are the one server-supplied pair the UI interpolates; no other server text is rendered. - `bigint` money fields convert with `Number()` only at the `n()`/`d()` formatting boundary. ## AS-IS / TO-BE AS-IS: a `/v1/subscription` link has no surface of its own — the catch-all redirects it to `/`, the scaffold's static checkout mockup, and the product's entry parameters are dropped on the way. TO-BE: `/v1/subscription` renders the catalog with the current plan marked and an unavailable plan explained, selecting a plan adds the server's plan-change quote with an inert confirm, `/v1/payment-methods` lists saved cards with the default marked beside the provider-portal button, and a link the contract cannot read gets a coded explanation instead of a redirect. | AS-IS | TO-BE | | --- | --- | | `/v1/subscription?product=comfyui&return_to=comfyui_workspace` redirects to the static checkout page<br><img width="420" src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/asis-v1-subscription.png"> | The same link renders the subscription surface<br><img width="420" src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/tobe-subscription.png"> | | TO-BE — plan-change quote after selecting Pro · Monthly<br><img width="420" src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/tobe-subscription-quote.png"> | TO-BE — `/v1/payment-methods` with the default card marked<br><img width="420" src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/tobe-payment-methods.png"> | | — | TO-BE — a link the contract cannot read (`/v1/subscription?product=nope`)<br><img width="420" src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/tobe-entry-error.png"> | ## Testing `apps/billing-web` unit tests (`@testing-library/vue`, happy-dom): the app suite is 85 passing, 44 of them in the four files this PR touches: - `router.test.ts` — each intent opens its surface, the parsed entry is published, every entry-error code renders its own copy (including on the checkout route, proving the error surface wins over the matched route), an unrecognised path stays where it is, and `/` remains outside the contract. The guard rows from #17807 join the same file: a signed-out visitor is sent to `/sign-in` with the surface to come back to, and an unreadable link keeps its error through that redirect. - `SubscriptionView.test.ts` — current plan named, catalog priced, an unavailable plan disabled with its reason, selecting a plan calls `previewSubscribe` with `{ planSlug }` and renders the formatted quote with confirm disabled, a refused quote and a failed catalog read both render coded copy. - `PaymentMethodsView.test.ts` — cards listed with the default marked, the portal button navigates to the returned URL, and `portal=return` triggers exactly one invalidate plus one read before the marker is stripped. - `HostedSurface.test.ts` — the arriving intent's content renders, return link href from `buildReturnUrl`, no link when the entry named no destination. Gates: `pnpm typecheck`, `pnpm lint`, `pnpm format`, `pnpm knip`, `pnpm --filter @comfyorg/billing-web build`, `fallow audit` all pass. ## Not in this PR - Subscribing through the SDK — the confirm button is deliberately inert. - Invoices, which wait on the backend. - Putting `apps/billing-web` unit tests in the CI loop: `ci-tests-unit.yaml` runs `packages/*` only, so this suite runs locally but not on a PR. Follow-up. ## Where this sits in the plan Billing SDK track FE-2210 ([implementation plan V2](https://app.notion.com/p/3d86d73d36508152b92cdbdfdfe83ac8)). Hybrid model: top-up in-app, subscription management / invoices / payment methods on the hosted billing app. | Phase | Item | Ticket | Status | | --- | --- | --- | --- | | 1-2 | Session core, transport, readers | FE-2211/2212/2213 | merged | | 3 | Operation lifecycle, commands, eight-state projection | FE-2227/2214/2223 | merged (#17655) | | 4 | `@comfyorg/account-ui` composables + `CheckoutSteps` | FE-2215 | merged (#17662, #17663) | | 5 slice 1 | Top-up through the SDK behind `billing_sdk_topup_enabled` | FE-2216 | merged (#17665) | | rollout C | `hosted_billing_destination` server flag read by the host | FE-2218 | merged (#17716) | | rollout C | `hostedDestination` port on the lifecycle, value on operation state | FE-2210/2218 | open (#17783) | | 7 prep | Scope-source port + credentialed transport (BFF / cookie hosts) | FE-2218 | open (#17782) | | 7 prep | `@comfyorg/account` → `@comfyorg/account-core` rename | FE-2218 | local, opens after #17782 and #17783 | | 7 prep | `billing-contract` route builder + `return_to` registry | FE-2218 | open (#17795) | | 3A-3 | Workshop adapter over `createHostedTopupCheckout` | FE-2214 | open (#17793) | | 8 core | `previewSubscribe` command | FE-2331 | open (#17797) | | 8 core | Plans + saved payment-methods readers | FE-2331 | open (#17798) | | 8 ui | account-ui composables (`usePlans`, `usePaymentMethods`, `usePreviewSubscribe`) | FE-2331 | open (#17799) | | 7 | billing-web own-origin session, sign-in, SDK composition | FE-2218 | open (#17807) | | 8 ui | billing-web `/v1` entry routing + subscription / payment-method surfaces | FE-2331 | **this PR** | | 7 | npm publish (`ingest-types`, `account-core`, `billing-contract`), Platform install, billing-web live top-up | FE-2218 | todo | | 6 | Contract tests + live E2E per flow × consumer | FE-2217 | todo | | 5 slice 2 | Subscription flows through the SDK | FE-2216 | todo (plan-change decision) | | follow-up | One `needsCustomerAttention` predicate (from the #17665 review) | FE-2216 | open (#17792) | | follow-up | Opaque `BillingServerCode` (from the #17656 review) | FE-2227 | open (#17794) | ```mermaid flowchart LR P3["Phase 3 core lifecycle (merged)"] P4["Phase 4 account-ui (merged)"] P5["Phase 5 slice 1 top-up flag (merged)"] FC["PR 17716 hosted_billing_destination flag (merged)"] HD["PR 17783 hostedDestination port"] SS["PR 17782 scope-source port + credentialed transport"] RN["account-core rename"] RB["billing-contract route builder + return_to"] WS["Workshop adapter"] P8PV["previewSubscribe command"] P8RD["plans + payment-methods readers"] P8["account-ui hosted composables"] BWS["billing-web session + sign-in"] BWV["billing-web /v1 surfaces"] PUB["npm publish account-core / billing-contract"] P7["Phase 7 host proof: Platform + billing-web live"] P6["Phase 6 evidence"] S2["Phase 5 slice 2 subscription"] FU9["customer-attention predicate"] FU11["opaque BillingServerCode"] P3 --> HD FC --> HD HD --> RB P3 --> SS SS --> P7 RB --> P7 P3 --> RN RN --> PUB RB --> PUB PUB --> P7 P3 --> P8PV P3 --> P8RD P8PV --> P8 P8RD --> P8 P4 --> P8 P8 --> S2 P8 --> BWS BWS --> BWV RB --> BWV BWV --> P7 P5 --> P6 P5 --> WS P5 --> FU9 P3 --> FU11 style P3 fill:#d4edda,stroke:#155724 style P4 fill:#d4edda,stroke:#155724 style P5 fill:#d4edda,stroke:#155724 style FC fill:#d4edda,stroke:#155724 style BWV stroke:#0366d6,stroke-width:4px ```
99c6306 to
44b705e
Compare
|
This went CONFLICTING/DIRTY because its base The restack drops all four lower commits and replays only the two that belong to this PR: I ran it in a throwaway worktree to confirm: Not doing it here: this PR is already approved, and a force-push would dismiss that approval. |
…nd payment-method surfaces (#17809) Linear FE-2331 / FE-2218. Stacked on #17807 (session); carries a cherry-pick of #17795 (billing-contract). ## Why `billing.comfy.org` currently serves one static page: a hard-coded checkout mockup at `/`. Nothing reads the entry URL a product hands it, and nothing renders over the billing SDK. This PR gives the hosted app its `/v1` entry routing plus the first two surfaces that project real SDK state — the subscription catalog with a plan-change quote, and saved payment methods with the provider portal round trip. The entry URL is untrusted routing input. `parseBillingEntry` decides whether it describes a request the contract knows, and a failed parse renders a coded explanation rather than a redirect, so a misdirected link stays visible instead of silently landing the customer somewhere else. ## How - `router.ts` generates a route per `BILLING_INTENTS` entry — `subscription` and `pricing` to `SubscriptionView`, `payment-methods` to `PaymentMethodsView`, `checkout` to the existing `BillingHomeView` (unchanged), `invoices` and `result` to `ComingSoonView`. `/` keeps the scaffold checkout page and stays outside the contract. - A `beforeEach` parses `to.fullPath` and publishes the result into a tab-local module ref (`useBillingEntry`); `App.vue` renders the entry-error surface whenever that parse failed, whatever route matched. No navigation happens on an error. - The entry is read before the session guard from #17807 runs, so a link we cannot read explains itself even to a visitor the guard sends to `/sign-in`: signing in would not repair it. `/` and `/sign-in` carry no product request and leave the entry alone. - `HostedSurface.vue` is the shared shell: the dark full-screen layout, the surface title, the `Return to <product>` link built with `buildReturnUrl` against the resolved `BILLING_WEB_ENV` (default and fail-closed value `test`), and the choice between the entry-error section and the surface itself. Views stay pure projections of composable state, and a surface only ever renders behind the guard and the shell, which always provide a client. - `SubscriptionPanel` reads `usePlans()`, renders each plan as a card (tier + duration, price, monthly credits, seats), disables an unavailable plan with its availability reason as our own copy, and on selection calls `usePreviewSubscribe().quote({ planSlug })` and renders the quote. Confirm is present and disabled behind the scaffold's existing `checkout.sdkPending` line. - `PaymentMethodsPanel` reads `usePaymentMethods()`, marks the default card, and opens the provider portal through `commands.openPaymentPortal` with this page's own href plus a `portal=return` marker. On the way back it invalidates and re-reads once, then strips the marker with `router.replace`. - Every server-chosen value reaches the screen as a coded lookup with a generic fallback: availability reasons, transition types, billing failure codes, entry error codes, saved payment method types. The card brand and its last four digits are the one server-supplied pair the UI interpolates; no other server text is rendered. - `bigint` money fields convert with `Number()` only at the `n()`/`d()` formatting boundary. ## AS-IS / TO-BE AS-IS: a `/v1/subscription` link has no surface of its own — the catch-all redirects it to `/`, the scaffold's static checkout mockup, and the product's entry parameters are dropped on the way. TO-BE: `/v1/subscription` renders the catalog with the current plan marked and an unavailable plan explained, selecting a plan adds the server's plan-change quote with an inert confirm, `/v1/payment-methods` lists saved cards with the default marked beside the provider-portal button, and a link the contract cannot read gets a coded explanation instead of a redirect. | AS-IS | TO-BE | | --- | --- | | `/v1/subscription?product=comfyui&return_to=comfyui_workspace` redirects to the static checkout page<br><img width="420" src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/asis-v1-subscription.png"> | The same link renders the subscription surface<br><img width="420" src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/tobe-subscription.png"> | | TO-BE — plan-change quote after selecting Pro · Monthly<br><img width="420" src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/tobe-subscription-quote.png"> | TO-BE — `/v1/payment-methods` with the default card marked<br><img width="420" src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/tobe-payment-methods.png"> | | — | TO-BE — a link the contract cannot read (`/v1/subscription?product=nope`)<br><img width="420" src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/tobe-entry-error.png"> | ## Testing `apps/billing-web` unit tests (`@testing-library/vue`, happy-dom): the app suite is 85 passing, 44 of them in the four files this PR touches: - `router.test.ts` — each intent opens its surface, the parsed entry is published, every entry-error code renders its own copy (including on the checkout route, proving the error surface wins over the matched route), an unrecognised path stays where it is, and `/` remains outside the contract. The guard rows from #17807 join the same file: a signed-out visitor is sent to `/sign-in` with the surface to come back to, and an unreadable link keeps its error through that redirect. - `SubscriptionView.test.ts` — current plan named, catalog priced, an unavailable plan disabled with its reason, selecting a plan calls `previewSubscribe` with `{ planSlug }` and renders the formatted quote with confirm disabled, a refused quote and a failed catalog read both render coded copy. - `PaymentMethodsView.test.ts` — cards listed with the default marked, the portal button navigates to the returned URL, and `portal=return` triggers exactly one invalidate plus one read before the marker is stripped. - `HostedSurface.test.ts` — the arriving intent's content renders, return link href from `buildReturnUrl`, no link when the entry named no destination. Gates: `pnpm typecheck`, `pnpm lint`, `pnpm format`, `pnpm knip`, `pnpm --filter @comfyorg/billing-web build`, `fallow audit` all pass. ## Not in this PR - Subscribing through the SDK — the confirm button is deliberately inert. - Invoices, which wait on the backend. - Putting `apps/billing-web` unit tests in the CI loop: `ci-tests-unit.yaml` runs `packages/*` only, so this suite runs locally but not on a PR. Follow-up. ## Where this sits in the plan Billing SDK track FE-2210 ([implementation plan V2](https://app.notion.com/p/3d86d73d36508152b92cdbdfdfe83ac8)). Hybrid model: top-up in-app, subscription management / invoices / payment methods on the hosted billing app. | Phase | Item | Ticket | Status | | --- | --- | --- | --- | | 1-2 | Session core, transport, readers | FE-2211/2212/2213 | merged | | 3 | Operation lifecycle, commands, eight-state projection | FE-2227/2214/2223 | merged (#17655) | | 4 | `@comfyorg/account-ui` composables + `CheckoutSteps` | FE-2215 | merged (#17662, #17663) | | 5 slice 1 | Top-up through the SDK behind `billing_sdk_topup_enabled` | FE-2216 | merged (#17665) | | rollout C | `hosted_billing_destination` server flag read by the host | FE-2218 | merged (#17716) | | rollout C | `hostedDestination` port on the lifecycle, value on operation state | FE-2210/2218 | open (#17783) | | 7 prep | Scope-source port + credentialed transport (BFF / cookie hosts) | FE-2218 | open (#17782) | | 7 prep | `@comfyorg/account` → `@comfyorg/account-core` rename | FE-2218 | local, opens after #17782 and #17783 | | 7 prep | `billing-contract` route builder + `return_to` registry | FE-2218 | open (#17795) | | 3A-3 | Workshop adapter over `createHostedTopupCheckout` | FE-2214 | open (#17793) | | 8 core | `previewSubscribe` command | FE-2331 | open (#17797) | | 8 core | Plans + saved payment-methods readers | FE-2331 | open (#17798) | | 8 ui | account-ui composables (`usePlans`, `usePaymentMethods`, `usePreviewSubscribe`) | FE-2331 | open (#17799) | | 7 | billing-web own-origin session, sign-in, SDK composition | FE-2218 | open (#17807) | | 8 ui | billing-web `/v1` entry routing + subscription / payment-method surfaces | FE-2331 | **this PR** | | 7 | npm publish (`ingest-types`, `account-core`, `billing-contract`), Platform install, billing-web live top-up | FE-2218 | todo | | 6 | Contract tests + live E2E per flow × consumer | FE-2217 | todo | | 5 slice 2 | Subscription flows through the SDK | FE-2216 | todo (plan-change decision) | | follow-up | One `needsCustomerAttention` predicate (from the #17665 review) | FE-2216 | open (#17792) | | follow-up | Opaque `BillingServerCode` (from the #17656 review) | FE-2227 | open (#17794) | ```mermaid flowchart LR P3["Phase 3 core lifecycle (merged)"] P4["Phase 4 account-ui (merged)"] P5["Phase 5 slice 1 top-up flag (merged)"] FC["PR 17716 hosted_billing_destination flag (merged)"] HD["PR 17783 hostedDestination port"] SS["PR 17782 scope-source port + credentialed transport"] RN["account-core rename"] RB["billing-contract route builder + return_to"] WS["Workshop adapter"] P8PV["previewSubscribe command"] P8RD["plans + payment-methods readers"] P8["account-ui hosted composables"] BWS["billing-web session + sign-in"] BWV["billing-web /v1 surfaces"] PUB["npm publish account-core / billing-contract"] P7["Phase 7 host proof: Platform + billing-web live"] P6["Phase 6 evidence"] S2["Phase 5 slice 2 subscription"] FU9["customer-attention predicate"] FU11["opaque BillingServerCode"] P3 --> HD FC --> HD HD --> RB P3 --> SS SS --> P7 RB --> P7 P3 --> RN RN --> PUB RB --> PUB PUB --> P7 P3 --> P8PV P3 --> P8RD P8PV --> P8 P8RD --> P8 P4 --> P8 P8 --> S2 P8 --> BWS BWS --> BWV RB --> BWV BWV --> P7 P5 --> P6 P5 --> WS P5 --> FU9 P3 --> FU11 style P3 fill:#d4edda,stroke:#155724 style P4 fill:#d4edda,stroke:#155724 style P5 fill:#d4edda,stroke:#155724 style FC fill:#d4edda,stroke:#155724 style BWV stroke:#0366d6,stroke-width:4px ```
cce907e to
2235a40
Compare
37a8ccb
into
jaewon/fe-2331-account-ui-hosted-composables
…own-origin session and v1 surfaces (#17799) Linear FE-2331. Stacked on #17798 (readers); carries #17797 (previewSubscribe, now on main) until #17798 lands. #17807 (billing-web own-origin session + sign-in) and #17809 (billing-web /v1 surfaces) were squash-merged into this branch, so this PR is the whole Phase 8 view layer: account-ui composables, the billing-web session/sign-in, and the subscription / payment-method surfaces. ## Why The plans catalog, the saved cards and the subscription quote are the three reads the hosted billing surfaces are built on, and the core now exposes all three. Nothing in the view layer could reach them: `BillingClient` carried only the balance, capability and status readers, so a host wanting a price had to call the core directly and invent its own loading, failure and cancellation handling per screen. ## How - `BillingClient` gains `plans` and `paymentMethods`; `disposeBillingClient` disposes both, so a sign-out or workspace switch cannot leave a catalog or a card list serving the previous scope. - `usePlans` and `usePaymentMethods` follow `useCredits`: seeded from the reader's snapshot, `immediate` by default, and a failed refresh keeps the last good value beside the failure rather than blanking the screen. `usePaymentMethods` also exposes `defaultMethod` and `invalidateAndRefresh`, for a host coming back from the payment portal where a card was added or removed. - `usePreviewSubscribe` is on-demand and single-flight: each `quote` aborts the one before it through an `AbortController`, and only the latest settles into `preview`/`failure`, so a slow price for a plan the user has moved off never lands on screen. - The app composition root builds both readers and adds them to `dispose()`, keeping the two scope-holder lists in step. Commands stay unwired here. ## AS-IS / TO-BE No UI change. These are headless composables; nothing renders them yet. ## Testing `usePlans`, `usePaymentMethods` and `usePreviewSubscribe` tests run against the real core over the shared billing harness. Both the abort guard and the payment-methods invalidation were verified to fail when removed. A table in `createBillingSdk.test.ts` asserts every reader stops serving the disposed scope. ## Where this sits in the plan Billing SDK track FE-2210 ([implementation plan V2](https://app.notion.com/p/3d86d73d36508152b92cdbdfdfe83ac8)). Hybrid model: top-up in-app, subscription management / invoices / payment methods on the hosted billing app. | Phase | Item | Ticket | Status | | --- | --- | --- | --- | | 1-2 | Session core, transport, readers | FE-2211/2212/2213 | merged | | 3 | Operation lifecycle, commands, eight-state projection | FE-2227/2214/2223 | merged (#17655) | | 4 | `@comfyorg/account-ui` composables + `CheckoutSteps` | FE-2215 | merged (#17662, #17663) | | 5 slice 1 | Top-up through the SDK behind `billing_sdk_topup_enabled` | FE-2216 | merged (#17665) | | rollout C | `hosted_billing_destination` server flag read by the host | FE-2218 | merged (#17716) | | rollout C | `hostedDestination` port on the lifecycle, value on operation state | FE-2210/2218 | open (#17783) | | 7 prep | Scope-source port + credentialed transport (BFF / cookie hosts) | FE-2218 | merged (#17782) | | 7 prep | `@comfyorg/account` → `@comfyorg/account-core` rename | FE-2218 | local, opens after #17783 and #17794 | | 7 prep | `billing-contract` route builder + `return_to` registry | FE-2218 | merged (#17795) | | 3A-3 | Workshop adapter over `createHostedTopupCheckout` | FE-2214 | merged (#17793) | | 8 core | `previewSubscribe` command | FE-2331 | merged (#17797) | | 8 core | Plans + saved payment-methods readers | FE-2331 | open (#17798) | | 8 ui | account-ui composables (`usePlans`, `usePaymentMethods`, `usePreviewSubscribe`) | FE-2331 | **this PR** | | 7 | billing-web own-origin session, sign-in, SDK composition | FE-2218 | **this PR** (was #17807) | | 8 ui | billing-web `/v1` entry routing + subscription / payment-method surfaces | FE-2331 | **this PR** (was #17809) | | 7 | npm publish (`ingest-types`, `account-core`, `billing-contract`), Platform install, billing-web live top-up | FE-2218 | todo | | 6 | Contract tests + live E2E per flow × consumer | FE-2217 | todo | | 5 slice 2 | Subscription flows through the SDK | FE-2216 | todo (plan-change decision) | | follow-up | One `needsCustomerAttention` predicate (from the #17665 review) | FE-2216 | merged (#17792) | | follow-up | Opaque `BillingServerCode` (from the #17656 review) | FE-2227 | open (#17794) | | follow-up | `useCredits` clears on `SUPERSEDED` (from the #17799 review) | FE-2215 | open (#17824) | ```mermaid flowchart LR P3["Phase 3 core lifecycle (merged)"] P4["Phase 4 account-ui (merged)"] P5["Phase 5 slice 1 top-up flag (merged)"] FC["PR 17716 hosted_billing_destination flag (merged)"] HD["PR 17783 hostedDestination port"] SS["PR 17782 scope-source port + credentialed transport"] RN["account-core rename"] RB["billing-contract route builder + return_to"] WS["Workshop adapter"] P8PV["previewSubscribe command"] P8RD["plans + payment-methods readers"] P8["account-ui hosted composables"] BWS["billing-web session + sign-in"] BWV["billing-web /v1 surfaces"] PUB["npm publish account-core / billing-contract"] P7["Phase 7 host proof: Platform + billing-web live"] P6["Phase 6 evidence"] S2["Phase 5 slice 2 subscription"] FU9["customer-attention predicate"] FU11["opaque BillingServerCode"] FU12["useCredits clears on SUPERSEDED"] P3 --> HD FC --> HD HD --> RB P3 --> SS SS --> P7 RB --> P7 P3 --> RN RN --> PUB RB --> PUB PUB --> P7 P3 --> P8PV P3 --> P8RD P8PV --> P8 P8RD --> P8 P4 --> P8 P8 --> S2 P8 --> BWS BWS --> BWV RB --> BWV BWV --> P7 P5 --> P6 P5 --> WS P5 --> FU9 P3 --> FU11 P4 --> FU12 style P3 fill:#d4edda,stroke:#155724 style P4 fill:#d4edda,stroke:#155724 style P5 fill:#d4edda,stroke:#155724 style FC fill:#d4edda,stroke:#155724 style SS fill:#d4edda,stroke:#155724 style RB fill:#d4edda,stroke:#155724 style WS fill:#d4edda,stroke:#155724 style FU9 fill:#d4edda,stroke:#155724 style P8PV fill:#d4edda,stroke:#155724 style P8 stroke:#0366d6,stroke-width:4px style BWS stroke:#0366d6,stroke-width:4px style BWV stroke:#0366d6,stroke-width:4px ```
…own-origin session and v1 surfaces (#17799) Linear FE-2331. Stacked on #17798 (readers); carries #17797 (previewSubscribe, now on main) until #17798 lands. #17807 (billing-web own-origin session + sign-in) and #17809 (billing-web /v1 surfaces) were squash-merged into this branch, so this PR is the whole Phase 8 view layer: account-ui composables, the billing-web session/sign-in, and the subscription / payment-method surfaces. The plans catalog, the saved cards and the subscription quote are the three reads the hosted billing surfaces are built on, and the core now exposes all three. Nothing in the view layer could reach them: `BillingClient` carried only the balance, capability and status readers, so a host wanting a price had to call the core directly and invent its own loading, failure and cancellation handling per screen. - `BillingClient` gains `plans` and `paymentMethods`; `disposeBillingClient` disposes both, so a sign-out or workspace switch cannot leave a catalog or a card list serving the previous scope. - `usePlans` and `usePaymentMethods` follow `useCredits`: seeded from the reader's snapshot, `immediate` by default, and a failed refresh keeps the last good value beside the failure rather than blanking the screen. `usePaymentMethods` also exposes `defaultMethod` and `invalidateAndRefresh`, for a host coming back from the payment portal where a card was added or removed. - `usePreviewSubscribe` is on-demand and single-flight: each `quote` aborts the one before it through an `AbortController`, and only the latest settles into `preview`/`failure`, so a slow price for a plan the user has moved off never lands on screen. - The app composition root builds both readers and adds them to `dispose()`, keeping the two scope-holder lists in step. Commands stay unwired here. No UI change. These are headless composables; nothing renders them yet. `usePlans`, `usePaymentMethods` and `usePreviewSubscribe` tests run against the real core over the shared billing harness. Both the abort guard and the payment-methods invalidation were verified to fail when removed. A table in `createBillingSdk.test.ts` asserts every reader stops serving the disposed scope. Billing SDK track FE-2210 ([implementation plan V2](https://app.notion.com/p/3d86d73d36508152b92cdbdfdfe83ac8)). Hybrid model: top-up in-app, subscription management / invoices / payment methods on the hosted billing app. | Phase | Item | Ticket | Status | | --- | --- | --- | --- | | 1-2 | Session core, transport, readers | FE-2211/2212/2213 | merged | | 3 | Operation lifecycle, commands, eight-state projection | FE-2227/2214/2223 | merged (#17655) | | 4 | `@comfyorg/account-ui` composables + `CheckoutSteps` | FE-2215 | merged (#17662, #17663) | | 5 slice 1 | Top-up through the SDK behind `billing_sdk_topup_enabled` | FE-2216 | merged (#17665) | | rollout C | `hosted_billing_destination` server flag read by the host | FE-2218 | merged (#17716) | | rollout C | `hostedDestination` port on the lifecycle, value on operation state | FE-2210/2218 | open (#17783) | | 7 prep | Scope-source port + credentialed transport (BFF / cookie hosts) | FE-2218 | merged (#17782) | | 7 prep | `@comfyorg/account` → `@comfyorg/account-core` rename | FE-2218 | local, opens after #17783 and #17794 | | 7 prep | `billing-contract` route builder + `return_to` registry | FE-2218 | merged (#17795) | | 3A-3 | Workshop adapter over `createHostedTopupCheckout` | FE-2214 | merged (#17793) | | 8 core | `previewSubscribe` command | FE-2331 | merged (#17797) | | 8 core | Plans + saved payment-methods readers | FE-2331 | open (#17798) | | 8 ui | account-ui composables (`usePlans`, `usePaymentMethods`, `usePreviewSubscribe`) | FE-2331 | **this PR** | | 7 | billing-web own-origin session, sign-in, SDK composition | FE-2218 | **this PR** (was #17807) | | 8 ui | billing-web `/v1` entry routing + subscription / payment-method surfaces | FE-2331 | **this PR** (was #17809) | | 7 | npm publish (`ingest-types`, `account-core`, `billing-contract`), Platform install, billing-web live top-up | FE-2218 | todo | | 6 | Contract tests + live E2E per flow × consumer | FE-2217 | todo | | 5 slice 2 | Subscription flows through the SDK | FE-2216 | todo (plan-change decision) | | follow-up | One `needsCustomerAttention` predicate (from the #17665 review) | FE-2216 | merged (#17792) | | follow-up | Opaque `BillingServerCode` (from the #17656 review) | FE-2227 | open (#17794) | | follow-up | `useCredits` clears on `SUPERSEDED` (from the #17799 review) | FE-2215 | open (#17824) | ```mermaid flowchart LR P3["Phase 3 core lifecycle (merged)"] P4["Phase 4 account-ui (merged)"] P5["Phase 5 slice 1 top-up flag (merged)"] FC["PR 17716 hosted_billing_destination flag (merged)"] HD["PR 17783 hostedDestination port"] SS["PR 17782 scope-source port + credentialed transport"] RN["account-core rename"] RB["billing-contract route builder + return_to"] WS["Workshop adapter"] P8PV["previewSubscribe command"] P8RD["plans + payment-methods readers"] P8["account-ui hosted composables"] BWS["billing-web session + sign-in"] BWV["billing-web /v1 surfaces"] PUB["npm publish account-core / billing-contract"] P7["Phase 7 host proof: Platform + billing-web live"] P6["Phase 6 evidence"] S2["Phase 5 slice 2 subscription"] FU9["customer-attention predicate"] FU11["opaque BillingServerCode"] FU12["useCredits clears on SUPERSEDED"] P3 --> HD FC --> HD HD --> RB P3 --> SS SS --> P7 RB --> P7 P3 --> RN RN --> PUB RB --> PUB PUB --> P7 P3 --> P8PV P3 --> P8RD P8PV --> P8 P8RD --> P8 P4 --> P8 P8 --> S2 P8 --> BWS BWS --> BWV RB --> BWV BWV --> P7 P5 --> P6 P5 --> WS P5 --> FU9 P3 --> FU11 P4 --> FU12 style P3 fill:#d4edda,stroke:#155724 style P4 fill:#d4edda,stroke:#155724 style P5 fill:#d4edda,stroke:#155724 style FC fill:#d4edda,stroke:#155724 style SS fill:#d4edda,stroke:#155724 style RB fill:#d4edda,stroke:#155724 style WS fill:#d4edda,stroke:#155724 style FU9 fill:#d4edda,stroke:#155724 style P8PV fill:#d4edda,stroke:#155724 style P8 stroke:#0366d6,stroke-width:4px style BWS stroke:#0366d6,stroke-width:4px style BWV stroke:#0366d6,stroke-width:4px ```
…g the previous scope's (Comfy-Org#17824) Linear FE-2215. Follow-up from the Comfy-Org#17799 review. ## Why The exposure this SDK track started from was a reader serving the previous account's balance. The core closed it: a read that settles after the host moved to another workspace is refused with `SUPERSEDED` rather than published. `useCredits` then reopened it in the view layer — it treated that refusal as an ordinary failure, kept `balance` untouched, and went on rendering the credits of the workspace the user had just left. ## Root cause `useCredits.refresh` had two branches: publish on `ok`, keep the previous balance and surface the failure on anything else. A scope change is neither. It is not something the user did, there is nothing to retry, and the value being kept belongs to an account that is no longer on screen. The three composables added in Comfy-Org#17799 already split that branch out; the five older ones never mentioned `SUPERSEDED`. ## How `useCredits` clears both `balance` and `failure` on a `SUPERSEDED` read, the same three lines as `usePaymentMethods`, and its docstring keeps the "a failed refresh keeps the previous balance" promise only for ordinary failures. The other four pre-existing composables are unchanged: - `useBillingOperation` — the lifecycle dispatches `superseded` to every operation on a scope change and republishes it, so the state this composable holds is already the truthful new one rather than a stale one. - `usePaymentAttempt` — its visible surface is `projection`, and `projectPaymentStep` maps a superseded operation back to `select`. - `useCheckout` / `useTopUp` — `result` is the outcome handed back to the caller of a command, carries no scope-bound data, and the step the shipped `CheckoutSteps` renders comes from the projection above. The test fixture's fake session can now move to another workspace, so the real credits reader produces `SUPERSEDED` the way the workspace switcher does. ## AS-IS / TO-BE No UI change. AS-IS: after a workspace switch, a host bound to `useCredits` keeps showing the previous workspace's balance until something else clears it. TO-BE: the balance goes undefined and the host renders its empty state until the read for the new workspace settles, with no error shown for a switch the user did not make. ## Testing `useCredits.test.ts` gains a row that moves the harness to another workspace mid-refresh and asserts the balance is dropped with no failure reported; it fails on pre-fix code. The existing row proving that an ordinary failed refresh keeps the previous balance stays. ## Where this sits in the plan Billing SDK track FE-2210 ([implementation plan V2](https://app.notion.com/p/3d86d73d36508152b92cdbdfdfe83ac8)). Hybrid model: top-up in-app, subscription management / invoices / payment methods on the hosted billing app. | Phase | Item | Ticket | Status | | --- | --- | --- | --- | | 1-2 | Session core, transport, readers | FE-2211/2212/2213 | merged | | 3 | Operation lifecycle, commands, eight-state projection | FE-2227/2214/2223 | merged (Comfy-Org#17655) | | 4 | `@comfyorg/account-ui` composables + `CheckoutSteps` | FE-2215 | merged (Comfy-Org#17662, Comfy-Org#17663) | | 5 slice 1 | Top-up through the SDK behind `billing_sdk_topup_enabled` | FE-2216 | merged (Comfy-Org#17665) | | rollout C | `hosted_billing_destination` server flag read by the host | FE-2218 | merged (Comfy-Org#17716) | | rollout C | `hostedDestination` port on the lifecycle, value on operation state | FE-2210/2218 | open (Comfy-Org#17783) | | 7 prep | Scope-source port + credentialed transport (BFF / cookie hosts) | FE-2218 | merged (Comfy-Org#17782) | | 7 prep | `@comfyorg/account` → `@comfyorg/account-core` rename | FE-2218 | local, opens after Comfy-Org#17783 and Comfy-Org#17794 | | 7 prep | `billing-contract` route builder + `return_to` registry | FE-2218 | merged (Comfy-Org#17795) | | 3A-3 | Workshop adapter over `createHostedTopupCheckout` | FE-2214 | merged (Comfy-Org#17793) | | 8 core | `previewSubscribe` command | FE-2331 | merged (Comfy-Org#17797) | | 8 core | Plans + saved payment-methods readers | FE-2331 | open (Comfy-Org#17798) | | 8 ui | account-ui composables (`usePlans`, `usePaymentMethods`, `usePreviewSubscribe`) | FE-2331 | open (Comfy-Org#17799) | | 7 | billing-web own-origin session, sign-in, SDK composition | FE-2218 | open (Comfy-Org#17807) | | 8 ui | billing-web `/v1` entry routing + subscription / payment-method surfaces | FE-2331 | open (Comfy-Org#17809) | | 7 | npm publish (`ingest-types`, `account-core`, `billing-contract`), Platform install, billing-web live top-up | FE-2218 | todo | | 6 | Contract tests + live E2E per flow × consumer | FE-2217 | todo | | 5 slice 2 | Subscription flows through the SDK | FE-2216 | todo (plan-change decision) | | follow-up | One `needsCustomerAttention` predicate (from the Comfy-Org#17665 review) | FE-2216 | merged (Comfy-Org#17792) | | follow-up | Opaque `BillingServerCode` (from the Comfy-Org#17656 review) | FE-2227 | open (Comfy-Org#17794) | | follow-up | `useCredits` clears on `SUPERSEDED` (from the Comfy-Org#17799 review) | FE-2215 | **this PR** | ```mermaid flowchart LR P3["Phase 3 core lifecycle (merged)"] P4["Phase 4 account-ui (merged)"] P5["Phase 5 slice 1 top-up flag (merged)"] FC["PR 17716 hosted_billing_destination flag (merged)"] HD["PR 17783 hostedDestination port"] SS["PR 17782 scope-source port + credentialed transport"] RN["account-core rename"] RB["billing-contract route builder + return_to"] WS["Workshop adapter"] P8PV["previewSubscribe command"] P8RD["plans + payment-methods readers"] P8["account-ui hosted composables"] BWS["billing-web session + sign-in"] BWV["billing-web /v1 surfaces"] PUB["npm publish account-core / billing-contract"] P7["Phase 7 host proof: Platform + billing-web live"] P6["Phase 6 evidence"] S2["Phase 5 slice 2 subscription"] FU9["customer-attention predicate"] FU11["opaque BillingServerCode"] FU12["useCredits clears on SUPERSEDED"] P3 --> HD FC --> HD HD --> RB P3 --> SS SS --> P7 RB --> P7 P3 --> RN RN --> PUB RB --> PUB PUB --> P7 P3 --> P8PV P3 --> P8RD P8PV --> P8 P8RD --> P8 P4 --> P8 P8 --> S2 P8 --> BWS BWS --> BWV RB --> BWV BWV --> P7 P5 --> P6 P5 --> WS P5 --> FU9 P3 --> FU11 P4 --> FU12 style P3 fill:#d4edda,stroke:#155724 style P4 fill:#d4edda,stroke:#155724 style P5 fill:#d4edda,stroke:#155724 style FC fill:#d4edda,stroke:#155724 style FU12 stroke:#0366d6,stroke-width:4px ```
…own-origin session and v1 surfaces (#17799) Linear FE-2331. Stacked on #17798 (readers); carries #17797 (previewSubscribe, now on main) until #17798 lands. #17807 (billing-web own-origin session + sign-in) and #17809 (billing-web /v1 surfaces) were squash-merged into this branch, so this PR is the whole Phase 8 view layer: account-ui composables, the billing-web session/sign-in, and the subscription / payment-method surfaces. The plans catalog, the saved cards and the subscription quote are the three reads the hosted billing surfaces are built on, and the core now exposes all three. Nothing in the view layer could reach them: `BillingClient` carried only the balance, capability and status readers, so a host wanting a price had to call the core directly and invent its own loading, failure and cancellation handling per screen. - `BillingClient` gains `plans` and `paymentMethods`; `disposeBillingClient` disposes both, so a sign-out or workspace switch cannot leave a catalog or a card list serving the previous scope. - `usePlans` and `usePaymentMethods` follow `useCredits`: seeded from the reader's snapshot, `immediate` by default, and a failed refresh keeps the last good value beside the failure rather than blanking the screen. `usePaymentMethods` also exposes `defaultMethod` and `invalidateAndRefresh`, for a host coming back from the payment portal where a card was added or removed. - `usePreviewSubscribe` is on-demand and single-flight: each `quote` aborts the one before it through an `AbortController`, and only the latest settles into `preview`/`failure`, so a slow price for a plan the user has moved off never lands on screen. - The app composition root builds both readers and adds them to `dispose()`, keeping the two scope-holder lists in step. Commands stay unwired here. No UI change. These are headless composables; nothing renders them yet. `usePlans`, `usePaymentMethods` and `usePreviewSubscribe` tests run against the real core over the shared billing harness. Both the abort guard and the payment-methods invalidation were verified to fail when removed. A table in `createBillingSdk.test.ts` asserts every reader stops serving the disposed scope. Billing SDK track FE-2210 ([implementation plan V2](https://app.notion.com/p/3d86d73d36508152b92cdbdfdfe83ac8)). Hybrid model: top-up in-app, subscription management / invoices / payment methods on the hosted billing app. | Phase | Item | Ticket | Status | | --- | --- | --- | --- | | 1-2 | Session core, transport, readers | FE-2211/2212/2213 | merged | | 3 | Operation lifecycle, commands, eight-state projection | FE-2227/2214/2223 | merged (#17655) | | 4 | `@comfyorg/account-ui` composables + `CheckoutSteps` | FE-2215 | merged (#17662, #17663) | | 5 slice 1 | Top-up through the SDK behind `billing_sdk_topup_enabled` | FE-2216 | merged (#17665) | | rollout C | `hosted_billing_destination` server flag read by the host | FE-2218 | merged (#17716) | | rollout C | `hostedDestination` port on the lifecycle, value on operation state | FE-2210/2218 | open (#17783) | | 7 prep | Scope-source port + credentialed transport (BFF / cookie hosts) | FE-2218 | merged (#17782) | | 7 prep | `@comfyorg/account` → `@comfyorg/account-core` rename | FE-2218 | local, opens after #17783 and #17794 | | 7 prep | `billing-contract` route builder + `return_to` registry | FE-2218 | merged (#17795) | | 3A-3 | Workshop adapter over `createHostedTopupCheckout` | FE-2214 | merged (#17793) | | 8 core | `previewSubscribe` command | FE-2331 | merged (#17797) | | 8 core | Plans + saved payment-methods readers | FE-2331 | open (#17798) | | 8 ui | account-ui composables (`usePlans`, `usePaymentMethods`, `usePreviewSubscribe`) | FE-2331 | **this PR** | | 7 | billing-web own-origin session, sign-in, SDK composition | FE-2218 | **this PR** (was #17807) | | 8 ui | billing-web `/v1` entry routing + subscription / payment-method surfaces | FE-2331 | **this PR** (was #17809) | | 7 | npm publish (`ingest-types`, `account-core`, `billing-contract`), Platform install, billing-web live top-up | FE-2218 | todo | | 6 | Contract tests + live E2E per flow × consumer | FE-2217 | todo | | 5 slice 2 | Subscription flows through the SDK | FE-2216 | todo (plan-change decision) | | follow-up | One `needsCustomerAttention` predicate (from the #17665 review) | FE-2216 | merged (#17792) | | follow-up | Opaque `BillingServerCode` (from the #17656 review) | FE-2227 | open (#17794) | | follow-up | `useCredits` clears on `SUPERSEDED` (from the #17799 review) | FE-2215 | open (#17824) | ```mermaid flowchart LR P3["Phase 3 core lifecycle (merged)"] P4["Phase 4 account-ui (merged)"] P5["Phase 5 slice 1 top-up flag (merged)"] FC["PR 17716 hosted_billing_destination flag (merged)"] HD["PR 17783 hostedDestination port"] SS["PR 17782 scope-source port + credentialed transport"] RN["account-core rename"] RB["billing-contract route builder + return_to"] WS["Workshop adapter"] P8PV["previewSubscribe command"] P8RD["plans + payment-methods readers"] P8["account-ui hosted composables"] BWS["billing-web session + sign-in"] BWV["billing-web /v1 surfaces"] PUB["npm publish account-core / billing-contract"] P7["Phase 7 host proof: Platform + billing-web live"] P6["Phase 6 evidence"] S2["Phase 5 slice 2 subscription"] FU9["customer-attention predicate"] FU11["opaque BillingServerCode"] FU12["useCredits clears on SUPERSEDED"] P3 --> HD FC --> HD HD --> RB P3 --> SS SS --> P7 RB --> P7 P3 --> RN RN --> PUB RB --> PUB PUB --> P7 P3 --> P8PV P3 --> P8RD P8PV --> P8 P8RD --> P8 P4 --> P8 P8 --> S2 P8 --> BWS BWS --> BWV RB --> BWV BWV --> P7 P5 --> P6 P5 --> WS P5 --> FU9 P3 --> FU11 P4 --> FU12 style P3 fill:#d4edda,stroke:#155724 style P4 fill:#d4edda,stroke:#155724 style P5 fill:#d4edda,stroke:#155724 style FC fill:#d4edda,stroke:#155724 style SS fill:#d4edda,stroke:#155724 style RB fill:#d4edda,stroke:#155724 style WS fill:#d4edda,stroke:#155724 style FU9 fill:#d4edda,stroke:#155724 style P8PV fill:#d4edda,stroke:#155724 style P8 stroke:#0366d6,stroke-width:4px style BWS stroke:#0366d6,stroke-width:4px style BWV stroke:#0366d6,stroke-width:4px ```
…ders, hosted composables, own-origin session and v1 surfaces (Comfy-Org#17798) Linear FE-2331 / FE-2218. This PR is the whole Phase 8 view layer after the stack was consolidated: Comfy-Org#17799 (account-ui `usePlans` / `usePaymentMethods` / `usePreviewSubscribe` + app-root readers), Comfy-Org#17807 (billing-web own-origin session, sign-in, SDK composition) and Comfy-Org#17809 (billing-web `/v1` entry routing, subscription and payment-method surfaces) were squash-merged into this branch; their bodies, decisions and screenshots remain on those PRs. Rebased onto main after Comfy-Org#17782 (scopeSource), Comfy-Org#17795 (billing-contract) and Comfy-Org#17797 (previewSubscribe) landed, so none of that content is in this diff. ## Why Phase 8's hosted billing surfaces render plan management and saved payment methods, and both reads have to go through the billing SDK so they inherit the scope tracking, deduplication, and coded failures the other readers already have. The generated schemas for both routes exist, so nothing has to be hand-declared. ## How - `plans.ts`: `createPlansReader` over `GET /billing/plans`, decoded with `zGetBillingPlansResponse`. No freshness window — the catalog carries no declared lifetime, so the host decides when to re-read. - `paymentMethods.ts`: `createPaymentMethodsReader` over `GET /billing/payment-methods`, decoded with `zListSavedPaymentMethodsResponse`, plus `invalidate()` so a host returning from the payment portal can drop the list it holds without a scope change. - Both follow the existing reader shape exactly: `createBillingScopeTracker` drops the snapshot and any in-flight read on a scope change, concurrent reads for one scope share a single request, a 2xx that fails the schema is `MALFORMED_RESPONSE`, and HTTP failures map through `codeForHttpStatus`. - Exported from `@comfyorg/account/billing` alongside the credits, status, and capabilities readers. The four readers now share the same request/publish body, which `fallow audit` reports as a duplication warning. Factoring it out would touch `credits.ts` and `status.ts`, which two open PRs already modify, so it is left for a follow-up. ## AS-IS / TO-BE No UI change. The cloud app still calls `workspaceApi.getBillingPlans` and `workspaceApi.listSavedPaymentMethods`; the composables and host wiring that move it onto these readers land in separate PRs. ## Testing `plans.test.ts` and `paymentMethods.test.ts` cover the decode and scope of a successful read, the caller timeout reaching the request, deduplication of concurrent reads, a scope change in flight reporting `SUPERSEDED` with nothing cached, a signed-out reader reporting `NOT_AUTHENTICATED` without a request, the HTTP status table (401 replayed and unreplayed, 403, 404, 500), a malformed 2xx, and `dispose`. Payment methods additionally cover the empty list and `invalidate` dropping the snapshot so the next read refetches. `pnpm typecheck`, `pnpm lint`, `pnpm format`, `pnpm knip`, and `fallow audit --changed-since origin/main` pass. Follow-up, not in this PR: the four readers now share a 32-line scope/in-flight skeleton (`credits.ts`, `status.ts`, `plans.ts`, `paymentMethods.ts`; fallow reports it as one clone family). Comfy-Org#17782 has landed, but extracting it still touches files Comfy-Org#17794 is changing, so it waits for that to land. ## Where this sits in the plan Billing SDK track FE-2210 ([implementation plan V2](https://app.notion.com/p/3d86d73d36508152b92cdbdfdfe83ac8)). Hybrid model: top-up in-app, subscription management / invoices / payment methods on the hosted billing app. | Phase | Item | Ticket | Status | | --- | --- | --- | --- | | 1-2 | Session core, transport, readers | FE-2211/2212/2213 | merged | | 3 | Operation lifecycle, commands, eight-state projection | FE-2227/2214/2223 | merged (Comfy-Org#17655) | | 4 | `@comfyorg/account-ui` composables + `CheckoutSteps` | FE-2215 | merged (Comfy-Org#17662, Comfy-Org#17663) | | 5 slice 1 | Top-up through the SDK behind `billing_sdk_topup_enabled` | FE-2216 | merged (Comfy-Org#17665) | | rollout C | `hosted_billing_destination` server flag read by the host | FE-2218 | merged (Comfy-Org#17716) | | rollout C | `hostedDestination` port on the lifecycle, value on operation state | FE-2210/2218 | open (Comfy-Org#17783) | | 7 prep | Scope-source port + credentialed transport (BFF / cookie hosts) | FE-2218 | merged (Comfy-Org#17782) | | 7 prep | `@comfyorg/account` → `@comfyorg/account-core` rename | FE-2218 | local, opens after Comfy-Org#17783 and Comfy-Org#17794 | | 7 prep | `billing-contract` route builder + `return_to` registry | FE-2218 | merged (Comfy-Org#17795) | | 3A-3 | Workshop adapter over `createHostedTopupCheckout` | FE-2214 | merged (Comfy-Org#17793) | | 8 core | `previewSubscribe` command | FE-2331 | merged (Comfy-Org#17797) | | 8 core | Plans + saved payment-methods readers | FE-2331 | **this PR** | | 8 ui | account-ui composables (`usePlans`, `usePaymentMethods`, `usePreviewSubscribe`) | FE-2331 | **this PR** (was Comfy-Org#17799) | | 7 | billing-web own-origin session, sign-in, SDK composition | FE-2218 | **this PR** (was Comfy-Org#17807) | | 8 ui | billing-web `/v1` entry routing + subscription / payment-method surfaces | FE-2331 | **this PR** (was Comfy-Org#17809) | | 7 | npm publish (`ingest-types`, `account-core`, `billing-contract`), Platform install, billing-web live top-up | FE-2218 | todo | | 6 | Contract tests + live E2E per flow × consumer | FE-2217 | todo | | 5 slice 2 | Subscription flows through the SDK | FE-2216 | todo (plan-change decision) | | follow-up | One `needsCustomerAttention` predicate (from the Comfy-Org#17665 review) | FE-2216 | merged (Comfy-Org#17792) | | follow-up | Opaque `BillingServerCode` (from the Comfy-Org#17656 review) | FE-2227 | open (Comfy-Org#17794) | | follow-up | `useCredits` clears on `SUPERSEDED` (from the Comfy-Org#17799 review) | FE-2215 | open (Comfy-Org#17824) | ```mermaid flowchart LR P3["Phase 3 core lifecycle (merged)"] P4["Phase 4 account-ui (merged)"] P5["Phase 5 slice 1 top-up flag (merged)"] FC["PR 17716 hosted_billing_destination flag (merged)"] HD["PR 17783 hostedDestination port"] SS["PR 17782 scope-source port + credentialed transport"] RN["account-core rename"] RB["billing-contract route builder + return_to"] WS["Workshop adapter"] P8PV["previewSubscribe command"] P8RD["plans + payment-methods readers"] P8["account-ui hosted composables"] BWS["billing-web session + sign-in"] BWV["billing-web /v1 surfaces"] PUB["npm publish account-core / billing-contract"] P7["Phase 7 host proof: Platform + billing-web live"] P6["Phase 6 evidence"] S2["Phase 5 slice 2 subscription"] FU9["customer-attention predicate"] FU11["opaque BillingServerCode"] FU12["useCredits clears on SUPERSEDED"] P3 --> HD FC --> HD HD --> RB P3 --> SS SS --> P7 RB --> P7 P3 --> RN RN --> PUB RB --> PUB PUB --> P7 P3 --> P8PV P3 --> P8RD P8PV --> P8 P8RD --> P8 P4 --> P8 P8 --> S2 P8 --> BWS BWS --> BWV RB --> BWV BWV --> P7 P5 --> P6 P5 --> WS P5 --> FU9 P3 --> FU11 P4 --> FU12 style P3 fill:#d4edda,stroke:#155724 style P4 fill:#d4edda,stroke:#155724 style P5 fill:#d4edda,stroke:#155724 style FC fill:#d4edda,stroke:#155724 style SS fill:#d4edda,stroke:#155724 style RB fill:#d4edda,stroke:#155724 style WS fill:#d4edda,stroke:#155724 style FU9 fill:#d4edda,stroke:#155724 style P8PV fill:#d4edda,stroke:#155724 style P8RD stroke:#0366d6,stroke-width:4px style P8 stroke:#0366d6,stroke-width:4px style BWS stroke:#0366d6,stroke-width:4px style BWV stroke:#0366d6,stroke-width:4px ```
Linear FE-2218.
Stacked on #17799.
Why
apps/billing-webis a separate origin (billing.comfy.org) with no identity ofits own. Its README already states that billing data has to come through the
shared
@comfyorg/accountSDK, and the SDK's transport, readers and lifecycleall take a
SessionClient— so the app cannot read or command anything until itholds its own session. The Workshop site already solved the same problem on its
own origin; this mirrors that wiring rather than inventing a second one.
How
src/config/env.tsselects the backend family fromVITE_BILLING_ENV(
production|staging|test, unknown or unset falls closed totest)and pairs it with the Cloud origin. Firebase config is read from
VITE_FIREBASE_*because this origin is deployed separately; partial configyields no options at all, so the app boots and the sign-in page says sign-in
is unavailable instead of throwing at import.
src/session/billingWebSession.tsbuilds oneSessionClientlazily, withthis origin's Firebase identity attached, exchanging at
${cloud}/api/auth/tokenand caching the credential insessionStorage(survives a reload, never outlives the tab, keyed by uid).
useBillingWebSession()projects the one snapshot asphase/user/session.src/session/billingWebClient.tsis the single place the billing core isconstructed: transport, five readers, lifecycle and both command surfaces.
Mints are pinned to the workspace the session already holds;
embeddedCheckoutAvailableis false, so every operation routes hosted.BillingShell.vueprovides the client and disposes it on unmount;App.vuekeys the shell by
uid:workspaceId, so sign-out or a workspace switch buildsa fresh client instead of leaving readers serving the previous scope.
/sign-inports the Workshop panel: email + password, Google and GitHubthrough
@comfyorg/account/vue/SocialAuthButtons, the shared sign-in schemafor validation, and forgot-password linking to the Cloud app's own page so
password recovery stays one flow. The flow is one discriminated union plus a
pure transition, as on the Workshop.
beforeEachguard holds every route but/sign-inbehindphase === 'authenticated'and redirects otherwise with the path to comeback to. Only a same-origin absolute path is honoured as a return
destination.
Turnstile and the region gate are not wired: the Workshop applies both only in
sign-up mode, and this app has no sign-up.
AS-IS / TO-BE
AS-IS:
/renders the static checkout page to anyone, with no identity behind it — nothing can call the billing API and no SDK client exists.TO-BE:
/redirects an unauthenticated visitor to/sign-in?returnTo=/, which offers Google, GitHub and email + password whenVITE_FIREBASE_*are configured, and refuses sign-in with a notice when they are not./— static checkout, no identity/→/sign-in?returnTo=/TO-BE, configured — email form filled, password revealed
TO-BE,
VITE_FIREBASE_*absent — sign-in unavailable, controls disabledBoth TO-BE rows are this branch: the base branch has no
/sign-inpage to compare against. Captured at 1440×900 againstvite previewwith every non-localhost request blocked, so no identity provider is reached.Testing
apps/billing-webunit tests (Vitest +@testing-library/vue, happy-dom):environment family resolution and fail-closed rows, Firebase config read and
its partial-config cases, session snapshot projection driven through a fake
identity and a stubbed exchange, the credential cache (written once, served
back without a second mint, degrades when storage throws), the route guard per
session phase, return-destination sanitisation, the eight SDK client members
and disposal releasing every scope subscription, and the sign-in view's submit
and unavailable states.
Gates:
pnpm typecheck,pnpm lint,pnpm format:check,pnpm knip,pnpm --filter @comfyorg/billing-web build,fallow audit --changed-since.Not in this PR
Hosted billing views over the client, the cookie transport, the ingest CORS
entry for this origin (
CORS_ORIGIN), and the Vercel environment values.Where this sits in the plan
Billing SDK track FE-2210 (implementation plan V2). Hybrid model: top-up in-app, subscription management / invoices / payment methods on the hosted billing app.
@comfyorg/account-uicomposables +CheckoutStepsbilling_sdk_topup_enabledhosted_billing_destinationserver flag read by the hosthostedDestinationport on the lifecycle, value on operation state@comfyorg/account→@comfyorg/account-corerenamebilling-contractroute builder +return_toregistrycreateHostedTopupCheckoutpreviewSubscribecommandusePlans,usePaymentMethods,usePreviewSubscribe)/v1entry routing + subscription / payment-method surfacesingest-types,account-core,billing-contract), Platform install, billing-web live top-upneedsCustomerAttentionpredicate (from the #17665 review)BillingServerCode(from the #17656 review)