Repository navigation
feat(billing): consolidate embedded checkout frontend - #14483
Conversation
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughChangesSubscription contracts and API wiring
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant CheckoutDialog
participant useSubscriptionCheckout
participant workspaceApi
participant billingOperationStore
participant Stripe
CheckoutDialog->>useSubscriptionCheckout: submit quote and payment selection
useSubscriptionCheckout->>workspaceApi: send quote, promotion, and payment fields
workspaceApi->>billingOperationStore: start billing operation
billingOperationStore->>Stripe: handleNextAction(client secret)
Stripe-->>billingOperationStore: authentication result
billingOperationStore-->>useSubscriptionCheckout: operation status
useSubscriptionCheckout-->>CheckoutDialog: success, retry, or reconciliation state
Possibly related PRs
Suggested labels: Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1995 passed, 0 failed · 2 flaky📊 Browser Reports
📦 Bundle: 9.35 MB gzip 🔴 +13.2 kBDetailsSummary
Category Glance App Entry Points — 3.74 kB (baseline 3.71 kB) • 🔴 +36 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.4 MB (baseline 1.4 MB) • 🔴 +82 BGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 124 kB (baseline 124 kB) • 🔴 +41 BTop-level views, pages, and routed surfaces
Status: 15 added / 15 removed / 2 unchanged Panels & Settings — 591 kB (baseline 591 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 11 added / 11 removed / 16 unchanged User & Accounts — 27.5 kB (baseline 27.5 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 6 added / 6 removed / 5 unchanged Editors & Dialogs — 125 kB (baseline 125 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 8 added / 8 removed UI Components — 112 kB (baseline 112 kB) • ⚪ 0 BReusable component library chunks
Status: 14 added / 14 removed / 1 unchanged Data & Services — 3.47 MB (baseline 3.45 MB) • 🔴 +18.4 kBStores, services, APIs, and repositories
Status: 15 added / 15 removed / 2 unchanged Utilities & Hooks — 550 kB (baseline 549 kB) • 🔴 +329 BHelpers, composables, and utility bundles
Status: 21 added / 21 removed / 16 unchanged Vendor & Third-Party — 18.1 MB (baseline 18.1 MB) • 🔴 +6.21 kBExternal libraries and shared vendor chunks
Status: 1 added / 1 removed / 17 unchanged Other — 15.1 MB (baseline 15.1 MB) • 🔴 +42.3 kBBundles that do not match a named category
Status: 110 added / 109 removed / 181 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-25T05:54:42.705Z",
"gitSha": "f2192fde2282e42db285053e92383e568b993988",
"branch": "integration/embedded-checkout-frontend",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2023.0169999999816,
"styleRecalcs": 7,
"styleRecalcDurationMs": 5.960000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 483.463,
"heapDeltaBytes": -5974240,
"heapUsedBytes": 63225688,
"domNodes": -283,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 7.967000000000002,
"eventListeners": -185,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-idle",
"durationMs": 2038.7719999999945,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.657999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 477.37999999999994,
"heapDeltaBytes": -12968404,
"heapUsedBytes": 55953196,
"domNodes": -282,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 7.809,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2356.54999999997,
"styleRecalcs": 79,
"styleRecalcDurationMs": 42.556999999999995,
"layouts": 12,
"layoutDurationMs": 3.815,
"taskDurationMs": 1344.683,
"heapDeltaBytes": -10361652,
"heapUsedBytes": 58588792,
"domNodes": -281,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 176.047,
"eventListeners": -185,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2174.6540000000323,
"styleRecalcs": 77,
"styleRecalcDurationMs": 38.187,
"layouts": 12,
"layoutDurationMs": 3.1650000000000005,
"taskDurationMs": 1210.4430000000002,
"heapDeltaBytes": 3541616,
"heapUsedBytes": 66473236,
"domNodes": -284,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 160.85000000000002,
"eventListeners": -185,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1767.201,
"styleRecalcs": 30,
"styleRecalcDurationMs": 15.677000000000003,
"layouts": 6,
"layoutDurationMs": 0.673,
"taskDurationMs": 341.32,
"heapDeltaBytes": 4160500,
"heapUsedBytes": 72774604,
"domNodes": 75,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 9.479000000000001,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1721.243999999956,
"styleRecalcs": 32,
"styleRecalcDurationMs": 15.375,
"layouts": 6,
"layoutDurationMs": 0.5440000000000002,
"taskDurationMs": 343.704,
"heapDeltaBytes": 3969476,
"heapUsedBytes": 73018016,
"domNodes": 77,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 9.909,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 756.0099999999466,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.517000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 417.05,
"heapDeltaBytes": -6842768,
"heapUsedBytes": 62187084,
"domNodes": 18,
"jsHeapTotalBytes": 6291456,
"scriptDurationMs": 31.251,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 706.8140000000085,
"styleRecalcs": 9,
"styleRecalcDurationMs": 5.512999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 419.369,
"heapDeltaBytes": -6917268,
"heapUsedBytes": 62015528,
"domNodes": 14,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 31.692000000000004,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2056.43299999997,
"styleRecalcs": 5,
"styleRecalcDurationMs": 5.6720000000000015,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 555.3240000000001,
"heapDeltaBytes": -19597508,
"heapUsedBytes": 70785628,
"domNodes": -276,
"jsHeapTotalBytes": -1318912,
"scriptDurationMs": 42.274,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-idle",
"durationMs": 2070.577000000071,
"styleRecalcs": 5,
"styleRecalcDurationMs": 4.778,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 569.523,
"heapDeltaBytes": -18607608,
"heapUsedBytes": 71903024,
"domNodes": -275,
"jsHeapTotalBytes": -532480,
"scriptDurationMs": 39.638000000000005,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 3308.357000000001,
"styleRecalcs": 65,
"styleRecalcDurationMs": 10.358,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2619.446,
"heapDeltaBytes": -7031380,
"heapUsedBytes": 84477948,
"domNodes": -278,
"jsHeapTotalBytes": 217088,
"scriptDurationMs": 949.662,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666696,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 3336.7430000000695,
"styleRecalcs": 65,
"styleRecalcDurationMs": 10.147000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2726.5660000000003,
"heapDeltaBytes": -4762144,
"heapUsedBytes": 87149468,
"domNodes": -278,
"jsHeapTotalBytes": 479232,
"scriptDurationMs": 1014.5059999999999,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "large-graph-zoom",
"durationMs": 4295.7380000000285,
"styleRecalcs": 66,
"styleRecalcDurationMs": 10.369,
"layouts": 60,
"layoutDurationMs": 7.004,
"taskDurationMs": 2457.8819999999996,
"heapDeltaBytes": 7693528,
"heapUsedBytes": 74222216,
"domNodes": 24,
"jsHeapTotalBytes": 2097152,
"scriptDurationMs": 859.07,
"eventListeners": 12,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 4335.510999999997,
"styleRecalcs": 66,
"styleRecalcDurationMs": 10.558000000000002,
"layouts": 60,
"layoutDurationMs": 6.836,
"taskDurationMs": 2532.762,
"heapDeltaBytes": -4487272,
"heapUsedBytes": 67949044,
"domNodes": -235,
"jsHeapTotalBytes": -1093632,
"scriptDurationMs": 864.271,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "legacy-node-drag",
"durationMs": 3187.4210000000858,
"styleRecalcs": 41,
"styleRecalcDurationMs": 5.232999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2054.2670000000003,
"heapDeltaBytes": -2101892,
"heapUsedBytes": 70695864,
"domNodes": -288,
"jsHeapTotalBytes": -831488,
"scriptDurationMs": 200.006,
"eventListeners": -1,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3232.2530000000143,
"styleRecalcs": 42,
"styleRecalcDurationMs": 6.099999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2070.2369999999996,
"heapDeltaBytes": -2016576,
"heapUsedBytes": 71046264,
"domNodes": -286,
"jsHeapTotalBytes": -831488,
"scriptDurationMs": 207.92100000000002,
"eventListeners": 29,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666636,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2029.6120000000428,
"styleRecalcs": 3,
"styleRecalcDurationMs": 2.8469999999999986,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 542.4309999999999,
"heapDeltaBytes": -20137236,
"heapUsedBytes": 72415424,
"domNodes": -273,
"jsHeapTotalBytes": -1318912,
"scriptDurationMs": 33.186,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2053.809000000001,
"styleRecalcs": 4,
"styleRecalcDurationMs": 3.530000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 544.7420000000001,
"heapDeltaBytes": -18905772,
"heapUsedBytes": 73396144,
"domNodes": -275,
"jsHeapTotalBytes": -1581056,
"scriptDurationMs": 31.791000000000007,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 705.8639999999059,
"styleRecalcs": 46,
"styleRecalcDurationMs": 9.501,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 501.271,
"heapDeltaBytes": 18084368,
"heapUsedBytes": 87716056,
"domNodes": 18,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 133.86900000000003,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 697.5980000000845,
"styleRecalcs": 46,
"styleRecalcDurationMs": 9.491,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 506.59600000000006,
"heapDeltaBytes": 17599924,
"heapUsedBytes": 88037024,
"domNodes": 18,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 136.28600000000003,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2021.808999999962,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.722000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 470.77000000000004,
"heapDeltaBytes": -12726040,
"heapUsedBytes": 56895288,
"domNodes": -297,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 6.754,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2022.297999999978,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.704,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 462.529,
"heapDeltaBytes": -12146188,
"heapUsedBytes": 58120276,
"domNodes": -298,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 6.860999999999999,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1837.5720000000229,
"styleRecalcs": 76,
"styleRecalcDurationMs": 35.431,
"layouts": 16,
"layoutDurationMs": 4.474,
"taskDurationMs": 1082.062,
"heapDeltaBytes": 13813176,
"heapUsedBytes": 76503816,
"domNodes": -297,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 113.64699999999999,
"eventListeners": -233,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1825.6470000000036,
"styleRecalcs": 75,
"styleRecalcDurationMs": 35.525,
"layouts": 16,
"layoutDurationMs": 4.321999999999999,
"taskDurationMs": 1076.7799999999997,
"heapDeltaBytes": -2848908,
"heapUsedBytes": 67255980,
"domNodes": -298,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 113.253,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 1399.9350000000277,
"styleRecalcs": 19,
"styleRecalcDurationMs": 31.648999999999997,
"layouts": 14,
"layoutDurationMs": 14.578000000000001,
"taskDurationMs": 912.8739999999998,
"heapDeltaBytes": -7446844,
"heapUsedBytes": 87400932,
"domNodes": 13671,
"jsHeapTotalBytes": 10747904,
"scriptDurationMs": 29.994999999999994,
"eventListeners": 2381,
"totalBlockingTimeMs": 135,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 12315.66900000007,
"styleRecalcs": 246,
"styleRecalcDurationMs": 33.407,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9077.515000000001,
"heapDeltaBytes": 8364284,
"heapUsedBytes": 98529488,
"domNodes": -278,
"jsHeapTotalBytes": 3067904,
"scriptDurationMs": 3187.9390000000003,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 12436.083999999937,
"styleRecalcs": 248,
"styleRecalcDurationMs": 34.518,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9465.017,
"heapDeltaBytes": 6053604,
"heapUsedBytes": 96534164,
"domNodes": -280,
"jsHeapTotalBytes": 5951488,
"scriptDurationMs": 3399.451,
"eventListeners": -159,
"totalBlockingTimeMs": 18,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 16579.931999999986,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15772.357,
"heapDeltaBytes": -24133444,
"heapUsedBytes": 176216944,
"domNodes": -6548,
"jsHeapTotalBytes": 4288512,
"scriptDurationMs": 296.625,
"eventListeners": -7473,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333237,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 16603.202000000012,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15874.127,
"heapDeltaBytes": -27476544,
"heapUsedBytes": 176813660,
"domNodes": -6548,
"jsHeapTotalBytes": 249856,
"scriptDurationMs": 296.818,
"eventListeners": -7473,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 20631.198999999924,
"styleRecalcs": 176,
"styleRecalcDurationMs": 17.14299999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20264.308,
"heapDeltaBytes": -27487300,
"heapUsedBytes": 177233232,
"domNodes": -6548,
"jsHeapTotalBytes": 1064960,
"scriptDurationMs": 933.4419999999999,
"eventListeners": -7469,
"totalBlockingTimeMs": 46,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 20891.089999999964,
"styleRecalcs": 175,
"styleRecalcDurationMs": 16.941999999999986,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20499.965000000004,
"heapDeltaBytes": -27311476,
"heapUsedBytes": 178809284,
"domNodes": -6548,
"jsHeapTotalBytes": 249856,
"scriptDurationMs": 969.481,
"eventListeners": -7467,
"totalBlockingTimeMs": 15,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 141.18700000005902,
"styleRecalcs": 12,
"styleRecalcDurationMs": 19.77,
"layouts": 7,
"layoutDurationMs": 1.8970000000000002,
"taskDurationMs": 120.10700000000001,
"heapDeltaBytes": 3768236,
"heapUsedBytes": 69897204,
"domNodes": 137,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 6.754,
"eventListeners": 25,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "workflow-execution",
"durationMs": 452.4750000000495,
"styleRecalcs": 12,
"styleRecalcDurationMs": 17.326999999999998,
"layouts": 2,
"layoutDurationMs": 0.41999999999999993,
"taskDurationMs": 108.021,
"heapDeltaBytes": 5472692,
"heapUsedBytes": 71921564,
"domNodes": 119,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 6.538,
"eventListeners": 97,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
}
]
}🌐 Website E2ETip All tests passed.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Status update (2026-08-04):
Cloud's preview environments now pin this tip ( |
|
Updating Playwright Expectations |
There was a problem hiding this comment.
Actionable comments posted: 15
🤖 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/assets/css/style.css`:
- Around line 3-10: Update the .p-toast rule to use pointer-events: none, and
add a pointer-events: auto rule for the toast message element so only visible
toast surfaces remain interactive while transparent container areas pass clicks
through.
In `@src/platform/workspace/api/workspaceApi.test.ts`:
- Around line 460-472: Extend the previewSubscribe() test to also call it
without a promotionCode and assert the resulting POST payload excludes
promotion_code entirely. Keep the existing supplied-code assertion, and verify
the no-promotion request path prevents blank or stale promotion values from
being sent.
In
`@src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue`:
- Around line 480-498: Update amountDueCents to derive directly from
previewData.amount_due_cents, using the existing zero fallback for missing quote
data. Remove the unused totalDueTodayUsd computed value and leave totalDueToday
and formatQuoteMoney unchanged.
- Around line 234-263: Update the button visibility conditions around the retry
button and the actionUrl button so only one verification action renders when
authenticationState is requires_action, canRetryAuthentication is true, and
actionUrl is present. Preserve retryAuthentication as the sole action for that
state while retaining openVerification for actionUrl cases that do not use the
retry flow.
- Around line 138-153: Update the promotionCode input in
SubscriptionAddPaymentPreviewWorkspace to provide a persistent accessible name,
such as an associated visible label or an appropriate aria-label, while
preserving its existing placeholder and behavior.
In
`@src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vue`:
- Around line 310-319: Reset collectingNewPaymentMethod when checkoutStep
transitions away from preview, including the handleBackToPricing flow, so
returning to the confirm step repopulates savedMethodsForConfirm and restores
the saved-method layout. Keep selectSavedPaymentMethod behavior unchanged for
explicit saved-method and new-method selections.
In
`@src/platform/workspace/components/SubscriptionRequiredDialogContentWorkspace.vue`:
- Around line 90-97: Update SubscriptionRequiredDialogContentWorkspace to
destructure quoteIsCurrent from useSubscriptionCheckout and forward it as
quote-is-current to both workspace preview components, so their confirm actions
can enable correctly. If this flow supports the payment-element paths, also
forward use-payment-element, saved-methods, and selected-saved-method-id to both
components.
In
`@src/platform/workspace/components/SubscriptionTransitionPreviewWorkspace.vue`:
- Around line 198-203: Add a localized aria-label to the promotion-code input
bound to promotionCode, using the existing subscription translation namespace
and a suitable promotion-code label key. Keep the current placeholder, v-model,
and invalidateQuote behavior unchanged.
In `@src/platform/workspace/components/UnifiedStripePaymentSelector.vue`:
- Around line 13-18: Add the ARIA alert role to the error container div in
UnifiedStripePaymentSelector.vue that conditionally displays the
configurationError. Include role="alert" on the div element with the
v-if="configurationError" condition to ensure screen readers announce payment
configuration and submission errors to assistive technology users, following the
same pattern already established in SubscriptionAddPaymentPreviewWorkspace.vue.
- Around line 29-31: In the icon element within UnifiedStripePaymentSelector.vue
that renders the shield-check icon, replace the class text-success-foreground
with text-(--success-foreground) to use the CSS token form instead of the
descoped foreground alias utility.
- Around line 105-152: The stripe.elements() call in onMounted captures
amountCents and currency once, but these props can change when a promotion code
is applied in the parent component (SubscriptionAddPaymentPreviewWorkspace.vue).
When the amount changes, the Stripe element must be refreshed to reflect the
updated total. Add a watcher that monitors both amountCents and currency props,
and when either changes, call the update method on stripeElements.value with the
new amount and currency values to keep the Stripe element in sync with the
current quote state.
In `@src/platform/workspace/composables/useSubscriptionCheckout.test.ts`:
- Around line 433-487: Add a test alongside the existing promotion checkout test
that loads the preview via handleSubscribeClick, calls invalidateQuote before
handleConfirmTransition, and verifies mockSubscribe is not called. Assert
mockToastAdd receives an object whose detail is
subscription.preview.applyQuoteBeforeContinuing, covering the quoteIsCurrent
guard in the subscription confirmation flow.
In `@src/platform/workspace/composables/useSubscriptionCheckout.ts`:
- Around line 830-859: Update recoverStaleQuote to use the existing hasErrorCode
helper for SUBSCRIPTION_QUOTE_STALE matching, removing the local
instanceof/property checks so plain objects with the code are recovered
consistently. Replace the try/catch and throw-on-false flow around
applyPromotionCode with a direct boolean conditional: show the stale-quote toast
when it succeeds, otherwise call handleBackToPricing and show the refresh-failed
toast.
In `@src/platform/workspace/stores/billingOperationStore.ts`:
- Around line 569-583: Update handleReconciliationNeeded to emit
telemetry?.trackBillingEvent like handleFailure and handleTimeout, passing the
same operation context and recording reconciliation_needed as failure_category.
Ensure the telemetry type accepts this category, extending the closed union if
necessary, while preserving the existing cleanup and terminal-resolution flow.
- Around line 350-358: Move the loadStripe call in the authentication flow into
the existing try/catch so rejected Stripe.js loading is handled by the
established error path. Ensure the catch invokes setAuthenticationRetry for
opId, restoring the retry state instead of leaving authentication flags active.
🪄 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: 2e1e93e1-8308-4fea-bd20-4ca20cef3634
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (32)
.env_exampleapps/website/e2e/minimax.spec.tsapps/website/src/templates/model-launch/modelLaunchPages.test.tsbrowser_tests/fixtures/data/cloudWorkspace.tsbrowser_tests/tests/dialogs/pricingTableDeepLink.spec.tspackage.jsonpackages/ingest-types/src/index.tspackages/ingest-types/src/types.gen.tspackages/ingest-types/src/zod.gen.tspnpm-workspace.yamlsrc/assets/css/style.csssrc/components/dialog/GlobalDialog.test.tssrc/locales/en/main.jsonsrc/platform/cloud/subscription/composables/useSubscriptionDialog.tssrc/platform/workspace/api/workspaceApi.test.tssrc/platform/workspace/api/workspaceApi.tssrc/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.test.tssrc/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vuesrc/platform/workspace/components/SubscriptionRequiredDialogContentUnified.test.tssrc/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vuesrc/platform/workspace/components/SubscriptionRequiredDialogContentWorkspace.vuesrc/platform/workspace/components/SubscriptionSuccessWorkspace.vuesrc/platform/workspace/components/SubscriptionTransitionPreviewWorkspace.test.tssrc/platform/workspace/components/SubscriptionTransitionPreviewWorkspace.vuesrc/platform/workspace/components/SubscriptionTransitionPreviewWorkspaceReactivation.test.tssrc/platform/workspace/components/UnifiedStripePaymentSelector.test.tssrc/platform/workspace/components/UnifiedStripePaymentSelector.vuesrc/platform/workspace/composables/useSubscriptionCheckout.test.tssrc/platform/workspace/composables/useSubscriptionCheckout.tssrc/platform/workspace/stores/billingOperationStore.test.tssrc/platform/workspace/stores/billingOperationStore.tssrc/vite-env.d.ts
There was a problem hiding this comment.
Actionable comments posted: 30
🤖 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/assets/css/style.css`:
- Around line 3-10: Ensure the `.p-toast` pointer-events override takes
precedence over PrimeVue theme styles regardless of stylesheet load order.
Update the `.p-toast` rule in the stylesheet to use stronger specificity or
`!important`, while preserving `pointer-events: auto` so toast controls remain
interactive during modal state.
In `@src/platform/workspace/api/workspaceApi.test.ts`:
- Around line 460-472: Add an unapplied-promotion test alongside
previewSubscribe() that calls workspaceApi.previewSubscribe without a
promotionCode, then assert the posted payload’s promotion_code is absent or
undefined per the API contract. Keep the existing applied-code assertion
unchanged and use the same mockAxiosInstance.post setup.
In
`@src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue`:
- Around line 234-263: Update the retry button condition in the component’s
authentication-state button block so it is rendered only when no actionUrl is
available, preventing it from appearing alongside the openVerification button;
keep the existing actionUrl button behavior unchanged.
- Line 350: Replace the manually declared selectedSavedMethodId prop and
update:selectedSavedMethodId emit with defineModel<string |
null>('selectedSavedMethodId') in the component’s script setup. Update
references to use the model value while preserving the add-new branch in the
selectedMethod setter.
- Around line 138-153: The promotion-code inputs in
src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue:138-153
and
src/platform/workspace/components/SubscriptionTransitionPreviewWorkspace.vue:197-212
must emit invalidateQuote only when promotionCode differs from
previewData?.promotion_code, while preserving the existing applyPromotionCode
behavior. Add an aria-label to both inputs using the
subscription.preview.promoCodePlaceholder translation, or extract both fields
into a shared component implementing these changes.
- Around line 139-144: Update the promotion-code input in
SubscriptionAddPaymentPreviewWorkspace to include an aria-label using the
existing subscription.preview.promoCodePlaceholder translation key, while
preserving its current placeholder and input behavior.
- Around line 500-516: Update the renewalTerms computed formatter to pass
timeZone: 'UTC' in the toLocaleDateString options, matching
SubscriptionTransitionPreviewWorkspace.formatDate and preserving the intended
UTC calendar date.
- Line 498: Update the amountDueCents computed property to read the cent amount
directly from its source value instead of multiplying totalDueTodayUsd.value by
100 and rounding. Identify the underlying cents value that totalDueTodayUsd is
derived from, and have amountDueCents reference that source directly to avoid
the unnecessary float conversion round-trip and Math.round call.
- Around line 265-273: Update the UnifiedStripePaymentSelector render condition
in SubscriptionAddPaymentPreviewWorkspace to require a complete quote with a
present currency and positive amountDueCents before rendering. Preserve the
existing captureMode requirement, and pass the validated quote currency without
falling back to an empty string.
In
`@src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vue`:
- Around line 234-246: Move the useSubscriptionCheckout destructuring, including
savedPaymentMethods, checkoutStep, and previewVariant, above the
savedMethodsForConfirm and isEmbeddedPaymentStep computed declarations. Keep the
computed logic unchanged while ensuring all referenced bindings are initialized
before these computeds are created.
- Around line 31-36: Update the keydown listener near handleBackToPricing so
Backspace navigation during checkoutStep === 'preview' also requires
!isEmbeddedPaymentStep and !isEmbeddedConfirmStep, matching the Button v-if
conditions and preventing navigation when the back button is hidden.
- Around line 336-356: Update the watcher around checkoutStep and
savedMethodsForConfirm to guard both window.matchMedia and el.animate before
invoking them, while preserving the reduced-motion early return and height
animation behavior when those APIs are available.
In
`@src/platform/workspace/components/SubscriptionRequiredDialogContentWorkspace.vue`:
- Around line 90-97: Bind quoteIsCurrent from the composable to both
SubscriptionAddPaymentPreviewWorkspace and
SubscriptionTransitionPreviewWorkspace usages, and include quoteIsCurrent in the
composable destructuring so each child receives the current value instead of its
false default.
In `@src/platform/workspace/components/SubscriptionSuccessWorkspace.vue`:
- Around line 45-60: Remove the unused promoApplied prop and the conditional
promotion paragraph from SubscriptionSuccessWorkspace, including its
promoApplied translation references, since no current caller provides the data.
Leave the existing subscription-success content and dark-surface behavior
unchanged.
In
`@src/platform/workspace/components/SubscriptionTransitionPreviewWorkspace.test.ts`:
- Around line 71-81: The quote fixture’s defaults are inconsistent:
amount_due_cents should use result.cost_today_cents, and overrides must be
re-spread after applying defaults so explicitly undefined fields can clear
generated values. Update the fixture return in
SubscriptionTransitionPreviewWorkspace.test.ts to match the reactivation
fixture’s ordering and fallback behavior, while preserving explicit override
values.
In
`@src/platform/workspace/components/SubscriptionTransitionPreviewWorkspace.vue`:
- Around line 187-196: Update the total-due display around exactAmountDue so an
unavailable quote renders a clear placeholder or explicit unavailable message
instead of an empty value. Keep the existing exact amount rendering when
previewData.amount_due_cents is present, and ensure the fallback communicates
why confirmation may be unavailable.
- Around line 215-264: Extract the duplicated reconciliation and verification
footer markup into a shared component accepting authenticationState,
authenticationError, canRetryAuthentication, isAuthenticating,
reconciliationOperationId, and actionUrl, emitting retryAuthentication, and
rendering only one verification action when requires_action is active. Update
src/platform/workspace/components/SubscriptionTransitionPreviewWorkspace.vue#L215-L264
and
src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue#L234-L263
to use it, and remove the local verificationRecoveryActive duplicate in
SubscriptionAddPaymentPreviewWorkspace.vue#L388-L393.
- Around line 602-614: Move formatQuoteMoney out of
SubscriptionTransitionPreviewWorkspace.vue and
SubscriptionAddPaymentPreviewWorkspace.vue into a shared module, then import and
reuse it in both components. Update the formatter to accept the active i18n
locale and pass that locale to Intl.NumberFormat, preserving the existing
currency and cents-to-major-unit behavior while keeping exactAmountDue
unchanged.
In
`@src/platform/workspace/components/SubscriptionTransitionPreviewWorkspaceReactivation.test.ts`:
- Around line 548-570: The test combines clearing all quote fields with passing
quoteIsCurrent as false, but only quoteIsCurrent controls the disabled state,
leaving the missing-quote render path untested. Modify the existing test to
focus on the quoteIsCurrent: false case by populating the quote fields in
makePreview while keeping the third parameter (quoteIsCurrent) as false. Then
add a second test case that reverses this: keep quoteIsCurrent as true by
changing the third makePreview parameter to true, but clear the quote fields as
currently done, and assert the resulting total display instead of checking the
button disabled state.
In `@src/platform/workspace/components/UnifiedStripePaymentSelector.test.ts`:
- Around line 82-150: Extend the UnifiedStripePaymentSelector tests around
renderSelector with three cases covering the gated checkout paths: verify
canSubmit: false leaves the pay button disabled and emits no confirmation,
verificationPending: true demotes the pay button, and an absent
VITE_STRIPE_PUBLISHABLE_KEY renders “Stripe is unavailable” without calling
loadStripe. Configure each scenario through the existing renderSelector options
and reset relevant Stripe/environment mocks between cases.
In `@src/platform/workspace/components/UnifiedStripePaymentSelector.vue`:
- Around line 29-31: Update the icon element in UnifiedStripePaymentSelector to
replace the descoped text-success-foreground alias with the project’s
arbitrary-value success foreground token utility, preserving the existing icon
sizing and layout classes.
- Around line 92-103: Wrap the code inside the onMounted callback in a try/catch
block to handle potential rejections from loadStripe. In the catch block, set
configurationError.value to t('subscription.preview.stripeUnavailable') so users
see an error message when the Stripe script fails to load due to network issues,
content blockers, or CSP rules. Keep the existing conditional checks for
publishableKey, amountCents, stripe, paymentElementTarget.value, and isUnmounted
within the try block unchanged.
- Around line 105-110: The UnifiedStripePaymentSelector component must update
the existing Stripe Elements instance when the quote changes. Add a watcher for
amountCents and currency that calls stripeElements.value.update with the latest
amount and normalized currency, while preserving the existing initialization in
onMounted.
In `@src/platform/workspace/composables/useSubscriptionCheckout.test.ts`:
- Around line 489-531: Add a new test case in useSubscriptionCheckout.test.ts
that covers the failure scenario of recoverStaleQuote by setting up
mockPreviewSubscribe to either reject or return allowed: false when the refresh
is attempted after a SUBSCRIPTION_QUOTE_STALE error from mockSubscribe. After
calling handleConfirmTransition, assert that checkoutStep.value returns to
'pricing' (not remaining at 'preview') and that a toast with detail matching
'subscription.quoteRefreshFailed' was added, validating the fixed behavior where
handleBackToPricing completes successfully.
- Around line 183-196: Replace the inline mockSubscriptionActionOperation shape
with a Partial of the production operation type, importing
BillingAuthenticationState, OperationStatus, and the operation type from the
existing workspace API definitions as needed. Widen the mock to support all
production authentication and status values, then add fixtures covering the
requires_action isPolling branch and the
reconciliation_needed/reconciliationOperationId branch in
useSubscriptionCheckout.
In `@src/platform/workspace/composables/useSubscriptionCheckout.ts`:
- Around line 850-857: Replace the handleBackToPricing() call in the
recoverStaleQuote catch block with resetToPricing(), so recovery navigates to
pricing even while isSubscribing.value remains true. Keep the existing error
toast unchanged.
- Around line 762-765: Route both direct previewData.value assignments in
assertReactivationAmountUnchanged and refreshExpiredProrationQuote through
installPreview instead, preserving the fetched preview data while marking it
current. This must satisfy the quote guards in the submit flows, including
handleTeamSubscription, so reactivation can proceed after the user re-confirms.
- Around line 766-777: Extract the duplicated payment and quote option
construction into a shared buildPaymentOptions helper in
src/platform/workspace/composables/useSubscriptionCheckout.ts, preserving
confirmationToken versus savedPaymentMethodId selection, promotion-code
precedence, and exact-quote fields. At
src/platform/workspace/composables/useSubscriptionCheckout.ts:766-777, spread
the helper result into subscribe; apply the same replacement at :1063-1074 while
keeping teamCreditStopId and billingCycle at the team call site.
In `@src/platform/workspace/stores/billingOperationStore.test.ts`:
- Around line 96-105: Add a test in the billing operation store test suite
covering runPaymentIntentAction when Stripe cannot load, using
mockLoadStripe.mockResolvedValue(null) or an empty publishable key. Start an
operation requiring authentication, advance the timers, and assert it becomes
failed_retryable with isAuthenticating false and the
billingOperation.authenticationUnavailable error message.
In `@src/platform/workspace/stores/billingOperationStore.ts`:
- Around line 401-408: Update updateOperationActionUrl to call updateOperation
with the operation ID and action-URL patch instead of duplicating the
operations.value map-copy assignment. Keep updateOperation as the single owner
of writes to operations.
🪄 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: 83948c01-3933-4eeb-a4f6-51514124e518
⛔ Files ignored due to path filters (7)
browser_tests/tests/interaction.spec.ts-snapshots/default-chromium-2x-linux.pngis excluded by!**/*.pngbrowser_tests/tests/mobileBaseline.spec.ts-snapshots/mobile-default-workflow-mobile-chrome-linux.pngis excluded by!**/*.pngbrowser_tests/tests/mobileBaseline.spec.ts-snapshots/mobile-graph-canvas-toolbar-mobile-chrome-linux.pngis excluded by!**/*.pngbrowser_tests/tests/rerouteNode.spec.ts-snapshots/native-reroute-alt-click-chromium-0-5x-linux.pngis excluded by!**/*.pngbrowser_tests/tests/rerouteNode.spec.ts-snapshots/native-reroute-alt-click-chromium-2x-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/nodeStates/mute.spec.ts-snapshots/vue-node-muted-state-chromium-linux.pngis excluded by!**/*.pngpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (32)
.env_exampleapps/website/e2e/minimax.spec.tsapps/website/src/templates/model-launch/modelLaunchPages.test.tsbrowser_tests/fixtures/data/cloudWorkspace.tsbrowser_tests/tests/dialogs/pricingTableDeepLink.spec.tspackage.jsonpackages/ingest-types/src/index.tspackages/ingest-types/src/types.gen.tspackages/ingest-types/src/zod.gen.tspnpm-workspace.yamlsrc/assets/css/style.csssrc/components/dialog/GlobalDialog.test.tssrc/locales/en/main.jsonsrc/platform/cloud/subscription/composables/useSubscriptionDialog.tssrc/platform/workspace/api/workspaceApi.test.tssrc/platform/workspace/api/workspaceApi.tssrc/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.test.tssrc/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vuesrc/platform/workspace/components/SubscriptionRequiredDialogContentUnified.test.tssrc/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vuesrc/platform/workspace/components/SubscriptionRequiredDialogContentWorkspace.vuesrc/platform/workspace/components/SubscriptionSuccessWorkspace.vuesrc/platform/workspace/components/SubscriptionTransitionPreviewWorkspace.test.tssrc/platform/workspace/components/SubscriptionTransitionPreviewWorkspace.vuesrc/platform/workspace/components/SubscriptionTransitionPreviewWorkspaceReactivation.test.tssrc/platform/workspace/components/UnifiedStripePaymentSelector.test.tssrc/platform/workspace/components/UnifiedStripePaymentSelector.vuesrc/platform/workspace/composables/useSubscriptionCheckout.test.tssrc/platform/workspace/composables/useSubscriptionCheckout.tssrc/platform/workspace/stores/billingOperationStore.test.tssrc/platform/workspace/stores/billingOperationStore.tssrc/vite-env.d.ts
|
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. |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
src/platform/workspace/api/workspaceApi.ts (1)
171-194: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winForward
idempotencyKeyinsubscribe().The generated contract uses
idempotency_keyto prevent duplicate billing operations. Add the option, map it to the request, and add a forwarding test.🤖 Prompt for 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. In `@src/platform/workspace/api/workspaceApi.ts` around lines 171 - 194, Update SubscribeOptions and the subscribe() request mapping to accept and forward idempotencyKey as idempotency_key, preserving the generated contract’s naming. Add a forwarding test verifying the option reaches the request payload.src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vue (1)
359-377: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winBackspace still navigates back after the back button is hidden.
Lines 31-36 hide the back button when
isEmbeddedPaymentSteporisEmbeddedConfirmStepis true. Thekeydownlistener at Line 359 still callshandleBackToPricingforBackspacewhenevercheckoutStep === 'preview'.The Stripe Payment Element renders inside an iframe, so
event.targetis not one of the editable elements excluded at Lines 367-374. A Backspace press outside the iframe discards entered card details. That is the exact outcomedismissableMask: falseinuseSubscriptionDialog.tswas added to prevent.Add the same embedded-step conditions to the keyboard handler.
🐛 Proposed fix
useEventListener(window, 'keydown', (event: KeyboardEvent) => { if ( event.key !== 'Backspace' || checkoutStep.value !== 'preview' || + isEmbeddedPaymentStep.value || + isEmbeddedConfirmStep.value || isPolling.value ) return🤖 Prompt for 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. In `@src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vue` around lines 359 - 377, Add the existing isEmbeddedPaymentStep and isEmbeddedConfirmStep guards to the Backspace keydown handler in useEventListener, so it returns before handleBackToPricing when either embedded step is active; preserve the current preview, polling, and editable-target checks for all other cases.src/platform/workspace/composables/useSubscriptionCheckout.ts (1)
336-337: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winRoute the remaining direct
previewData.valueassignments throughinstallPreview.Line 337 and Line 456 assign
previewData.valuewithout settingquoteIsCurrent. Both assign a preview thatpreviewSubscribejust returned, so the quote is current by definition.After either assignment, the guard at Lines 774-776 and the identical guard at Lines 1072-1074 throw
subscription.preview.applyQuoteBeforeContinuingon every later submit. The reactivation screen has no Apply control, so the user cannot clear the flag.🐛 Proposed fix
if (amountChanged || materialChanged) { - previewData.value = freshPreview + installPreview(freshPreview) throw new ReactivationAmountChangedError(const amountChanged = freshPreview.cost_today_cents !== previewData.value?.cost_today_cents - previewData.value = freshPreview + installPreview(freshPreview) toast.add({🤖 Prompt for 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. In `@src/platform/workspace/composables/useSubscriptionCheckout.ts` around lines 336 - 337, Replace the direct previewData.value assignments in the amount/material-change flow and the corresponding assignment near the second previewSubscribe result with calls to installPreview, so each freshly returned preview also sets quoteIsCurrent. Preserve the existing conditions and preview values while ensuring both later submission guards recognize the quote as current.
♻️ Duplicate comments (16)
src/platform/workspace/components/UnifiedStripePaymentSelector.vue (4)
29-31: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReplace
text-success-foregroundwith the token form.The
text-*-foregroundalias utilities are descoped in this repository. Use the arbitrary-value token form.🎨 Proposed fix
<i - class="text-success-foreground mt-0.5 icon-[lucide--shield-check] size-4 shrink-0" + class="mt-0.5 size-4 shrink-0 text-(--success-foreground) icon-[lucide--shield-check]" />Based on learnings: do not use the Tailwind foreground alias utility classes like
text-success-foreground; instead use arbitrary-value CSS tokens such astext-(--success-foreground).🤖 Prompt for 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. In `@src/platform/workspace/components/UnifiedStripePaymentSelector.vue` around lines 29 - 31, Update the icon element in UnifiedStripePaymentSelector to replace the unsupported text-success-foreground utility with the arbitrary-value token form text-(--success-foreground), preserving all other classes and markup.Source: Learnings
13-18: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAnnounce the payment error to assistive technology.
configurationErrorcarries both configuration failures and Stripe submission errors from Lines 198 and 205. The container has no live-region role, so screen reader users receive no announcement after a failed submit. The sibling error banner inSubscriptionAddPaymentPreviewWorkspace.vueat Line 230 already usesrole="alert".♿ Proposed fix
<div v-if="configurationError" + role="alert" class="border-danger-background bg-danger-background/10 text-danger rounded-lg border px-3 py-2 text-sm" >🤖 Prompt for 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. In `@src/platform/workspace/components/UnifiedStripePaymentSelector.vue` around lines 13 - 18, Add role="alert" to the configurationError container in UnifiedStripePaymentSelector so screen readers announce both configuration and Stripe submission errors, matching the existing error-banner behavior.
110-113: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftUpdate the Stripe Elements amount and currency when the quote changes.
stripe.elements()runs once inonMountedand capturesamountCentsandcurrencyat that moment. The parent re-quotes while this component stays mounted:SubscriptionAddPaymentPreviewWorkspace.vuebinds:amount-cents="amountDueCents"and:currency="previewData?.currency ?? ''", and applying a promotion code changespreviewData.amount_due_cents.captureModedoes not change during that refresh, so the element is not remounted.In the deferred-intent pattern the element amount drives the wallet sheets, the Alipay redirect amount, and payment-method eligibility. A stale amount shows the pre-discount total to the customer. Call
elements.update()when the props change.🔧 Proposed fix
-import { onBeforeUnmount, onMounted, ref } from 'vue' +import { onBeforeUnmount, onMounted, ref, watch } from 'vue'onBeforeUnmount(() => { isUnmounted = true paymentElement?.destroy() }) + +watch( + () => [amountCents, currency] as const, + ([nextAmount, nextCurrency]) => { + if (!stripeElements.value || nextAmount <= 0 || !nextCurrency) return + stripeElements.value.update({ + amount: nextAmount, + currency: nextCurrency.toLowerCase() + }) + } +)Stripe.js elements.update amount deferred intent subscription mode🤖 Prompt for 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. In `@src/platform/workspace/components/UnifiedStripePaymentSelector.vue` around lines 110 - 113, Update the UnifiedStripePaymentSelector setup so the existing Stripe Elements instance calls elements.update with the latest amountCents and lowercase currency whenever those props change, including quote and promotion refreshes. Reuse the mounted element rather than remounting it, and ensure the update occurs only after stripeElements.value exists.
104-108: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winHandle a
loadStriperejection.
loadStriperejects when the Stripe script fails to load, for example on a network error, a content blocker, or a CSP rule. The rejection escapes theonMountedcallback as an unhandled promise rejection.configurationErrorstays empty, so the user sees an empty payment area with no message and a permanently disabled pay button, because Line 41 binds:disabled="!stripeElements || !canSubmit".🛡️ Proposed fix
- stripe = await loadStripe(publishableKey) + try { + stripe = await loadStripe(publishableKey) + } catch { + stripe = null + } if (!stripe || !paymentElementTarget.value || isUnmounted) { configurationError.value = t('subscription.preview.stripeUnavailable') return }🤖 Prompt for 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. In `@src/platform/workspace/components/UnifiedStripePaymentSelector.vue` around lines 104 - 108, Handle promise rejection around the loadStripe call in the component’s onMounted initialization flow: catch failures, set configurationError to the existing Stripe-unavailable translation, and return so the UI displays the error instead of leaving the payment area and pay button unusable without feedback. Preserve the existing null, missing-target, and unmounted checks.src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vue (3)
233-269: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDeclare these computeds after the
useSubscriptionCheckoutcall.
savedMethodsForConfirmreadssavedPaymentMethods.isEmbeddedPaymentStep,isEmbeddedConfirmStep, andisEmbeddedSuccessStepreadcheckoutStepandpreviewVariant. All four bindings are created by the destructuring at Line 271.The code works today because the getters run lazily during render, after setup finishes. Any future synchronous read during setup, for example a
watchEffect, throws aReferenceErrorfrom the temporal dead zone.Move the
useSubscriptionCheckoutdestructuring above these computeds.🤖 Prompt for 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. In `@src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vue` around lines 233 - 269, Move the useSubscriptionCheckout destructuring, including savedPaymentMethods, checkoutStep, and previewVariant, above the collectingNewPaymentMethod, savedMethodsForConfirm, isEmbeddedPaymentStep, isEmbeddedConfirmStep, and isEmbeddedSuccessStep declarations so every computed is created after its dependencies are initialized.
335-355: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winGuard the Web Animations API and
matchMediabefore calling them.Line 345 calls
matchMedia(...)and Line 350 callsel.animate(...).happy-domdoes not provideElement.animateby default. This watcher runs on everycheckoutSteptransition, so a component test that moves frompreviewtosuccessthrows inside the async callback and produces an unhandled rejection.Check for both APIs before use.
🛡️ Proposed fix
- if (matchMedia('(prefers-reduced-motion: reduce)').matches) return + if ( + typeof matchMedia === 'function' && + matchMedia('(prefers-reduced-motion: reduce)').matches + ) { + return + } + if (typeof el.animate !== 'function') return🤖 Prompt for 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. In `@src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vue` around lines 335 - 355, Update the watcher around checkoutStep and savedMethodsForConfirm to guard both matchMedia and the element’s animate method before invoking them. Preserve the existing reduced-motion and height-change checks, and return early when either API is unavailable so transitions cannot produce an unhandled rejection in test environments.
309-318: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winReset
collectingNewPaymentMethodwhen the user leaves the preview step.
selectSavedPaymentMethod(null)setscollectingNewPaymentMethodtotrue. Only selecting a saved method by id sets it back tofalse.handleBackToPricingdoes not reset it.A user who chooses "add new payment method", presses the back arrow, and then re-enters the confirm step still sees
savedMethodsForConfirmas empty. The saved card row and the picker stay hidden, and the dialog stays in the wide capture layout. The saved method is unreachable until the dialog is reopened.🐛 Proposed fix
collectingNewPaymentMethod.value = false selectedSavedPaymentMethodId.value = id } + +watch(checkoutStep, (step) => { + if (step !== 'preview') collectingNewPaymentMethod.value = false +})🤖 Prompt for 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. In `@src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vue` around lines 309 - 318, Update handleBackToPricing to reset collectingNewPaymentMethod to false when leaving the preview step, so re-entering confirmation restores savedMethodsForConfirm, the saved-card picker, and the standard layout. Keep selectSavedPaymentMethod behavior unchanged.src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue (5)
510-525: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winPin the timezone for the renewal date.
Line 517 formats
renewal_atin the viewer's local timezone.renewal_atis a UTC timestamp, so a user west of UTC sees the previous calendar day as the renewal date.SubscriptionTransitionPreviewWorkspace.formatDatealready pinstimeZone: 'UTC'for the same field.🐛 Proposed fix
const date = new Date(previewData.renewal_at).toLocaleDateString(undefined, { month: 'short', day: 'numeric', - year: 'numeric' + year: 'numeric', + timeZone: 'UTC' })🤖 Prompt for 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. In `@src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue` around lines 510 - 525, Update the renewalTerms computed property’s Date.toLocaleDateString call to include the UTC timezone, matching SubscriptionTransitionPreviewWorkspace.formatDate, so renewal_at always displays its UTC calendar date.
143-158: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winThe promotion-code input invalidates the quote on every keystroke and has no accessible name.
Line 148 emits
invalidateQuoteon everyinputevent. That clearsquoteIsCurrent, which gates every primary payment action through Lines 281, 291, and 303. A user who types a code and then pays without pressing Apply finds all pay actions disabled and receives no explanation.Line 147 supplies only a
placeholder. A placeholder is not an accessible name and it disappears once the user types.Emit
invalidateQuoteonly when the typed value differs frompreviewData?.promotion_code, and add anaria-labelthat reuses the existing translation key.♿ Proposed fix
<input v-model="promotionCode" class="h-10 min-w-0 flex-1 rounded-lg border border-interface-stroke bg-secondary-background px-3 text-base-foreground" + :aria-label="$t('subscription.preview.promoCodePlaceholder')" :placeholder="$t('subscription.preview.promoCodePlaceholder')" - `@input`="$emit('invalidateQuote')" + `@input`="onPromotionCodeInput" />function onPromotionCodeInput() { if (promotionCode.value === (previewData?.promotion_code ?? '')) return emit('invalidateQuote') }🤖 Prompt for 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. In `@src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue` around lines 143 - 158, Update the promotion-code input handling in SubscriptionAddPaymentPreviewWorkspace so invalidateQuote is emitted only when promotionCode differs from previewData?.promotion_code, preserving the current value without invalidation. Replace the inline input emission with the component’s handler and add an aria-label using the existing subscription.preview.promoCodePlaceholder translation.
272-283: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winDo not render the payment selector with an incomplete quote.
Line 275 forwards an empty string when the quote has no
currency.PreviewSubscribeResponse.currencyis optional.UnifiedStripePaymentSelectorthen callsstripe.elements({ currency: '' }), which Stripe rejects.Line 274 resolves to
0whenamount_due_centsis absent.UnifiedStripePaymentSelectortreatsamountCents <= 0as a configuration failure at its Line 99 and renderssubscription.preview.stripeUnavailable, so the user reaches a dead end with a misleading message.Gate the selector on a complete quote.
🐛 Proposed fix
<UnifiedStripePaymentSelector - v-if="captureMode" + v-if="captureMode && previewData?.currency && amountDueCents > 0" :amount-cents="amountDueCents" - :currency="previewData?.currency ?? ''" + :currency="previewData.currency"🤖 Prompt for 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. In `@src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue` around lines 272 - 283, Update the UnifiedStripePaymentSelector rendering in the captureMode block to require a complete quote: render it only when previewData.amount_due_cents is present and positive and previewData.currency is non-empty. Keep the existing amount and currency bindings, but prevent fallback values from reaching the selector when either required quote field is missing.
360-360: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winUse
defineModelforselectedSavedMethodId.The component declares the
selectedSavedMethodIdprop at Line 360 and the matchingupdate:selectedSavedMethodIdemit at Line 387 by hand.Replace the pair with
defineModel<string | null>('selectedSavedMethodId'). Keep theadd-newbranch in theselectedMethodsetter.As per coding guidelines: "Prefer
defineModelfor v-model bindings".Also applies to: 387-387
🤖 Prompt for 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. In `@src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue` at line 360, Replace the manually declared selectedSavedMethodId prop and matching update:selectedSavedMethodId emit with defineModel<string | null>('selectedSavedMethodId') in the component. Update references to use the resulting model ref while preserving the add-new branch in the selectedMethod setter.Source: Coding guidelines
241-270: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winTwo buttons can render with the same "Complete verification" label.
The button at Line 241 renders when
authenticationState === 'requires_action'andcanRetryAuthenticationis true. For that state its label resolves tosubscription.preview.completeVerification. The button at Line 262 renders whenactionUrlis set and uses the same label.Both conditions hold when the operation requires action and the backend also returns an
actionUrl. The two buttons perform different actions: one emitsretryAuthentication, the other opensactionUrlin a new tab. The user cannot tell them apart.Render one action for the
requires_actionstate.🐛 Proposed fix
<Button - v-if="actionUrl" + v-if="actionUrl && authenticationState !== 'requires_action'" variant="inverted"🤖 Prompt for 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. In `@src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue` around lines 241 - 270, Update the button visibility conditions around the authentication retry button and the actionUrl button so only one action renders when authenticationState is 'requires_action'. Preserve the retryAuthentication button for retryable authentication, and suppress the actionUrl button when requires_action is being handled by the retry flow, while retaining it for other states that provide an actionUrl.src/platform/workspace/composables/useSubscriptionCheckout.ts (2)
777-790: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winExtract the duplicated subscribe payload builder.
Lines 777-790 and Lines 1075-1090 build the same payment and quote options: the
confirmationTokenversussavedPaymentMethodIdchoice, thesubscribeAcceptsSavedMethod()gate, thepromotionCodeprecedence, thehasExactQuotespread, andreturnUrl. This revision addedsubscribeAcceptsSavedMethod()to both copies, which shows the two blocks must be edited together on every change.Extract a
buildPaymentOptions(quote, confirmationToken, promotionCode)helper and spread its result at both call sites. KeepteamCreditStopIdandbillingCycleat the team call site.🤖 Prompt for 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. In `@src/platform/workspace/composables/useSubscriptionCheckout.ts` around lines 777 - 790, Extract the duplicated payment and quote payload construction into a shared buildPaymentOptions(quote, confirmationToken, promotionCode) helper, preserving the confirmationToken versus savedPaymentMethodId selection, subscribeAcceptsSavedMethod() gate, promotion-code precedence, exact-quote fields, and returnUrl. Replace both subscribe payload blocks with the helper result, while retaining teamCreditStopId and billingCycle only at the team call site.
842-871: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winFix the dead-end recovery and reuse the shared error predicate.
Three problems in
recoverStaleQuote:
- Line 863 calls
handleBackToPricing(). That function returns immediately whenisSubscribing.valueistrue.recoverStaleQuoteruns from thecatchblock at Line 824 and Line 1133, before thefinallyblock clearsisSubscribing. The navigation never happens. The user stays on the preview step withquoteIsCurrentset tofalse, so every later submit throwssubscription.preview.applyQuoteBeforeContinuing. CallresetToPricing()instead.- Lines 843-849 re-implement
hasErrorCodefrom Line 372 and additionally requireerror instanceof Error. Use the shared helper so all recovery branches in the samecatchchain agree on one predicate.- Line 856 throws only for the
catchat Line 862 to swallow it.applyPromotionCodealready returns a boolean and handles its own errors.♻️ Proposed fix
async function recoverStaleQuote(error: unknown): Promise<boolean> { - if ( - !(error instanceof Error) || - !('code' in error) || - error.code !== 'SUBSCRIPTION_QUOTE_STALE' - ) { - return false - } + if (!hasErrorCode(error, 'SUBSCRIPTION_QUOTE_STALE')) return false quoteIsCurrent.value = false - try { - const refreshed = await applyPromotionCode( - previewData.value?.promotion_code ?? '', - false - ) - if (!refreshed) throw new Error('quote refresh failed') - toast.add({ - severity: 'error', - summary: t('g.error'), - detail: t('subscription.preview.quoteStale') - }) - } catch { - handleBackToPricing() + const refreshed = await applyPromotionCode( + previewData.value?.promotion_code ?? '', + false + ) + if (!refreshed) { + resetToPricing() toast.add({ severity: 'error', summary: t('g.error'), detail: t('subscription.preview.quoteRefreshFailed') }) + return true } + toast.add({ + severity: 'error', + summary: t('g.error'), + detail: t('subscription.preview.quoteStale') + }) return true }🤖 Prompt for 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. In `@src/platform/workspace/composables/useSubscriptionCheckout.ts` around lines 842 - 871, Update recoverStaleQuote to use the shared hasErrorCode predicate instead of duplicating error checks, call resetToPricing() in the refresh-failure path so recovery can navigate while subscribing, and remove the artificial throw after applyPromotionCode; branch on its boolean result to show the success or refresh-failed toast while preserving the true return value for stale-quote errors.src/platform/workspace/composables/useSubscriptionCheckout.test.ts (2)
183-196: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winWiden the mocked operation shape to the production types.
statusis fixed to'pending'andauthenticationStateto the single literal'failed_retryable'. The production types include'reconciliation_needed'and the fullBillingAuthenticationStateunion.This shape blocks fixtures for two newly added branches: the
requires_actionarm ofisPollingat Lines 178-184 ofuseSubscriptionCheckout.ts, andreconciliationOperationIdat Lines 173-177. Both are untested.Import the production types and widen the mock, then add fixtures for
requires_actionandreconciliation_needed.Based on learnings: "In TypeScript test files, avoid duplicating interface/type definitions. Import real type definitions from the component modules under test and reference them directly."
🤖 Prompt for 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. In `@src/platform/workspace/composables/useSubscriptionCheckout.test.ts` around lines 183 - 196, Import the production operation and authentication-state types used by useSubscriptionCheckout instead of duplicating the inline mock shape, then type mockSubscriptionActionOperation with those definitions. Expand fixtures to cover status 'requires_action', authenticationState 'reconciliation_needed', and reconciliationOperationId so the corresponding isPolling and reconciliation branches are tested.Sources: Path instructions, Learnings
525-567: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for the failed stale-quote refresh and the unapplied-quote guard.
This test covers only the successful refresh arm of
recoverStaleQuote. Two adjacent behaviors have no test:
- The failure arm at Lines 862-869 of
useSubscriptionCheckout.ts. Make the refresh preview reject or returnallowed: false, then assertcheckoutStep.valueand thequoteRefreshFailedtoast. Written against the fixed implementation,checkoutStep.valuemust be'pricing'.- The
quoteIsCurrentguard. CallinvalidateQuote()after the preview loads, then assert thatmockSubscribeis not called and the toast detail issubscription.preview.applyQuoteBeforeContinuing. That guard is the only client-side control that stops a charge against a quote the user changed but never applied.As per path instructions,
.agents/checks/test-quality.mdrequires colocated coverage of promotion, recovery, and reconciliation behavior "including failure, empty, and edge cases".🤖 Prompt for 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. In `@src/platform/workspace/composables/useSubscriptionCheckout.test.ts` around lines 525 - 567, Extend the colocated tests around handleConfirmTransition and recoverStaleQuote to cover a failed stale-quote refresh by rejecting the refresh preview or returning allowed: false, asserting checkoutStep.value is 'pricing' and the quoteRefreshFailed toast. Add a quoteIsCurrent guard test that calls invalidateQuote() after preview loading, then verifies mockSubscribe is not called and the subscription.preview.applyQuoteBeforeContinuing toast is shown.Source: Path instructions
🤖 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/platform/cloud/subscription/utils/paymentReturnUrl.test.ts`:
- Around line 14-22: Add a Vitest case in paymentReturnUrl.test.ts covering
paymentReturnUrl() with an http:// location.origin, while preserving the
existing pathname and stripping search/hash. Assert the expected HTTP return URL
so regressions affecting the non-HTTPS origin branch are detected.
In `@src/platform/workspace/api/workspaceApi.ts`:
- Around line 272-295: Replace the locally declared PreviewSubscribeResponse,
SubscriptionDiscount, SavedPaymentMethod, and BillingOpStatusResponse contracts
in the workspace API module with imports from packages/ingest-types and
re-export those generated types. Remove the duplicate interfaces while
preserving existing consumers, and derive BillingAuthenticationState from the
generated response field when no standalone generated type exists.
---
Outside diff comments:
In `@src/platform/workspace/api/workspaceApi.ts`:
- Around line 171-194: Update SubscribeOptions and the subscribe() request
mapping to accept and forward idempotencyKey as idempotency_key, preserving the
generated contract’s naming. Add a forwarding test verifying the option reaches
the request payload.
In
`@src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vue`:
- Around line 359-377: Add the existing isEmbeddedPaymentStep and
isEmbeddedConfirmStep guards to the Backspace keydown handler in
useEventListener, so it returns before handleBackToPricing when either embedded
step is active; preserve the current preview, polling, and editable-target
checks for all other cases.
In `@src/platform/workspace/composables/useSubscriptionCheckout.ts`:
- Around line 336-337: Replace the direct previewData.value assignments in the
amount/material-change flow and the corresponding assignment near the second
previewSubscribe result with calls to installPreview, so each freshly returned
preview also sets quoteIsCurrent. Preserve the existing conditions and preview
values while ensuring both later submission guards recognize the quote as
current.
---
Duplicate comments:
In
`@src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue`:
- Around line 510-525: Update the renewalTerms computed property’s
Date.toLocaleDateString call to include the UTC timezone, matching
SubscriptionTransitionPreviewWorkspace.formatDate, so renewal_at always displays
its UTC calendar date.
- Around line 143-158: Update the promotion-code input handling in
SubscriptionAddPaymentPreviewWorkspace so invalidateQuote is emitted only when
promotionCode differs from previewData?.promotion_code, preserving the current
value without invalidation. Replace the inline input emission with the
component’s handler and add an aria-label using the existing
subscription.preview.promoCodePlaceholder translation.
- Around line 272-283: Update the UnifiedStripePaymentSelector rendering in the
captureMode block to require a complete quote: render it only when
previewData.amount_due_cents is present and positive and previewData.currency is
non-empty. Keep the existing amount and currency bindings, but prevent fallback
values from reaching the selector when either required quote field is missing.
- Line 360: Replace the manually declared selectedSavedMethodId prop and
matching update:selectedSavedMethodId emit with defineModel<string |
null>('selectedSavedMethodId') in the component. Update references to use the
resulting model ref while preserving the add-new branch in the selectedMethod
setter.
- Around line 241-270: Update the button visibility conditions around the
authentication retry button and the actionUrl button so only one action renders
when authenticationState is 'requires_action'. Preserve the retryAuthentication
button for retryable authentication, and suppress the actionUrl button when
requires_action is being handled by the retry flow, while retaining it for other
states that provide an actionUrl.
In
`@src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vue`:
- Around line 233-269: Move the useSubscriptionCheckout destructuring, including
savedPaymentMethods, checkoutStep, and previewVariant, above the
collectingNewPaymentMethod, savedMethodsForConfirm, isEmbeddedPaymentStep,
isEmbeddedConfirmStep, and isEmbeddedSuccessStep declarations so every computed
is created after its dependencies are initialized.
- Around line 335-355: Update the watcher around checkoutStep and
savedMethodsForConfirm to guard both matchMedia and the element’s animate method
before invoking them. Preserve the existing reduced-motion and height-change
checks, and return early when either API is unavailable so transitions cannot
produce an unhandled rejection in test environments.
- Around line 309-318: Update handleBackToPricing to reset
collectingNewPaymentMethod to false when leaving the preview step, so
re-entering confirmation restores savedMethodsForConfirm, the saved-card picker,
and the standard layout. Keep selectSavedPaymentMethod behavior unchanged.
In `@src/platform/workspace/components/UnifiedStripePaymentSelector.vue`:
- Around line 29-31: Update the icon element in UnifiedStripePaymentSelector to
replace the unsupported text-success-foreground utility with the arbitrary-value
token form text-(--success-foreground), preserving all other classes and markup.
- Around line 13-18: Add role="alert" to the configurationError container in
UnifiedStripePaymentSelector so screen readers announce both configuration and
Stripe submission errors, matching the existing error-banner behavior.
- Around line 110-113: Update the UnifiedStripePaymentSelector setup so the
existing Stripe Elements instance calls elements.update with the latest
amountCents and lowercase currency whenever those props change, including quote
and promotion refreshes. Reuse the mounted element rather than remounting it,
and ensure the update occurs only after stripeElements.value exists.
- Around line 104-108: Handle promise rejection around the loadStripe call in
the component’s onMounted initialization flow: catch failures, set
configurationError to the existing Stripe-unavailable translation, and return so
the UI displays the error instead of leaving the payment area and pay button
unusable without feedback. Preserve the existing null, missing-target, and
unmounted checks.
In `@src/platform/workspace/composables/useSubscriptionCheckout.test.ts`:
- Around line 183-196: Import the production operation and authentication-state
types used by useSubscriptionCheckout instead of duplicating the inline mock
shape, then type mockSubscriptionActionOperation with those definitions. Expand
fixtures to cover status 'requires_action', authenticationState
'reconciliation_needed', and reconciliationOperationId so the corresponding
isPolling and reconciliation branches are tested.
- Around line 525-567: Extend the colocated tests around handleConfirmTransition
and recoverStaleQuote to cover a failed stale-quote refresh by rejecting the
refresh preview or returning allowed: false, asserting checkoutStep.value is
'pricing' and the quoteRefreshFailed toast. Add a quoteIsCurrent guard test that
calls invalidateQuote() after preview loading, then verifies mockSubscribe is
not called and the subscription.preview.applyQuoteBeforeContinuing toast is
shown.
In `@src/platform/workspace/composables/useSubscriptionCheckout.ts`:
- Around line 777-790: Extract the duplicated payment and quote payload
construction into a shared buildPaymentOptions(quote, confirmationToken,
promotionCode) helper, preserving the confirmationToken versus
savedPaymentMethodId selection, subscribeAcceptsSavedMethod() gate,
promotion-code precedence, exact-quote fields, and returnUrl. Replace both
subscribe payload blocks with the helper result, while retaining
teamCreditStopId and billingCycle only at the team call site.
- Around line 842-871: Update recoverStaleQuote to use the shared hasErrorCode
predicate instead of duplicating error checks, call resetToPricing() in the
refresh-failure path so recovery can navigate while subscribing, and remove the
artificial throw after applyPromotionCode; branch on its boolean result to show
the success or refresh-failed toast while preserving the true return value for
stale-quote errors.
🪄 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: 57d7a10d-0129-4261-aa27-ae8ded8267b5
⛔ Files ignored due to path filters (6)
browser_tests/tests/interaction.spec.ts-snapshots/default-chromium-2x-linux.pngis excluded by!**/*.pngbrowser_tests/tests/mobileBaseline.spec.ts-snapshots/mobile-default-workflow-mobile-chrome-linux.pngis excluded by!**/*.pngbrowser_tests/tests/mobileBaseline.spec.ts-snapshots/mobile-graph-canvas-toolbar-mobile-chrome-linux.pngis excluded by!**/*.pngbrowser_tests/tests/rerouteNode.spec.ts-snapshots/native-reroute-alt-click-chromium-0-5x-linux.pngis excluded by!**/*.pngbrowser_tests/tests/rerouteNode.spec.ts-snapshots/native-reroute-alt-click-chromium-2x-linux.pngis excluded by!**/*.pngpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (38)
.env_exampleapps/website/src/components/product/local/MobileDownloadEmailForm.vueapps/website/src/components/ui/icon-button/index.tsbrowser_tests/tests/dialogs/pricingTableDeepLink.spec.tspackage.jsonpackages/ingest-types/src/index.tspackages/ingest-types/src/types.gen.tspackages/ingest-types/src/zod.gen.tspnpm-workspace.yamlsrc/assets/css/style.csssrc/components/dialog/GlobalDialog.test.tssrc/composables/useUrlActionLoaders.test.tssrc/composables/useUrlActionLoaders.tssrc/locales/en/main.jsonsrc/platform/cloud/subscription/composables/usePaymentReturnUrlLoader.test.tssrc/platform/cloud/subscription/composables/usePaymentReturnUrlLoader.tssrc/platform/cloud/subscription/composables/useSubscriptionDialog.tssrc/platform/cloud/subscription/utils/paymentReturnUrl.test.tssrc/platform/cloud/subscription/utils/paymentReturnUrl.tssrc/platform/cloud/subscription/utils/teamSubscriptionCheckoutUtil.tssrc/platform/workspace/api/workspaceApi.test.tssrc/platform/workspace/api/workspaceApi.tssrc/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.test.tssrc/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vuesrc/platform/workspace/components/SubscriptionRequiredDialogContentUnified.test.tssrc/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vuesrc/platform/workspace/components/SubscriptionRequiredDialogContentWorkspace.vuesrc/platform/workspace/components/SubscriptionSuccessWorkspace.vuesrc/platform/workspace/components/SubscriptionTransitionPreviewWorkspace.test.tssrc/platform/workspace/components/SubscriptionTransitionPreviewWorkspace.vuesrc/platform/workspace/components/SubscriptionTransitionPreviewWorkspaceReactivation.test.tssrc/platform/workspace/components/UnifiedStripePaymentSelector.test.tssrc/platform/workspace/components/UnifiedStripePaymentSelector.vuesrc/platform/workspace/composables/useSubscriptionCheckout.test.tssrc/platform/workspace/composables/useSubscriptionCheckout.tssrc/platform/workspace/stores/billingOperationStore.test.tssrc/platform/workspace/stores/billingOperationStore.tssrc/vite-env.d.ts
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/platform/workspace/composables/useSubscriptionCheckout.ts (1)
346-348: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winTwo paths assign
previewData.valuedirectly and leavequoteIsCurrentfalse. OnlyinstallPreviewsetsquoteIsCurrenttotrue. Both sites install a freshly fetched, allowed preview and then surface a drift error, so the user re-confirms. On the next attempt the submit guards at Line 784 and Line 1082 throwsubscription.preview.applyQuoteBeforeContinuing, and the reactivation screen has no Apply control to clear the flag. Every later submit fails the same way, on both the personal and the team reactivation flow.
src/platform/workspace/composables/useSubscriptionCheckout.ts#L346-L348: replacepreviewData.value = freshPreviewin theproration_atbranch ofassertReactivationAmountUnchangedwithinstallPreview(freshPreview).src/platform/workspace/composables/useSubscriptionCheckout.ts#L464-L466: replacepreviewData.value = freshPreviewinrefreshExpiredProrationQuotewithinstallPreview(freshPreview).🤖 Prompt for 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. In `@src/platform/workspace/composables/useSubscriptionCheckout.ts` around lines 346 - 348, Update both preview refresh sites in src/platform/workspace/composables/useSubscriptionCheckout.ts: lines 346-348 in assertReactivationAmountUnchanged and lines 464-466 in refreshExpiredProrationQuote. Replace direct previewData.value assignments with installPreview(freshPreview) so quoteIsCurrent is set consistently before surfacing the drift error.src/platform/workspace/components/UnifiedStripePaymentSelector.vue (1)
29-31: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueReplace
text-success-foregroundwith the token utility.The
text-*-foregroundalias utilities are descoped in this repository. Usetext-(--success-foreground).Based on learnings: do not use the Tailwind foreground alias utility classes like
text-success-foreground; instead use arbitrary-value CSS tokens such astext-(--success-foreground).🎨 Proposed fix
<i - class="text-success-foreground mt-0.5 icon-[lucide--shield-check] size-4 shrink-0" + class="mt-0.5 icon-[lucide--shield-check] size-4 shrink-0 text-(--success-foreground)" />🤖 Prompt for 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. In `@src/platform/workspace/components/UnifiedStripePaymentSelector.vue` around lines 29 - 31, Update the icon element in UnifiedStripePaymentSelector to replace the descoped text-success-foreground utility with the arbitrary token utility text-(--success-foreground), preserving all other classes.Source: Learnings
♻️ Duplicate comments (10)
src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue (3)
241-270: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winTwo buttons can render the same "Complete verification" label.
The retry button at Line 241 renders when
authenticationState === 'requires_action'andcanRetryAuthenticationis true; its label then resolves tosubscription.preview.completeVerification. The button at Line 262 renders wheneveractionUrlis set and uses the same label. Both conditions hold when the operation requires action and the server also returns anactionUrl.The two buttons then look identical but behave differently: one emits
retryAuthentication, the other opensactionUrlin a new tab. Render one action for therequires_actionstate.🐛 Proposed fix
<Button - v-if="actionUrl" + v-if="actionUrl && authenticationState !== 'requires_action'" variant="inverted"🤖 Prompt for 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. In `@src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue` around lines 241 - 270, Update the button visibility conditions in the component so the actionUrl button does not render when authenticationState is requires_action and canRetryAuthentication is true, leaving only the retryAuthentication action for that state. Preserve the actionUrl button for other states where it remains the appropriate verification action.
143-158: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winThe promotion-code input invalidates the quote on every keystroke and has no accessible name.
Each keystroke emits
invalidateQuote, which clearsquoteIsCurrent.quoteIsCurrentgates the pay buttons at Line 291 and Line 303 and the selectorcan-submitat Line 281. A user who types a code and does not press Apply cannot pay, and the UI gives no explanation.The input also has only a
placeholder. A placeholder is not an accessible name and it disappears once the user types.Emit
invalidateQuoteonly when the typed value differs frompreviewData?.promotion_code, and add anaria-label.🐛 Proposed fix
<input v-model="promotionCode" class="h-10 min-w-0 flex-1 rounded-lg border border-interface-stroke bg-secondary-background px-3 text-base-foreground" + :aria-label="$t('subscription.preview.promoCodePlaceholder')" :placeholder="$t('subscription.preview.promoCodePlaceholder')" - `@input`="$emit('invalidateQuote')" + `@input`="onPromotionCodeInput" />function onPromotionCodeInput() { if (promotionCode.value === (previewData?.promotion_code ?? '')) return emit('invalidateQuote') }🤖 Prompt for 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. In `@src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue` around lines 143 - 158, Update the promotion-code input handling in SubscriptionAddPaymentPreviewWorkspace so invalidateQuote is emitted only when promotionCode differs from previewData?.promotion_code, using the existing input event flow and preserving the current-value no-op behavior. Add an aria-label to the input so it remains accessible after the placeholder disappears.
518-534: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winPin the renewal date to UTC.
renewal_atis a UTC timestamp. Line 525 formats it with the viewer's local timezone, so a user west of UTC sees the previous calendar day as the renewal date.SubscriptionTransitionPreviewWorkspace.formatDatealready pinstimeZone: 'UTC'for the same field.🐛 Proposed fix
const date = new Date(previewData.renewal_at).toLocaleDateString(undefined, { month: 'short', day: 'numeric', - year: 'numeric' + year: 'numeric', + timeZone: 'UTC' })🤖 Prompt for 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. In `@src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue` around lines 518 - 534, Update the renewalTerms computed property to format previewData.renewal_at with the UTC timezone, matching SubscriptionTransitionPreviewWorkspace.formatDate, so the displayed renewal calendar date is independent of the viewer’s local timezone.src/platform/workspace/stores/billingOperationStore.ts (2)
644-657: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winEmit telemetry for the
reconciliation_neededterminal state.
handleFailureandhandleTimeoutboth calltelemetry?.trackBillingEvent.handleReconciliationNeededemits nothing, and it is terminal.reconciliation_neededmeans the charge may have succeeded while provisioning did not, so support must reconcile it. Without an event, these cases are invisible to dashboards and alerts.Emit an event with the same operation context the sibling handlers pass. Confirm that
failure_categoryaccepts'reconciliation_needed'; if the field is a closed union, extend it first.🤖 Prompt for 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. In `@src/platform/workspace/stores/billingOperationStore.ts` around lines 644 - 657, Update handleReconciliationNeeded to emit telemetry via telemetry?.trackBillingEvent using the same operation context and terminal-event pattern as handleFailure and handleTimeout, with failure_category set to 'reconciliation_needed'. If failure_category uses a closed union, extend it to include this value before emitting the event.
401-409: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick winRoute a
loadStriperejection throughsetAuthenticationRetry.
loadStriperejects when the Stripe.js script fails to load. Line 402 runs before thetryblock at Line 411, so the rejection escapesrunPaymentIntentAction. The operation then keepsisAuthenticating: trueandcanRetryAuthentication: false, and the customer has no retry path. The rejection also propagates out ofretryPaymentAuthenticationto the composable, which does not catch it.Move the load into the existing
tryblock, or wrap it separately and setstripe = nullon failure.🛡️ Proposed fix
const publishableKey = import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY - const stripe = publishableKey ? await loadStripe(publishableKey) : null + let stripe: Stripe | null = null + try { + stripe = publishableKey ? await loadStripe(publishableKey) : null + } catch { + stripe = null + } if (!stripe) {🤖 Prompt for 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. In `@src/platform/workspace/stores/billingOperationStore.ts` around lines 401 - 409, Move the loadStripe call in runPaymentIntentAction into the existing try block, or handle its rejection separately by setting stripe to null, so every load failure reaches setAuthenticationRetry with the existing authenticationUnavailable message and returns false.src/platform/workspace/components/UnifiedStripePaymentSelector.vue (3)
115-118: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winUpdate the Elements instance when
amountCentsorcurrencychanges.
stripe.elements()runs once inonMountedand capturesamountCentsandcurrencyat that moment. The parent keeps this component mounted across a re-quote:SubscriptionAddPaymentPreviewWorkspace.vuebinds:amount-cents="amountDueCents"and applying a promotion code changespreviewData.amount_due_cents.captureModedoes not change during that refresh, so the element is not remounted.In the deferred-intent pattern the element amount drives the displayed total, wallet sheets, and payment-method eligibility. A stale amount shows the pre-discount total to the customer. Call
elements.update()when the props change.🔧 Proposed fix
-import { onBeforeUnmount, onMounted, ref } from 'vue' +import { onBeforeUnmount, onMounted, ref, watch } from 'vue'onBeforeUnmount(() => { isUnmounted = true paymentElement?.destroy() }) + +watch( + () => [amountCents, currency] as const, + ([nextAmount, nextCurrency]) => { + if (!stripeElements.value || nextAmount <= 0) return + stripeElements.value.update({ + amount: nextAmount, + currency: nextCurrency.toLowerCase() + }) + } +)Stripe.js elements.update amount currency deferred intent subscription mode🤖 Prompt for 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. In `@src/platform/workspace/components/UnifiedStripePaymentSelector.vue` around lines 115 - 118, Update the UnifiedStripePaymentSelector component so its Stripe Elements instance is refreshed via elements.update() whenever amountCents or currency changes, rather than retaining the values captured during onMounted initialization. Watch both props, preserve the existing subscription configuration, and ensure the updated amount and normalized currency drive the displayed total and payment eligibility without remounting.
13-18: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAnnounce the payment error to assistive technology.
configurationErrorcarries both configuration failures and Stripe submission errors fromsubmit(). The container has no live-region role, so screen reader users receive no announcement after a failed submit. The sibling error banner inSubscriptionAddPaymentPreviewWorkspace.vue(Line 230) already usesrole="alert".♿ Proposed fix
<div v-if="configurationError" + role="alert" class="border-danger-background bg-danger-background/10 text-danger rounded-lg border px-3 py-2 text-sm" >🤖 Prompt for 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. In `@src/platform/workspace/components/UnifiedStripePaymentSelector.vue` around lines 13 - 18, Add role="alert" to the configurationError container in UnifiedStripePaymentSelector.vue so both configuration and Stripe submission errors are announced to assistive technology, matching the existing sibling error banner behavior.
109-113: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winHandle a
loadStriperejection.
loadStriperejects when the Stripe.js script fails to load, for example on a network error, a content blocker, or a CSP rule. Line 109 is not guarded, so the rejection escapes theonMountedcallback as an unhandled promise rejection.configurationErrorstays empty. The customer sees an empty payment area and a permanently disabled pay button with no message.Wrap the load and fall through to the existing error path.
🛡️ Proposed fix
- stripe = await loadStripe(publishableKey) + try { + stripe = await loadStripe(publishableKey) + } catch { + stripe = null + } if (!stripe || !paymentElementTarget.value || isUnmounted) { configurationError.value = t('subscription.preview.stripeUnavailable') return }🤖 Prompt for 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. In `@src/platform/workspace/components/UnifiedStripePaymentSelector.vue` around lines 109 - 113, Update the Stripe initialization in the component’s onMounted flow around loadStripe so rejected script loads are caught and handled by the existing configurationError path. Ensure the rejection does not escape as an unhandled promise and preserves the current unavailable-state handling for missing Stripe, missing paymentElementTarget, or unmounted state.src/platform/workspace/composables/useSubscriptionCheckout.ts (2)
787-799: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winThe personal and team submit paths build byte-identical payment and quote options. The
confirmationTokenversussavedPaymentMethodIdchoice, thesubscribeAcceptsSavedMethod()gate, thepromotionCodeprecedence, and thehasExactQuotespread are duplicated. Two copies of a money-path payload must stay in sync, and any change to quote or payment-method precedence has to be applied twice. Extract onebuildPaymentOptions(quote, confirmationToken, promotionCode)helper.
src/platform/workspace/composables/useSubscriptionCheckout.ts#L787-L799: replace the inline option construction inhandleSubscriptionwith a spread of the shared helper.src/platform/workspace/composables/useSubscriptionCheckout.ts#L1085-L1097: replace the identical construction inhandleTeamSubscriptionwith the same helper spread, keepingteamCreditStopIdandbillingCycleat the call site.🤖 Prompt for 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. In `@src/platform/workspace/composables/useSubscriptionCheckout.ts` around lines 787 - 799, Extract a shared buildPaymentOptions(quote, confirmationToken, promotionCode) helper containing the existing confirmationToken versus savedPaymentMethodId selection, subscribeAcceptsSavedMethod gate, promotionCode precedence, and hasExactQuote fields. In src/platform/workspace/composables/useSubscriptionCheckout.ts lines 787-799, replace the inline options in handleSubscription with the helper spread; apply the same replacement at lines 1085-1097 in handleTeamSubscription, preserving teamCreditStopId and billingCycle at that call site.
852-881: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
handleBackToPricingis a no-op here, so a failed refresh dead-ends the checkout.
recoverStaleQuoteruns from thecatchblock ofhandleSubscription(Line 834) and ofhandleTeamSubscription(Line 1143). At that pointisSubscribing.valueis stilltrue, because thefinallyblock that clears it has not run.handleBackToPricing(Line 739) returns immediately whileisSubscribing.valueistrue.The user stays on the preview step with
quoteIsCurrentset tofalseand aquoteRefreshFailedtoast. Every later submit throwssubscription.preview.applyQuoteBeforeContinuing. CallresetToPricing()instead, which has no in-flight guard.Two further points on this function:
- Lines 853-859 re-implement
hasErrorCode(Lines 382-389) and add anerror instanceof Errorrequirement. A plain object carryingcodeskips recovery here while every sibling handler in the samecatchchain matches it. Use the shared predicate.- Line 866 throws only for the
catchtwo lines below to swallow it.applyPromotionCodealready returns a boolean and catches its own errors, so a conditional expresses the same branch.♻️ Proposed rewrite
async function recoverStaleQuote(error: unknown): Promise<boolean> { - if ( - !(error instanceof Error) || - !('code' in error) || - error.code !== 'SUBSCRIPTION_QUOTE_STALE' - ) { - return false - } + if (!hasErrorCode(error, 'SUBSCRIPTION_QUOTE_STALE')) return false quoteIsCurrent.value = false - try { - const refreshed = await applyPromotionCode( - previewData.value?.promotion_code ?? '', - false - ) - if (!refreshed) throw new Error('quote refresh failed') - toast.add({ - severity: 'error', - summary: t('g.error'), - detail: t('subscription.preview.quoteStale') - }) - } catch { - handleBackToPricing() - toast.add({ - severity: 'error', - summary: t('g.error'), - detail: t('subscription.preview.quoteRefreshFailed') - }) - } + const refreshed = await applyPromotionCode( + previewData.value?.promotion_code ?? '', + false + ) + if (!refreshed) { + resetToPricing() + toast.add({ + severity: 'error', + summary: t('g.error'), + detail: t('subscription.preview.quoteRefreshFailed') + }) + return true + } + toast.add({ + severity: 'error', + summary: t('g.error'), + detail: t('subscription.preview.quoteStale') + }) return true }🤖 Prompt for 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. In `@src/platform/workspace/composables/useSubscriptionCheckout.ts` around lines 852 - 881, Update recoverStaleQuote to use the shared hasErrorCode predicate for SUBSCRIPTION_QUOTE_STALE instead of reimplementing the check or requiring Error instances. When applyPromotionCode returns false, call resetToPricing() rather than handleBackToPricing(), and replace the throw-based branch with a conditional that shows the success toast only when refresh succeeds; otherwise reset and show quoteRefreshFailed.
🤖 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/platform/workspace/components/TopUpCreditsDialogContentWorkspace.test.ts`:
- Around line 317-319: Replace the mock-call-only assertions in the top-up
recovery tests with behavioral assertions that verify the pending top-up enters
and completes the required-action recovery flow, such as the observable
verification or final success outcome. Keep the mockStartOperation argument
assertion only as secondary coverage if forwarding autoHandleRequiresAction is
explicitly part of the contract under test.
In `@src/platform/workspace/components/UnifiedStripePaymentSelector.test.ts`:
- Around line 156-159: Update the disabled-state assertion for the payButton
returned by getByRole in UnifiedStripePaymentSelector tests to use the jest-dom
toBeDisabled() matcher, removing the unnecessary HTMLButtonElement cast.
---
Outside diff comments:
In `@src/platform/workspace/components/UnifiedStripePaymentSelector.vue`:
- Around line 29-31: Update the icon element in UnifiedStripePaymentSelector to
replace the descoped text-success-foreground utility with the arbitrary token
utility text-(--success-foreground), preserving all other classes.
In `@src/platform/workspace/composables/useSubscriptionCheckout.ts`:
- Around line 346-348: Update both preview refresh sites in
src/platform/workspace/composables/useSubscriptionCheckout.ts: lines 346-348 in
assertReactivationAmountUnchanged and lines 464-466 in
refreshExpiredProrationQuote. Replace direct previewData.value assignments with
installPreview(freshPreview) so quoteIsCurrent is set consistently before
surfacing the drift error.
---
Duplicate comments:
In
`@src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue`:
- Around line 241-270: Update the button visibility conditions in the component
so the actionUrl button does not render when authenticationState is
requires_action and canRetryAuthentication is true, leaving only the
retryAuthentication action for that state. Preserve the actionUrl button for
other states where it remains the appropriate verification action.
- Around line 143-158: Update the promotion-code input handling in
SubscriptionAddPaymentPreviewWorkspace so invalidateQuote is emitted only when
promotionCode differs from previewData?.promotion_code, using the existing input
event flow and preserving the current-value no-op behavior. Add an aria-label to
the input so it remains accessible after the placeholder disappears.
- Around line 518-534: Update the renewalTerms computed property to format
previewData.renewal_at with the UTC timezone, matching
SubscriptionTransitionPreviewWorkspace.formatDate, so the displayed renewal
calendar date is independent of the viewer’s local timezone.
In `@src/platform/workspace/components/UnifiedStripePaymentSelector.vue`:
- Around line 115-118: Update the UnifiedStripePaymentSelector component so its
Stripe Elements instance is refreshed via elements.update() whenever amountCents
or currency changes, rather than retaining the values captured during onMounted
initialization. Watch both props, preserve the existing subscription
configuration, and ensure the updated amount and normalized currency drive the
displayed total and payment eligibility without remounting.
- Around line 13-18: Add role="alert" to the configurationError container in
UnifiedStripePaymentSelector.vue so both configuration and Stripe submission
errors are announced to assistive technology, matching the existing sibling
error banner behavior.
- Around line 109-113: Update the Stripe initialization in the component’s
onMounted flow around loadStripe so rejected script loads are caught and handled
by the existing configurationError path. Ensure the rejection does not escape as
an unhandled promise and preserves the current unavailable-state handling for
missing Stripe, missing paymentElementTarget, or unmounted state.
In `@src/platform/workspace/composables/useSubscriptionCheckout.ts`:
- Around line 787-799: Extract a shared buildPaymentOptions(quote,
confirmationToken, promotionCode) helper containing the existing
confirmationToken versus savedPaymentMethodId selection,
subscribeAcceptsSavedMethod gate, promotionCode precedence, and hasExactQuote
fields. In src/platform/workspace/composables/useSubscriptionCheckout.ts lines
787-799, replace the inline options in handleSubscription with the helper
spread; apply the same replacement at lines 1085-1097 in handleTeamSubscription,
preserving teamCreditStopId and billingCycle at that call site.
- Around line 852-881: Update recoverStaleQuote to use the shared hasErrorCode
predicate for SUBSCRIPTION_QUOTE_STALE instead of reimplementing the check or
requiring Error instances. When applyPromotionCode returns false, call
resetToPricing() rather than handleBackToPricing(), and replace the throw-based
branch with a conditional that shows the success toast only when refresh
succeeds; otherwise reset and show quoteRefreshFailed.
In `@src/platform/workspace/stores/billingOperationStore.ts`:
- Around line 644-657: Update handleReconciliationNeeded to emit telemetry via
telemetry?.trackBillingEvent using the same operation context and terminal-event
pattern as handleFailure and handleTimeout, with failure_category set to
'reconciliation_needed'. If failure_category uses a closed union, extend it to
include this value before emitting the event.
- Around line 401-409: Move the loadStripe call in runPaymentIntentAction into
the existing try block, or handle its rejection separately by setting stripe to
null, so every load failure reaches setAuthenticationRetry with the existing
authenticationUnavailable message and returns false.
🪄 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: cd0e93c2-52d5-4b74-ab36-3b7bffdd6817
📒 Files selected for processing (12)
src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.test.tssrc/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vuesrc/platform/workspace/components/SubscriptionRequiredDialogContentUnified.test.tssrc/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vuesrc/platform/workspace/components/TopUpCreditsDialogContentWorkspace.test.tssrc/platform/workspace/components/TopUpCreditsDialogContentWorkspace.vuesrc/platform/workspace/components/UnifiedStripePaymentSelector.test.tssrc/platform/workspace/components/UnifiedStripePaymentSelector.vuesrc/platform/workspace/composables/useSubscriptionCheckout.test.tssrc/platform/workspace/composables/useSubscriptionCheckout.tssrc/platform/workspace/stores/billingOperationStore.test.tssrc/platform/workspace/stores/billingOperationStore.ts
There was a problem hiding this comment.
Actionable comments posted: 13
🤖 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 `@browser_tests/fixtures/cloudAppFixture.ts`:
- Line 5: Centralize the application URL fallback by exporting APP_URL from
browser_tests/fixtures/cloudAppFixture.ts. In
browser_tests/fixtures/helpers/BillingCheckoutStateMachineHelper.ts, remove the
local URL constant and import APP_URL from `@e2e/fixtures/cloudAppFixture`; in
browser_tests/tests/billing/billingCheckoutStateMachine.spec.ts, replace the
inline fallback with the same imported APP_URL.
- Around line 24-42: Update gotoCloudApp and the payment-return loading flow so
runUrlActionLoaders executes after the router.replace navigation completes,
ensuring payment-return query parameters are processed even when navigation
occurs after GraphCanvas.vue mounting. Reuse the existing loader entry point or
route-change mechanism rather than relying solely on GraphCanvas.vue’s onMounted
hook.
In `@browser_tests/fixtures/helpers/BillingCheckoutStateMachineHelper.ts`:
- Around line 398-412: Update BillingCheckoutStateMachineHelper’s fulfill method
and its corresponding request/response recording path to sanitize payment data
before storing it in requests or responses. Redact payment_intent_client_secret,
confirmation-token fields, and other payment secrets while preserving the
remaining body structure, so attachEvidence only emits sanitized bodies.
- Line 21: Change the numeric error variant in OperationResponse to use a
distinct key for the HTTP status code, then update the runtime check in the
response-handling logic around the existing line 363 to discriminate using that
key instead of typeof response.status. Preserve BillingOpStatusResponse’s string
status handling and update any related property access accordingly.
- Around line 97-98: Update the requests and responses collections in
BillingCheckoutStateMachineHelper to use explicit entry types instead of
Array<Record<string, unknown>>. Define the required request and response fields,
including path with its actual string type, and apply those types consistently
to the recording and reading logic around the referenced request/response
handling.
- Around line 342-346: Update the subscribe route handler in the billing
checkout state-machine helper to fulfill a 500 response containing the “No
queued subscribe response” diagnostic when subscribeResponses is empty, rather
than throwing. In the related opId extraction logic, parse route.request().url()
and use the URL pathname before selecting the final path segment, so query
strings cannot contaminate the operation ID.
- Around line 380-396: Make operationResponse use explicit per-entry queue
metadata instead of inferring behavior from queue length. Update the
OperationResponse entries and operationResponse method so repeating responses
declare a repeat flag, and authentication responses declare the
advanceAfterActionCalls threshold, while preserving the existing requires_action
transition behavior without relying on exact queue size or implicit shift
ordering.
- Around line 222-260: Update topupAfterStaleRail to stop importing or returning
useBillingContext, useWorkspaceBilling, and useTeamWorkspaceStore state; retain
only the setup and topup action needed for the end-to-end flow. Remove the
consuming test’s billingRail and billingType assertions, relying on the existing
/api/billing/topup and /customers/credit request-count assertions for observable
routing behavior. Move any necessary store-state coverage into an appropriate
Vitest store test without adding implementation-detail-only end-to-end
assertions.
- Around line 129-145: The Stripe stub in BillingCheckoutStateMachineHelper must
implement the checkout APIs used by UnifiedStripePaymentSelector.vue. Extend the
object returned by window.Stripe with elements(), whose create('payment') result
supports mount() and on(), plus submit() and createConfirmationToken(), while
preserving the existing handleNextAction behavior and expected successful
checkout responses.
In `@browser_tests/README.md`:
- Around line 103-106: Update the billing browser-test instructions in the
README to separate the foreground pnpm dev command into its own step and code
block, explicitly stating that it must remain running in one terminal; instruct
readers to run the test:browser:local command from a second terminal.
In `@browser_tests/tests/billing/billingCheckoutStateMachine.spec.ts`:
- Around line 18-21: Update the billing checkout assertions around the terminal
“You're all set” heading and the corresponding `operationPollCount('op-return')`
check: wait for the terminal UI state first, then perform one direct count
assertion so delayed duplicate submissions are detected. Replace the polling
equality checks without changing the expected count or terminal-state behavior.
- Around line 165-171: Update the assertions in the billing checkout
state-machine test to first wait for a positive signal that the decline/failure
state has been applied, using the existing observed state-change indicator in
the test. Only after that signal, retain the negative assertions for the
“Complete verification” and “Retry verification” buttons and the enabled
payButton assertion.
- Around line 183-198: Update the inline status response used by the billing
checkout state-machine test to validate its object with satisfies
BillingStatusResponse, importing BillingStatusResponse from the generated ingest
types per the repository guidance. Ensure the fixture includes all required
contract fields, including billing_rail, max_seats, and occupied_seats, while
preserving the existing override values.
🪄 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: 958e6dbd-3af4-4cb6-9856-9102d6e3501e
📒 Files selected for processing (21)
browser_tests/README.mdbrowser_tests/fixtures/billingCheckoutStateMachineFixture.tsbrowser_tests/fixtures/cloudAppFixture.tsbrowser_tests/fixtures/helpers/BillingCheckoutStateMachineHelper.tsbrowser_tests/tests/billing/billingCheckoutStateMachine.spec.tsbrowser_tests/tests/dialogs/pricingTableDeepLink.spec.tspackages/ingest-types/src/types.gen.tspackages/ingest-types/src/zod.gen.tssrc/locales/en/main.jsonsrc/platform/cloud/subscription/composables/usePaymentReturnUrlLoader.tssrc/platform/workspace/api/workspaceApi.test.tssrc/platform/workspace/api/workspaceApi.tssrc/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vuesrc/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vuesrc/platform/workspace/components/SubscriptionTransitionPreviewWorkspace.vuesrc/platform/workspace/components/UnifiedStripePaymentSelector.test.tssrc/platform/workspace/components/UnifiedStripePaymentSelector.vuesrc/platform/workspace/composables/useSubscriptionCheckout.test.tssrc/platform/workspace/composables/useSubscriptionCheckout.tssrc/platform/workspace/stores/billingOperationStore.test.tssrc/platform/workspace/stores/billingOperationStore.ts
44a7cdd to
0958194
Compare
…fields The embedded-checkout consolidation (#14483) landed on the base and made the transition screen read amount_due_cents/currency/renewal_amount_cents/renewal_at for its Total-due and renewal lines. The local plan-change and subscribe preview fixtures now supply those, so the confirm step shows the charge again.
Consolidates the complete embedded subscription checkout frontend onto current `main` as the single review tip, including the design stack, safety gates, exact quote contract UI, saved methods, and 3DS recovery. - **What**: Replays and reconciles the frontend work from #14447, branches. - **Dependencies**: Requires the combined backend environment for end-to-end preview validation. Review exact quote freshness, reactivation safeguards, saved-method confirmation, and retryable/reconciliation 3DS states together. Checks run locally: typecheck, browser fixture typecheck, format, lint/oxlint, knip, 231 billing-focused Vitest tests, and cloud Playwright test discovery. AS IS / TO BE screenshots and preview will be attached after the combined environment exists. --------- Co-authored-by: Amp <amp@ampcode.com>
Consolidates the complete embedded subscription checkout frontend onto current `main` as the single review tip, including the design stack, safety gates, exact quote contract UI, saved methods, and 3DS recovery. - **What**: Replays and reconciles the frontend work from #14447, branches. - **Dependencies**: Requires the combined backend environment for end-to-end preview validation. Review exact quote freshness, reactivation safeguards, saved-method confirmation, and retryable/reconciliation 3DS states together. Checks run locally: typecheck, browser fixture typecheck, format, lint/oxlint, knip, 231 billing-focused Vitest tests, and cloud Playwright test discovery. AS IS / TO BE screenshots and preview will be attached after the combined environment exists. --------- Co-authored-by: Amp <amp@ampcode.com>
Comfy-Org#15915) ## Summary `workspaceApi.subscribe()` guards `confirmationToken` and `savedPaymentMethodId` as mutually exclusive, but tests truthiness: ```ts if (options.confirmationToken && options.savedPaymentMethodId) { throw new TypeError('confirmationToken and savedPaymentMethodId are mutually exclusive') } ``` An empty-string `confirmationToken` is falsy, so it slips the guard and **both** credential fields are serialized into the request body — `confirmation_token: ''` alongside `saved_payment_method_id`. Checking presence instead refuses that combination. ## Scope One condition and one test. Valid single-credential calls are unchanged: passing only a token, only a saved method, or neither all behave exactly as before, since the guard only fires when both keys are present. Note this makes the guard stricter in one further case — explicitly passing `undefined` for one of them still passes, but passing both keys with *any* defined values now throws, which is what "mutually exclusive" should mean. ## Verification - The new test `subscribe() rejects an empty credential alongside a saved one` was confirmed to **fail against the unfixed guard** (1 failed / 41 passed) and pass with it (42/42) — not assumed. - `pnpm typecheck` and `typecheck:browser` clean. - Full unit suite: **17,727 passed**. The 12 `check-binary-size` failures are pre-existing and environmental. ## Origin Found by CodeRabbit on Comfy-Org#15803, where it landed as an outside-diff-range comment with no thread. The code is not that PR's — it came from Comfy-Org#14483 and reached the branch through a merge from `main` — so it is fixed here on its own rather than folded into a capability-migration PR. **Sequencing note:** Comfy-Org#15906 backports Comfy-Org#14483 to `cloud/1.51` and carries the same guard. Landing this on `main` first lets that backport pick the fix up, rather than shipping the bug to the release line and needing a second backport.
…gh the generated contract (#15939) Backport of #15855 to `cloud/1.52`, combined with a regeneration of the `ingest-types` package from the cloud OpenAPI spec. Enterprise is scoped to the 1.52 release per Jaewon (frontend team lead), with Wei Hai confirming Enterprise targets 1.52. **No new product sign-off is needed** — this behaviour was already reviewed and merged on `main` as #15855. ## Why regeneration and ENTERPRISE support are one commit They cannot be split into two green commits, and upstream didn't split them either: - **Regeneration alone → 3 type errors.** Regenerating widens `SubscriptionTier` with `ENTERPRISE`, which breaks two files: - `useBillingPolicyState.ts` — `TS1360: Type '"ENTERPRISE"' does not satisfy the expected type 'never'` (plus a knock-on `TS2322`) - `tierPricing.ts` — `TS7053: Property 'ENTERPRISE' does not exist on Record<"FREE"|...>` - **#15855's source half alone → 4 type errors**, because it references an `ENTERPRISE` member the generated contract does not yet carry. - **Both together → 0 errors.** ## Generated half: regenerated, not cherry-picked Per team guidance the generated files are regenerated from the cloud spec rather than taken from #15855's diff, using the full pipeline in `cloud/.github/workflows/push-ingest-types-to-frontend.yml`: 1. `go run ./services/ingest/scripts/openapi-project -fe -in services/ingest/openapi.yaml -out <frontend>/packages/ingest-types/openapi.yaml` — the **mandatory** spec-projection step, which strips cloud's `x-internal` / `/admin/` / M2M surface before codegen 2. `pnpm generate` in `packages/ingest-types` (pinned `@hey-api/openapi-ts` **0.97.3**, unchanged) 3. `npx oxfmt --write src/` — raw generator output is 4-space + semicolons; committing without this makes the diff ~99% whitespace noise (24k lines vs 2.8k) **Cloud spec SHA:** `Comfy-Org/cloud@3e3f06a7f43b99fe96b5da066379dbba6433e252` `origin/main` has since advanced to `b47b91183f`, adding 73 spec lines — all of them the `x-internal` `/admin/api/billing/credit-deduction` endpoint. Projecting from either SHA yields a **byte-identical** projected spec, so the SHA choice is immaterial here. `packages/ingest-types/openapi.yaml` is gitignored and is not committed; only `src/*.gen.ts` and `src/index.ts` are. ## Leak guard The projection step is what the previous attempt on this branch skipped, which leaked 52 `Admin*` refs into the generated types and would have tripped the CI leak guard (the same defect #15878 was created to revert). This branch was rebuilt from scratch on `origin/cloud/1.52`. ``` Admin refs in types.gen.ts: 0 Admin refs in zod.gen.ts: 0 Admin refs in index.ts: 0 ``` The CI guard's own regex — `(/admin|/api/internal|/api/webhooks|/m2m|/monitoring|/debug)([^A-Za-z0-9_-]|$)` — also matches **0** times in the projected spec and both generated files. Projection reported `kept 192 ops | excluded 45 x-internal | pruned 40 schemas`. ## Delta shape ``` packages/ingest-types/src/index.ts | 54 + packages/ingest-types/src/types.gen.ts | 744 +++++++++++- packages/ingest-types/src/zod.gen.ts | 2024 ++++++++++++-------------------- ``` `zod.gen.ts` shows large churn because the committed files on `cloud/1.52` are **stale**, not because types were removed: 184 combined `z*Data` schemas are replaced by 186 split `z*Body` / `z*Path` / `z*Query` / `z*Response` schemas. `cloud/1.52` pins the same generator version (0.97.3) with an identical `openapi-ts.config.ts` as `main`, so its committed output simply predates a regeneration. Verification that this output is correct: it is **byte-identical to `origin/main`'s committed `zod.gen.ts` and `index.ts`**, and differs from `main`'s `types.gen.ts` by only 10 lines — three additive documentation/`404: ErrorResponse` entries on the agent-skill-packs routes, present because the pinned spec is slightly ahead of `main`'s last regeneration. No types are removed relative to `main`. ## Verification - `pnpm typecheck` — **green (exit 0)** with #14483 *not* applied - `pnpm vitest run` over the four suites #15855 ships/touches — **102 passed (4 files)**: `tierPricing.test.ts` (new), `useBillingPolicyState.test.ts`, `billingPolicyCapabilities.test.ts`, `useWorkspaceTierLabel.test.ts` - Committed through the normal pre-commit hook (oxfmt + `pnpm lint` + `pnpm typecheck` all passed); **no `--no-verify`** #15855's source half applied cleanly with `git apply --3way` across 10 files: `src/locales/en/main.json`, `billingPolicyCapabilities.ts`/`.test.ts`, `billingPolicyState.ts`, `useBillingPolicyState.ts`/`.test.ts`, `tierPricing.ts` + new `tierPricing.test.ts`, `useWorkspaceTierLabel.ts`/`.test.ts`. ## Merge order This PR is a **prerequisite** for the #14483 embedded-checkout backport, which is stacked on top of it and should merge second.
…pi (#15927) Regenerates `packages/ingest-types` on `cloud/1.51` so the branch carries the billing contract that the embedded-checkout backport [#15906](#15906) consumes. **Types only** — no runtime code, no behaviour change. ## Regenerated, not cherry-picked Per team guidance (Jaewon), this is a regeneration rather than a cherry-pick of `main`'s ingest-types commits. Those commits are interleaved with an `@hey-api/openapi-ts` bump (#15166) and the ENTERPRISE tier addition (#15855), neither of which belongs on a release branch. Regenerating lets us pick the exact contract snapshot 1.51 needs. ## Spec pin: cloud `8c26db3a68`, not current main Source: `Comfy-Org/cloud` @ **`8c26db3a684a0595254c5051cba88b60e40810c8`** (2026-08-21), `services/ingest/openapi.yaml`. That commit is pinned deliberately. It carries **all 17 billing symbols** #14483 needs while **predating the ENTERPRISE tier**: - Verified at the pin: all 17 of `SavedPaymentMethod`, `authentication_state`, `decline_reason`, `payment_intent_client_secret`, `reconciliation_needed`, `confirmation_token`, `quote_id`, `quote_version`, `saved_payment_method_id`, `promotion_code`, `amount_due_cents`, `requires_reactivation_confirmation`, `renewal_at`, `renewal_amount_cents`, `discounts`, `currency`, `payment_method_configuration_id` are present. - Verified at the pin: **zero** `ENTERPRISE` occurrences. Regenerating from **current** cloud main would widen `SubscriptionTier` with `ENTERPRISE`, which trips the `satisfies never` exhaustiveness guard in `useBillingPolicyState.ts` and `tierPricing.ts` — breaking files #14483 never touches, and pulling a product decision into a release branch. **Enterprise is scoped to 1.52** (confirmed by Jaewon and Wei Hai), not 1.51. Generated `SubscriptionTier` on this branch stays at six members: ```ts export type SubscriptionTier = | 'FREE' | 'STANDARD' | 'CREATOR' | 'PRO' | 'FOUNDERS_EDITION' | 'TEAM' ``` ## Pipeline Followed `cloud/.github/workflows/push-ingest-types-to-frontend.yml` exactly — `pnpm generate` alone is **not** sufficient: 1. **Project the spec** (mandatory, BE-2669 security boundary): `go run ./services/ingest/scripts/openapi-project -fe -in services/ingest/openapi.yaml -out <fe>/packages/ingest-types/openapi.yaml` Result: `kept 186 ops | excluded 41 x-internal | removed 36 empty paths + 3 orphaned tag decls | kept 192 schemas, pruned 40 schemas + 1 security scheme` (17070 → 13436 lines). 2. `pnpm generate` using **this branch's own pinned `@hey-api/openapi-ts` 0.93.0** (not bumped; handles this spec cleanly). 3. `npx oxfmt --write src/` — raw generator output is 4-space + semicolons; committed files are oxfmt-normalized. Skipping this makes the diff ~99% whitespace noise (`+11499/−12702` unformatted vs `+413/−7` formatted). Skipping step 1 is what leaked cloud's internal admin surface previously (52 `Admin*` refs), the defect #15878 reverted. **Leak guard:** `git grep -c 'Admin' packages/ingest-types/src/types.gen.ts` → **0**. The workflow's full guard pattern (`/admin|/api/internal|/api/webhooks|/m2m|/monitoring|/debug`) also returns clean on the projected spec, `types.gen.ts` and `zod.gen.ts`. `packages/ingest-types/openapi.yaml` is gitignored and is **not** committed. Only `src/*.gen.ts` and `src/index.ts` are. ## Delta — purely additive ``` packages/ingest-types/src/index.ts | 13 ++ packages/ingest-types/src/types.gen.ts | 282 +++++++++++++++++++++++++++++- packages/ingest-types/src/zod.gen.ts | 125 ++++++++++++++- 3 files changed, 413 insertions(+), 7 deletions(-) ``` - **Zero exported symbols removed** (1014 → 1027; set difference in the removal direction is empty). - **13 new exported types**: `SavedPaymentMethod`, `SubscriptionDiscount`, `CurrentWorkspaceResponse`, `ListSavedPaymentMethods{Data,Error,Errors,Response,Responses}`, `GetCurrentWorkspace{Data,Error,Errors,Response,Responses}`. - All 7 deleted lines are benign: 5 are doc-comment rewordings, and the other 2 are the same union being **widened** — `status: 'pending' | 'succeeded' | 'failed'` → `… | 'reconciliation_needed'` (plus its Zod counterpart). No narrowing anywhere. ## Verification - `pnpm typecheck` → **exit 0, zero errors**, with #14483 **not** applied. Because the spec predates ENTERPRISE this is genuinely types-only: no `satisfies never` breakage and no compatibility shims were needed. - `npx oxfmt --check packages/ingest-types/src/` → clean. - Committed **through** the pre-commit hooks (oxfmt, `oxlint --type-aware`, eslint, whole-project `pnpm typecheck`) — no `--no-verify`. ## Merge order Prerequisite for **#15906** (embedded-checkout backport), which is stacked on this branch and fails typecheck with 94 errors without it. **Merge this first.** Not merged here, auto-merge not enabled.
…ontend (#15906) Manual backport of #14483 to `cloud/1.51`. The auto-backport workflow failed on merge conflicts, so this was cherry-picked and resolved by hand. Source commit: `8c48cb56506c47fd082afdff971e6fc2372b3fcd` (single-parent squash; plain `cherry-pick`, no `-m 1`). > [!IMPORTANT] > **Stacked PR — merge order matters.** This is based on [#15927](#15927) (`chore: regenerate ingest types from cloud openapi`), not directly on `cloud/1.51`. **Merge #15927 first.** GitHub will auto-retarget this PR to `cloud/1.51` once #15927 lands. Without #15927 this branch fails `pnpm typecheck` with 94 errors. ## Blocker resolved The previous revision of this PR was a draft blocked by 94 typecheck errors: `cloud/1.51` carried an older generated `@comfyorg/ingest-types` contract lacking the embedded-checkout fields this PR consumes (`SavedPaymentMethod`, `authentication_state`, `payment_intent_client_secret`, `decline_reason`, `reconciliation_needed`, `confirmation_token`, `quote_id`, `quote_version`, `saved_payment_method_id`, `promotion_code`, `amount_due_cents`, `requires_reactivation_confirmation`, `renewal_at`, `renewal_amount_cents`, `discounts`, `currency`, `payment_method_configuration_id`). #15927 supplies exactly that contract, regenerated from cloud spec `8c26db3a68` (2026-08-21) — pinned deliberately to a snapshot that has all 17 symbols but **predates the ENTERPRISE tier**, so it does not widen `SubscriptionTier` and trip the `satisfies never` guards in `useBillingPolicyState.ts` / `tierPricing.ts`. Enterprise is 1.52-scoped. **`pnpm typecheck` now: 94 errors → 0 errors (exit 0).** ## Conflicts and how each was resolved Three files conflicted. The root cause in all three is that **#15281 ("fix: use generated workspace API response types") is on `main` but has not been backported to `cloud/1.51`.** #15281 removed the frontend-only `billing_cycle` field from the preview-subscribe request; `cloud/1.51` still has it. #14483 was written on top of that removal. **`src/platform/workspace/api/workspaceApi.ts`** — two hunks, both the same underlying issue. `PreviewSubscribeOptions` and the `previewSubscribe` request body. `main` has only `teamCreditStopId` (post-#15281) and #14483 adds `promotionCode`; `cloud/1.51` still has `billingCycle`. Resolved as a **union**: kept `cloud/1.51`'s `billingCycle` / `billing_cycle` and added #14483's `promotionCode` / `promotion_code`. Dropping `billingCycle` would have silently reverted `cloud/1.51` behaviour that #15281 has not yet removed there. **`src/platform/workspace/composables/useSubscriptionCheckout.ts`** — the team preview call. `cloud/1.51` calls `previewSubscribe(planSlug, { teamCreditStopId, billingCycle })`; #14483 rewrites it as `Promise.all([previewSubscribe(...), loadSavedPaymentMethods()])`. Kept #14483's parallel structure (that is the PR's intent — warm saved payment methods alongside the preview) and retained `cloud/1.51`'s `billingCycle` argument. **`src/platform/workspace/api/workspaceApi.test.ts`** — kept all five tests #14483 adds (`listSavedPaymentMethods`, promotion-code preview, quote/saved-method echo, promotion-code omission, mutually-exclusive credentials). The only other difference was a test rename that came from #15281, not #14483: `'previewSubscribe() sends POST with plan_slug'` → `'…sends fields defined by the ingest contract'`. **Kept `cloud/1.51`'s original name**, because on `cloud/1.51` the request still sends `billing_cycle`, which #15281 explicitly describes as *not* defined by the ingest contract — importing that wording here would have made the test name false. One follow-on change outside the conflict regions, in its own commit: `useSubscriptionCheckout.test.ts` asserted `previewSubscribe` was called with `{ teamCreditStopId }` only. On `cloud/1.51` that call legitimately also carries `billingCycle`, so the assertion was updated to match — consistent with the sibling team-change test at line 1255 which already asserts `{ teamCreditStopId: 'team_1400', billingCycle: 'monthly' }`. ## The `billing_cycle` union — re-verified against the new contract Re-checked against the newly generated types from #15927, because if the regenerated `PreviewSubscribeRequest` had gained `billing_cycle`, the local augmentation would be redundant. It has not: ```ts // packages/ingest-types/src/types.gen.ts — generated export type PreviewSubscribeRequest = { plan_slug: string promotion_code?: string team_credit_stop_id?: string } // <- no billing_cycle export type SubscribeRequest = { billing_cycle?: 'monthly' | 'yearly' // <- has it promotion_code?: string // <- and promotion_code ... } ``` - **`PreviewSubscribeRequest` still has no `billing_cycle`.** `cloud/1.51` supplies it through a local augmentation at `workspaceApi.ts:88`, which predates this backport: ```ts interface PreviewSubscribeRequest extends GeneratedPreviewSubscribeRequest { billing_cycle?: SubscribeBillingCycle } ``` That augmentation is load-bearing — the `satisfies PreviewSubscribeRequest` on the request body would not compile without it. - **`SubscribeRequest` has both `billing_cycle` and `promotion_code`**, so no augmentation is needed there. **Verdict: the union resolution stands and is still required.** Taking #14483's side verbatim would have dropped `billingCycle` from the preview request and silently reverted live `cloud/1.51` behaviour. ## #15401 ordering — not a stacking conflict The workflow flagged that #15401 (`[backport cloud/1.51] refactor(workspace): simplify ended subscription state`) is open against this branch and might be the cause. **It is not.** This is genuine `main` ↔ `cloud/1.51` divergence. - #15401 touches exactly one file, `SubscriptionPanelContentWorkspace.vue`. That file is not among #14483's 49 files, nor among the three conflicted files. - Verified empirically: merging #15401 into `cloud/1.51` and *then* cherry-picking #14483 produces the **identical three conflicts**. **#15401 and this PR are independent and can land in either order.** No ordering constraint. ## Verification Run in the checkout, real results, on the rebased branch: - `pnpm install --frozen-lockfile` — passes (exit 0) - `pnpm typecheck` — **exit 0, zero errors**. Before the rebase onto #15927 this same tree produced **94 errors** (exit 2); all 94 were the contract gap and none were resolution mistakes. - `pnpm vitest run src/platform/workspace src/platform/cloud/subscription src/composables/useUrlActionLoaders.test.ts src/composables/useFeatureFlags.test.ts src/components/dialog/GlobalDialog.test.ts src/components/graph/GraphCanvas.firstRunEntry.test.ts` — **91 files, 1656 tests, all pass** (exit 0) - `oxfmt --check`, `oxlint --type-aware`, `eslint` across all **41** changed `.ts`/`.vue` files — all pass (exit 0) Note that green Vitest is not evidence of type safety on its own — Vitest strips types. The `pnpm typecheck` exit 0 above is the type-level evidence. **No `--no-verify` commits remain on this branch.** The earlier `460b275120` was made with `--no-verify` because the pre-commit hook runs whole-project typecheck, which no commit could pass before the contract landed. It has been dropped and recommitted as `89bcd823b1` **through** the full hook chain (oxfmt, `oxlint --type-aware`, eslint, `pnpm typecheck`), which now passes. Per the workflow rules: no `browser_tests/**/*-snapshots/` files were involved; `package.json` version correctly stays at `cloud/1.51`'s version; `pnpm-lock.yaml` passes `--frozen-lockfile`. ## Not done Not merged, auto-merge not enabled. `main`, #14483, #15401 and all other branches untouched. ## CI status **65 checks pass, 1 fails: `playwright-video-new-tests`.** That failure is a pre-existing tagging/workflow mismatch, not a broken test and not a regression from this backport: ``` NEW_SPEC_FILES: browser_tests/tests/dialogs/checkoutRecovery.spec.ts $ pnpm exec playwright test --project=chromium browser_tests/tests/dialogs/checkoutRecovery.spec.ts Error: No tests found. ``` - Every test in `checkoutRecovery.spec.ts` is under `test.describe('Redirect checkout recovery', { tag: '@cloud' }, …)`. - `playwright.config.ts`'s `chromium` project sets `grepInvert: /@mobile|@Perf|@Audit|@cloud/`, so it deliberately excludes `@cloud`. A `@cloud`-tagged spec can only run under the `cloud` project. - The `playwright-video-new-tests` job hardcodes `--project=chromium`, so for any newly added `@cloud`-only spec it matches zero tests and exits 1. No test executed and none failed. This backport does not touch `playwright.config.ts`, and `checkoutRecovery.spec.ts` is **byte-identical** to the version #14483 merged to `main` — where the `chromium` project carries the same `@cloud` grepInvert. Fixing the job to select the right project is out of scope for a backport; flagging it for whoever owns `ci-tests-e2e.yaml`. The `@cloud` specs themselves are exercised by the `cloud` project, and `website-e2e`, `perf-tests`, `lint-and-format`, `build`, `storybook-build`, `scan`, `validate-licenses` and `validate-fonts` all pass. --------- Co-authored-by: Amp <amp@ampcode.com>
…ontend (#15941) Backport of #14483 to `cloud/1.52`. ##⚠️ Merge order — this PR is stacked **Base is deliberately set to `backport-ingest-types-to-cloud-1.52`, not `cloud/1.52`.** GitHub will auto-retarget this PR to `cloud/1.52` once the types PR merges. - Depends on: #15939 — `[backport cloud/1.52] feat(billing): render the ENTERPRISE tier through the generated contract` - **#15939 must merge first.** This branch does not compile without it: on `cloud/1.52` alone it produces **94 type errors**, every one of them a missing member on a generated `@comfyorg/ingest-types` type (`SavedPaymentMethod`, `quote_id`, `quote_version`, `discounts`, `currency`, `authentication_state`, `decline_reason`, `promotion_code`, `confirmation_token`, …). ## Verification **`pnpm typecheck`: 94 → 0.** Before (this branch's feature commit on `cloud/1.52`, types PR *not* applied) — `exit 2`, 94 errors, e.g.: ``` src/platform/workspace/api/workspaceApi.ts(28,3): error TS2305: Module '"@comfyorg/ingest-types"' has no exported member 'SavedPaymentMethod'. src/platform/workspace/api/workspaceApi.ts(119,27): error TS2339: Property 'authentication_state' does not exist on type 'BillingOpStatusResponse'. src/platform/workspace/api/workspaceApi.ts(478,11): error TS2353: Object literal may only specify known properties, and 'promotion_code' does not exist in type 'PreviewSubscribeRequest'. src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue(124,28): error TS2339: Property 'discounts' does not exist on type 'PreviewSubscribeResponse'. ... ``` After (rebased onto #15939) — **`exit 0`, empty output, 0 errors.** Tests (`pnpm vitest run`): | Suite | Result | |---|---| | `src/composables/useUrlActionLoaders.test.ts` | 6 passed (1 file) | | `src/platform/workspace/` + `src/platform/cloud/subscription/` | **1606 passed (88 files)** | | `useFeatureFlags`, `GlobalDialog`, `GraphCanvas.firstRunEntry` | 94 passed (3 files) | Lint/format on the 43 changed TS/Vue files: `eslint` exit 0, `oxfmt --check` — "All matched files use the correct format." Note that green Vitest is not evidence of type safety (Vitest strips types) — the `vue-tsc` result above is the type-safety evidence. ## Rebase Rebased conflict-free onto the types branch; the feature commit's own conflict resolutions were carried through unchanged. ## Conflict resolutions These were resolved, reviewed and verified in a prior pass and are **not** re-derived here. They cover two files: - `src/composables/useUrlActionLoaders.ts` - `src/composables/useUrlActionLoaders.test.ts` Both drop the `?settings` deep-link references. Those come from #15808, which is not on this branch — `src/composables/useSettingsUrlLoader.ts` does not exist on `cloud/1.52` (verified absent). No `settings` references remain in either file. ### Judgement call for reviewers 👀 The upstream test `isolates a settings-loader failure so it does not abort the boot chain` was **deleted** (its subject, the settings loader, doesn't exist on this branch). Its two tail assertions were **folded into the surviving top-up isolation test** rather than dropped, so the coverage they provided is retained: ```ts it('isolates a top-up-loader failure so it does not abort the boot chain', async () => { mocks.loadTopUp.mockRejectedValueOnce(new Error('boom')) const { runUrlActionLoaders } = useUrlActionLoaders() await expect(runUrlActionLoaders()).resolves.toBeUndefined() expect(mocks.loadPricingTable).toHaveBeenCalledOnce() expect(mocks.loadPaymentReturn).toHaveBeenCalledOnce() // folded in expect(mocks.resumePendingPricingFlow).toHaveBeenCalledOnce() // folded in }) ``` This leaves 6 tests in the file instead of upstream's 7. If reviewers would rather see the assertions dropped with the deleted test, that's a one-line change. --------- Co-authored-by: Amp <amp@ampcode.com>
Comfy-Org#16517) ## Summary The subscription confirm screens rendered no amount at all whenever embedded checkout was off — a blank "Total due today" on new subscriptions and "Unavailable" on plan changes. Resolve the amount from the legacy cost fields the server always sends. ## Changes - **What**: `formatAmountDueToday` / `formatRenewalAmount` / `resolveRenewalDate` in `subscriptionQuoteFormatting.ts` resolve each figure from the exact quote when the server sent one and from the always-present legacy costs otherwise. `SubscriptionAddPaymentPreviewWorkspace` and `SubscriptionTransitionPreviewWorkspace` consume them. New `subscription.preview.renewsAtAmount` message for the case where the server supplies an amount but no renewal date. ### Root cause Comfy-Org#14483 ("consolidate embedded checkout frontend") rewrote both quote computeds to read only the embedded-checkout field family: ```ts const totalDueToday = computed(() => previewData?.amount_due_cents === undefined ? '' : formatQuoteMoney(...) ) ``` `POST /api/billing/preview-subscribe` returns two different shapes. `packages/ingest-types` documents the split on the sibling field: `payment_method_configuration_id` is *"Present on every successful preview while embedded checkout is enabled and absent from legacy previews."* The same holds for the whole family: | field | contract | legacy preview | | --- | --- | --- | | `amount_due_cents`, `currency` | optional | absent | | `renewal_amount_cents`, `renewal_at` | optional | absent | | `cost_today_cents`, `cost_next_period_cents` | **required** | **present** | So with the flag off, `amount_due_cents` is `undefined` and `totalDueToday` short-circuits to `''`. `SubscriptionTransitionPreviewWorkspace` falls through to `subscription.preview.quoteUnavailable` and prints "Unavailable" twice. Two things widen the blast radius beyond "someone turned the flag off": - `embeddedCheckoutEnabled` resolves **fail-closed** (`resolveFailClosedBooleanFlag`), so a flag that cannot be read is treated as off and takes this same path. - `formatQuoteMoney` returns `''` when `currency` is missing, so even reading `cost_today_cents` while passing the absent `currency` through would still render blank. Note the branch here is on the **response shape**, not on the `embeddedCheckoutEnabled` prop. The shape is what the contract actually guarantees, it needs no prop threaded into `SubscriptionTransitionPreviewWorkspace`, and it stays correct if the flag is on while the backend still serves a legacy preview. `chargeCents` in the same component already branched this way (`amount_due_cents ?? cost_today_cents`) — the consolidation just missed the display computeds. The renewal **date** is deliberately not synthesized. `PreviewPlanInfo.period_end` is documented "only for current_plan" and is absent on a new-subscription preview, so the legacy path shows the server-provided renewal amount without inventing a date. ## Review Focus - `LEGACY_QUOTE_CURRENCY = 'usd'` is the one assumption added. The legacy rail carries no `currency` field because it prices in USD; this keeps that assumption in a single named constant instead of at each call site. - `SubscriptionTransitionPreviewWorkspaceReactivation.test.ts` had a test asserting "Unavailable" appeared twice for a preview with no exact quote. That test codified this bug, so it now asserts the legacy amount renders. - `cloudSubscribeDeepLink.spec.ts` already drove a legacy-shaped preview through the real checkout but only asserted the heading, which is how this reached QA. It now asserts the total. ## Tests - 8 unit tests on the pure resolvers (exact quote, legacy fallback, non-USD, missing date) - 3 component regression tests; verified they fail without the fix and pass with it - 1 E2E assertion on the existing flag-off deep-link spec ## Screenshots Captured in the running app (cloud distribution, `embedded_checked_enabled` off) — posting them in a follow-up comment. <!-- Supersedes Comfy-Org#16515, which fixes the same bug by branching on the flag prop and drops the renewal line when the server sends no date. -->
|
|
|
…s from the server costs (#16573) Backport of #16517 to `cloud/1.53`. Cherry-pick of `c989dee4077e195a11dee00f31dbf532305fb3e8` — applied cleanly with **no conflicts**, and the resulting diff is byte-identical to the commit merged to `main` (9 files, +298/-50). ## Why this is needed on this branch The subscription confirm screens render **no amount at all** whenever embedded checkout is off — a blank "Total due today" on new subscriptions, and "Unavailable" on plan changes. Any release branch shipping without this fix shows users a checkout screen with no price on it. ## Root cause #14483 ("consolidate embedded checkout frontend") rewrote both quote computeds to read **only** the embedded-checkout field family: ```ts const totalDueToday = computed(() => previewData?.amount_due_cents === undefined ? '' : formatQuoteMoney(...) ) ``` When embedded checkout is off the server never sends `amount_due_cents`, so the computed resolves to `''` and the UI renders nothing — even though the server *always* sends the legacy cost fields that carry the same figure. ## What changes - `formatAmountDueToday` / `formatRenewalAmount` / `resolveRenewalDate` in `subscriptionQuoteFormatting.ts` resolve each figure from the exact quote **when the server sent one**, and from the always-present legacy costs otherwise. - `SubscriptionAddPaymentPreviewWorkspace` and `SubscriptionTransitionPreviewWorkspace` consume them. - New `subscription.preview.renewsAtAmount` message for the case where the server supplies an amount but no renewal date. ## Verification AS IS / TO BE screenshots are on the original PR: #16517 Regression coverage came across with the cherry-pick: - `subscriptionQuoteFormatting.test.ts` (new, 8 cases covering exact-quote / legacy-fallback / non-USD / missing-date) - `SubscriptionAddPaymentPreviewWorkspace.test.ts`, `SubscriptionTransitionPreviewWorkspace.test.ts`, `SubscriptionTransitionPreviewWorkspaceReactivation.test.ts` - `browser_tests/tests/cloudSubscribeDeepLink.spec.ts` (e2e) Unit tests were not runnable in the backport sandbox (a local happy-dom issue fails untouched pre-existing specs identically), so CI on this PR is the verifying signal.
|
|
|
Summary
Consolidates the complete embedded subscription checkout frontend onto current
mainas the single review tip, including the design stack, safety gates, exact quote contract UI, saved methods, and 3DS recovery.Changes
Review Focus
Review exact quote freshness, reactivation safeguards, saved-method confirmation, and retryable/reconciliation 3DS states together.
Checks run locally: typecheck, browser fixture typecheck, format, lint/oxlint, knip, 231 billing-focused Vitest tests, and cloud Playwright test discovery.
Screenshots (if applicable)
AS IS / TO BE screenshots and preview will be attached after the combined environment exists.