Repository navigation
feat(billing): saved-method confirm and confirm-screen convergence - #14449
comfydesigner wants to merge 3 commits into
Conversation
Saved payment methods (contract pending): - savedMethodsForConfirm plumbing in the unified dialog; the capture form is skipped when methods exist and the confirm renders as a narrow summary. SavedPaymentMethod is typed (card | alipay | bank) with per-type display: cards/banks show brand + last4, Alipay is a linked account with neither - One method: 40px row with a Change affordance; two or more: a SingleSelect picker whose last option (Add new payment method) expands back into the capture layout, animated by the existing width transition. Selection is display-only until the backend exposes method ids Confirm-screen convergence: - Plan-change previews join the narrow dark 512px frame with the width animation from pricing; single self-provided title with inline back arrow, 24px price, tabular and grouped numerals throughout - Content order per Figma 5344-35724: credits lead, proration addends join the total under one divider - Promo code extracted to SubscriptionPromoCodeField (trigger -> auto-focused input -> collapse on empty blur) and added to immediate plan changes; the change-preview endpoint does not accept a code yet - Complete verification is inverted and first when a 3DS action is pending; the confirm demotes to tertiary Frame and rhythm: - Narrow steps pin to min(740px,85vh) below xl (90vh cap at xl) so the CTA anchors at one height across states; content enters with a motion-safe fade-and-rise, which carries the transition on mobile where the frame no longer resizes - One stationary corner close button (top-6) aligned to the header row line at every step; footer and promo spacing unified to the compressed rhythm - Totals grouped (,560.00) with the numeric path to Stripe's amountCents kept separate from display formatting
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
🎭 Playwright: ❌ 1761 passed, 5 failed❌ Failed Tests📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-08-01T01:58:25.248Z",
"gitSha": "bf4f9b4e3a846c28372f8b3e8e8cb8e0d90680fd",
"branch": "comfydesigner/saved-method-confirm",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2131.508999999994,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.014999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 765.348,
"heapDeltaBytes": 5359404,
"heapUsedBytes": 77214004,
"domNodes": 18,
"jsHeapTotalBytes": 18997248,
"scriptDurationMs": 29.12,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2068.356000000051,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.505,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 578.0419999999999,
"heapDeltaBytes": 5296584,
"heapUsedBytes": 77031556,
"domNodes": 16,
"jsHeapTotalBytes": 19521536,
"scriptDurationMs": 20.419,
"eventListeners": 5,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1908.7539999999876,
"styleRecalcs": 77,
"styleRecalcDurationMs": 44.18900000000001,
"layouts": 12,
"layoutDurationMs": 3.5779999999999994,
"taskDurationMs": 1029.0190000000002,
"heapDeltaBytes": -248244,
"heapUsedBytes": 71373264,
"domNodes": 60,
"jsHeapTotalBytes": 20307968,
"scriptDurationMs": 134.575,
"eventListeners": 7,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1839.6079999999984,
"styleRecalcs": 74,
"styleRecalcDurationMs": 37.799,
"layouts": 12,
"layoutDurationMs": 3.8520000000000003,
"taskDurationMs": 915.4740000000002,
"heapDeltaBytes": -30320,
"heapUsedBytes": 71591904,
"domNodes": 57,
"jsHeapTotalBytes": 19783680,
"scriptDurationMs": 125.14599999999999,
"eventListeners": 7,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1751.1019999999462,
"styleRecalcs": 30,
"styleRecalcDurationMs": 18.513,
"layouts": 6,
"layoutDurationMs": 0.7550000000000002,
"taskDurationMs": 492.24300000000005,
"heapDeltaBytes": 8347496,
"heapUsedBytes": 80008836,
"domNodes": 75,
"jsHeapTotalBytes": 19259392,
"scriptDurationMs": 25.099,
"eventListeners": 21,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1734.5819999999321,
"styleRecalcs": 30,
"styleRecalcDurationMs": 17.46,
"layouts": 6,
"layoutDurationMs": 0.6430000000000001,
"taskDurationMs": 467.781,
"heapDeltaBytes": -18165156,
"heapUsedBytes": 53442596,
"domNodes": 75,
"jsHeapTotalBytes": 18735104,
"scriptDurationMs": 22.742,
"eventListeners": 22,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 672.8779999999688,
"styleRecalcs": 13,
"styleRecalcDurationMs": 9.185,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 440.829,
"heapDeltaBytes": -11589456,
"heapUsedBytes": 59804504,
"domNodes": 22,
"jsHeapTotalBytes": 20307968,
"scriptDurationMs": 59.958000000000006,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 622.0270000000028,
"styleRecalcs": 11,
"styleRecalcDurationMs": 8.050999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 423.181,
"heapDeltaBytes": -11832520,
"heapUsedBytes": 59933236,
"domNodes": 18,
"jsHeapTotalBytes": 20570112,
"scriptDurationMs": 59.18799999999999,
"eventListeners": 5,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2036.6450000000214,
"styleRecalcs": 9,
"styleRecalcDurationMs": 9.134,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 956.318,
"heapDeltaBytes": 1427312,
"heapUsedBytes": 63321224,
"domNodes": -292,
"jsHeapTotalBytes": 4775936,
"scriptDurationMs": 126.67200000000001,
"eventListeners": -176,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-idle",
"durationMs": 2043.0359999999155,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.877999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 805.5009999999999,
"heapDeltaBytes": 8446520,
"heapUsedBytes": 70854384,
"domNodes": -288,
"jsHeapTotalBytes": 4251648,
"scriptDurationMs": 113.902,
"eventListeners": -146,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-pan",
"durationMs": 2206.2630000000354,
"styleRecalcs": 69,
"styleRecalcDurationMs": 15.313000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1432.686,
"heapDeltaBytes": 1992204,
"heapUsedBytes": 65255352,
"domNodes": -294,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 436.607,
"eventListeners": -146,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2290.277999999944,
"styleRecalcs": 67,
"styleRecalcDurationMs": 13.376000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1434.993,
"heapDeltaBytes": -5362184,
"heapUsedBytes": 58205516,
"domNodes": -297,
"jsHeapTotalBytes": 5038080,
"scriptDurationMs": 448.033,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3425.7819999999697,
"styleRecalcs": 65,
"styleRecalcDurationMs": 16.550999999999995,
"layouts": 60,
"layoutDurationMs": 9.128,
"taskDurationMs": 1768.67,
"heapDeltaBytes": 8333476,
"heapUsedBytes": 72955732,
"domNodes": -294,
"jsHeapTotalBytes": 7397376,
"scriptDurationMs": 596.719,
"eventListeners": -150,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3265.0090000000773,
"styleRecalcs": 64,
"styleRecalcDurationMs": 14.973,
"layouts": 60,
"layoutDurationMs": 8.383999999999999,
"taskDurationMs": 1611.6670000000001,
"heapDeltaBytes": 26283552,
"heapUsedBytes": 91017288,
"domNodes": 13,
"jsHeapTotalBytes": 8388608,
"scriptDurationMs": 551.86,
"eventListeners": 9,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000013,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2044.7829999999954,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.467999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 834.5889999999999,
"heapDeltaBytes": 8155208,
"heapUsedBytes": 72400544,
"domNodes": -294,
"jsHeapTotalBytes": 4775936,
"scriptDurationMs": 116.399,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2042.8120000000263,
"styleRecalcs": 6,
"styleRecalcDurationMs": 5.591000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 828.222,
"heapDeltaBytes": 4289232,
"heapUsedBytes": 68987044,
"domNodes": -293,
"jsHeapTotalBytes": 4775936,
"scriptDurationMs": 118.453,
"eventListeners": -146,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 722.4349999999617,
"styleRecalcs": 46,
"styleRecalcDurationMs": 13.886000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 481.53399999999993,
"heapDeltaBytes": -11072068,
"heapUsedBytes": 60679332,
"domNodes": 18,
"jsHeapTotalBytes": 20832256,
"scriptDurationMs": 128.203,
"eventListeners": 10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 653.5560000000942,
"styleRecalcs": 46,
"styleRecalcDurationMs": 10.211000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 446.503,
"heapDeltaBytes": -10760872,
"heapUsedBytes": 60849024,
"domNodes": 18,
"jsHeapTotalBytes": 20307968,
"scriptDurationMs": 124.881,
"eventListeners": 10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-idle",
"durationMs": 2018.4570000000122,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.716999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 644.89,
"heapDeltaBytes": 4779420,
"heapUsedBytes": 76371628,
"domNodes": 18,
"jsHeapTotalBytes": 19521536,
"scriptDurationMs": 20.750999999999998,
"eventListeners": 5,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2020.7520000000159,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.658,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 561.028,
"heapDeltaBytes": 4709820,
"heapUsedBytes": 76436248,
"domNodes": 20,
"jsHeapTotalBytes": 19521536,
"scriptDurationMs": 16.732999999999997,
"eventListeners": 5,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1739.2759999999612,
"styleRecalcs": 76,
"styleRecalcDurationMs": 39.834,
"layouts": 16,
"layoutDurationMs": 4.475,
"taskDurationMs": 905.2199999999999,
"heapDeltaBytes": -3713900,
"heapUsedBytes": 67665056,
"domNodes": 64,
"jsHeapTotalBytes": 20307968,
"scriptDurationMs": 99.14500000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1724.7350000000097,
"styleRecalcs": 75,
"styleRecalcDurationMs": 39.285000000000004,
"layouts": 16,
"layoutDurationMs": 4.708,
"taskDurationMs": 868.923,
"heapDeltaBytes": -3997276,
"heapUsedBytes": 67625448,
"domNodes": 62,
"jsHeapTotalBytes": 20307968,
"scriptDurationMs": 100.715,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 1427.3099999999772,
"styleRecalcs": 19,
"styleRecalcDurationMs": 29.933,
"layouts": 15,
"layoutDurationMs": 11.443000000000001,
"taskDurationMs": 994.4949999999999,
"heapDeltaBytes": 30015640,
"heapUsedBytes": 102675008,
"domNodes": 13673,
"jsHeapTotalBytes": 16252928,
"scriptDurationMs": 35.43600000000001,
"eventListeners": 2371,
"totalBlockingTimeMs": 128,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8513.671999999986,
"styleRecalcs": 250,
"styleRecalcDurationMs": 42.452,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5022.407,
"heapDeltaBytes": 24374256,
"heapUsedBytes": 86461348,
"domNodes": -291,
"jsHeapTotalBytes": 6524928,
"scriptDurationMs": 1445.6039999999998,
"eventListeners": -159,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8482.70100000002,
"styleRecalcs": 249,
"styleRecalcDurationMs": 41.135,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4932.934,
"heapDeltaBytes": 8860784,
"heapUsedBytes": 70942036,
"domNodes": -290,
"jsHeapTotalBytes": 6524928,
"scriptDurationMs": 1405.479,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 18715.49299999998,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18347.295,
"heapDeltaBytes": -44524908,
"heapUsedBytes": 171132244,
"domNodes": -8315,
"jsHeapTotalBytes": -8560640,
"scriptDurationMs": 611.071,
"eventListeners": -16388,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 18573.620000000006,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18210.933999999997,
"heapDeltaBytes": -42135536,
"heapUsedBytes": 186360092,
"domNodes": -8312,
"jsHeapTotalBytes": -8847360,
"scriptDurationMs": 624.35,
"eventListeners": -16387,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 23044.51599999999,
"styleRecalcs": 176,
"styleRecalcDurationMs": 26.33599999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 22791.685,
"heapDeltaBytes": -58519712,
"heapUsedBytes": 156970568,
"domNodes": -8315,
"jsHeapTotalBytes": -9084928,
"scriptDurationMs": 1019.6540000000001,
"eventListeners": -16382,
"totalBlockingTimeMs": 786,
"frameDurationMs": 17.77333333333336,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 23419.878999999924,
"styleRecalcs": 175,
"styleRecalcDurationMs": 26.783999999999974,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 23196.16,
"heapDeltaBytes": -54404756,
"heapUsedBytes": 168388460,
"domNodes": -8312,
"jsHeapTotalBytes": -13828096,
"scriptDurationMs": 974.2050000000002,
"eventListeners": -16383,
"totalBlockingTimeMs": 804,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 494.39299999994546,
"styleRecalcs": 20,
"styleRecalcDurationMs": 24.238999999999997,
"layouts": 3,
"layoutDurationMs": 1.3390000000000002,
"taskDurationMs": 137.858,
"heapDeltaBytes": -15516092,
"heapUsedBytes": 55262040,
"domNodes": 154,
"jsHeapTotalBytes": 6676480,
"scriptDurationMs": 13.620000000000001,
"eventListeners": 68,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 472.6020000000517,
"styleRecalcs": 12,
"styleRecalcDurationMs": 21.053,
"layouts": 3,
"layoutDurationMs": 0.738,
"taskDurationMs": 126.20799999999998,
"heapDeltaBytes": -15960048,
"heapUsedBytes": 54792996,
"domNodes": 115,
"jsHeapTotalBytes": 6414336,
"scriptDurationMs": 12.095999999999998,
"eventListeners": 67,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
}
]
} |
The SingleSelect trigger renders the selected method's per-type icon (card/alipay/bank) via the icon slot, matching the single-method row. Also repairs two stale tests asserting the pre-redesign UI: the yearly total is grouped, and the removed back-to-plans link no longer has a pending-state test to satisfy.
A subscribe or plan-change charge that failed during polling stranded the dialog on the confirm step with only the store's toast. The checkout composable now routes the operation's failed terminal state to a declined step (same guards as success: operation id and workspace), carrying the error message. New SubscriptionPaymentDeclinedWorkspace renders the Figma 4198-20207 state on the narrow dark frame: header back arrow to the confirm screen, declined copy, reason tile, portal-routed Update payment method. Capture-step declines keep Stripe's inline handling.
## Summary 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. ## Changes - **What**: Replays and reconciles the frontend work from Comfy-Org#14447, Comfy-Org#14449, Comfy-Org#14476, and Comfy-Org#14482 without modifying those provenance PRs or branches. - **Dependencies**: Requires the combined backend environment for end-to-end preview validation. ## 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. --------- Co-authored-by: Amp <amp@ampcode.com>
dante01yoon
left a comment
There was a problem hiding this comment.
The confirm-screen convergence work reads well and I appreciate how explicitly the description marks what's waiting on the backend — that made this much faster to review.
One blocking item, and it's good news: the contract you're waiting for already exists.
The description says the saved-method list is "null until the backend supplies it, so this ships dark" and lists "Backend contract needed: preview response should carry saved methods [{ type, brand?, last4?, id, isDefault }]". But @comfyorg/ingest-types already exports both the endpoint and the type:
// packages/ingest-types/src/types.gen.ts
export type SavedPaymentMethod = {
brand?: string // Card brand. Present only for card payment methods.
id: string
is_default: boolean // Exactly one item is the default when the list is non-empty.
last4?: string
type: string
}plus ListSavedPaymentMethodsData / ListSavedPaymentMethodsResponse for /api/billing/payment-methods (the path is in the spec at L6733). That is exactly the shape the description asks for, is_default included.
So rather than a change request against your design, this is: the plumbing can be wired to the real endpoint and the generated type, and this doesn't have to ship dark at all.
The blocking part is the hand-declared copy — same class of bug as #14771, and coincidentally the same type name. Details inline.
Unanchored
Still genuinely open. These aren't resolved by the above and remain real gaps:
promotion_codeon the change-preview endpoint — I confirmed it isn't in the spec, so the template comment is accurate.- Whether subscribe accepts a chosen method id.
- Your question about whether the current flow shows the capture form to customers who already have a saved method — worth getting answered before this lands, since
captureMode(L323) now encodes an assumed answer.
Type placement. SavedPaymentMethod is exported from a .vue file and imported across components (SubscriptionRequiredDialogContentUnified.vue L181). Even for genuinely FE-only types that's a fragile home; once this switches to the generated export the import should come from @comfyorg/ingest-types directly and the cross-component .vue type import can go away.
| import SubscriptionTermsNote from './SubscriptionTermsNote.vue' | ||
| import UnifiedStripePaymentSelector from './UnifiedStripePaymentSelector.vue' | ||
|
|
||
| export interface SavedPaymentMethod { |
There was a problem hiding this comment.
issue: This re-declares a server response type that already exists in the generated package, and the copy has drifted from it before the feature has even shipped.
Generated (@comfyorg/ingest-types):
export type SavedPaymentMethod = {
brand?: string
id: string // required
is_default: boolean // required
last4?: string
type: string
}This PR:
export interface SavedPaymentMethod {
type: 'card' | 'alipay' | 'bank'
brand?: string
last4?: string
}Three divergences, each with a concrete consequence:
idis missing. Your own description says subscribe needs to "accept the chosen method id" — butselectedMethodDetails(L342) resolves a method by array index (savedMethods?.[Number(selectedMethod.value)]), so there is no id to send. With the generated type the id is right there.is_defaultis missing. The contract guarantees "exactly one item is the default when the returned list is non-empty" — that's the natural initial selection, and right now the picker can't express it.typeis narrowed to a closed union. The contract hastype: string, deliberately open. A method type outside these three (Link, Cash App,us_bank_account) either fails to typecheck at the boundary or falls throughmethodLabel(L325) to whatever the fallback renders. This is precisely the refactor: derive workspaceApi types from @comfyorg/ingest-types #14771 failure — a value the server can send that the hand-declared type doesn't know about.
Could this import the generated SavedPaymentMethod instead? If the UI needs an FE-only addition, a thin intersection on top of the generated export is fine — it's the full local redeclaration that drifts.
| // Default payment method for the confirming workspace. The backend does not | ||
| // expose this pre-confirm yet; once it does, populate from the preview | ||
| // response and the capture form becomes first-subscribe-only. | ||
| const savedMethodsForConfirm = ref<SavedPaymentMethod[] | null>(null) |
There was a problem hiding this comment.
issue: savedMethodsForConfirm is a ref initialised to null and, as far as I can tell, never assigned from a server read — which is what makes this ship dark.
But /api/billing/payment-methods is in the contract with ListSavedPaymentMethodsResponse, so this can be a real fetch today rather than a placeholder waiting on backend work.
That matters beyond "it could work sooner", because the null placeholder is currently load-bearing for behavior: L213 and L227 gate the step layout on !savedMethodsForConfirm.value?.length, and L289 feeds it into a transition key. Every one of those paths is exercised only in the empty state right now, so the populated branches ship untested. A live fetch makes them reachable — and testable — instead of dead until a follow-up flips them on.
Relatedly, @change-payment-method="savedMethodsForConfirm = null" (L119, L134) discards the fetched list to re-enter capture mode. Once this is server-backed, nulling the source of truth to drive a UI mode will mean a refetch to get back. A separate useCaptureMode boolean would keep the server data and the view state independent.
| ]) | ||
| const selectedMethod = ref('0') | ||
| const selectedSavedMethod = computed( | ||
| () => savedMethods?.[Number(selectedMethod.value)] ?? null |
There was a problem hiding this comment.
question: Selection is stored as a stringified array index and resolved positionally:
() => savedMethods?.[Number(selectedMethod.value)] ?? nullIf the list is refetched or reordered between selection and submit — a method added or removed in another tab, or the server's ordering not being stable — the index now points at a different card, and the customer is charged on a method they didn't pick.
The contract's id field is the stable key for this. Is there a reason the picker binds to the index rather than the id, beyond SingleSelect ergonomics?
There was a problem hiding this comment.
Better news than the comment hoped: the contract isn't just available — main already consumes it. workspaceApi.ts imports SavedPaymentMethod from @comfyorg/ingest-types (re-exported at line 124), listSavedPaymentMethods() returns the generated type, and the shipped saved-method confirm selects by id through selectedSavedMethodId — the index-selection bug exists only on this branch, which is five weeks behind a surface that was rebuilt underneath it. The rest of this PR landed better elsewhere too: the declined step is #15944's SubscriptionDeclinedWorkspace, the promo entry is the inline row, the confirm-screen convergence happened in the consolidation. Unique residue here is the 'bank' method type and the picker-trigger glyph, neither of which is in the current designs. Proposing we close this as superseded (Alex to confirm) and extract the residue as tickets if wanted — reviewing it further would be reviewing a timeline that no longer exists.
|
Closing as superseded per the thread above: the flagged index-selection bug is already fixed on main (generated SavedPaymentMethod with id/is_default, id-based selection), the declined step landed as #15944's SubscriptionDeclinedWorkspace, and the confirm-screen convergence happened in the consolidation. The two pieces unique to this branch — the 'bank' method type and the picker-trigger glyph — aren't in the current designs; they can be ticketed if they return. |
Stacked on
comfydesigner/payment-element-visual-pass. Two things: the saved-payment-method confirm, and convergence of every confirm screen onto the design update.Saved-method confirm
Team decision: the embedded Stripe form is for initial capture only; customers with a saved method get a narrow summary confirm instead.
savedMethodsForConfirmplumbing in the unified dialog — null until the backend supplies it, so this ships dark. When populated, the capture split is skipped and the confirm renders at the success step's 512px dark frameSavedPaymentMethodis typed (card | alipay | bank): cards/banks display brand + last4, Alipay is a linked account with neitherSingleSelectpicker whose last option ("Add new payment method") expands back into the capture layout via the existing width animation[{ type, brand?, last4?, id, isDefault }]pre-confirm; subscribe should accept the chosen method id. Also confirm whether the current flow shows the capture form to customers who already have a saved method (forced card re-entry)Confirm-screen convergence
SubscriptionTransitionPreviewWorkspace) join the narrow dark 512px frame: single self-provided title with inline back arrow, 24px price, tabular + grouped numerals, inverted CTA (demoting to tertiary while a 3DS verification is pending)SubscriptionPromoCodeFieldand added to immediate plan changes — the change-preview endpoint does not acceptpromotion_codeyet, so the value has nowhere to go (marked in a template comment)min(740px, 85vh)below xl so the CTA anchors at one height across all states; content enters with a motion-safe fade-and-rise, which carries the transition on mobile where the frame no longer resizesKnown follow-ups: promo validation/requote endpoints (subscribe + change), saved-method list contract, promo-applied success data. The legacy per-member team dialog renders the restyled change screens on its old shell (double title survives there only).