From b53976c7753ecf87bdce7569e5015e71bb000da9 Mon Sep 17 00:00:00 2001 From: Simula_r <18093452+simula-r@users.noreply.github.com> Date: Fri, 9 Jan 2026 15:14:55 -0800 Subject: [PATCH] [backport cloud/1.36] Feat(cloud)/new top up dialog (#7932) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of #7899 to `cloud/1.36` ## Summary - Implement the new add credits (top up) dialog - Refactor the subscription dialog to make different credit types easier to understand ## Conflicts Resolved - `src/components/dialog/content/TopUpCreditsDialogContent.vue` - Took PR version (new UI) - `src/locales/en/main.json` - Added missing `usdAmount` translation key Automatically created by manual backport process. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7932-backport-cloud-1-36-Feat-cloud-new-top-up-dialog-2e36d73d3650812dba2cd7edcb43259b) by [Unito](https://www.unito.io) --- .../content/TopUpCreditsDialogContent.vue | 314 ++++++++++++------ .../ui/stepper/FormattedNumberStepper.vue | 176 ++++++++++ src/locales/en/main.json | 25 +- .../components/SubscriptionPanel.vue | 157 +++++---- src/services/dialogService.ts | 3 +- .../components/SubscriptionPanel.test.ts | 3 + 6 files changed, 512 insertions(+), 166 deletions(-) create mode 100644 src/components/ui/stepper/FormattedNumberStepper.vue diff --git a/src/components/dialog/content/TopUpCreditsDialogContent.vue b/src/components/dialog/content/TopUpCreditsDialogContent.vue index 6985aa7ad..0a2884daf 100644 --- a/src/components/dialog/content/TopUpCreditsDialogContent.vue +++ b/src/components/dialog/content/TopUpCreditsDialogContent.vue @@ -1,133 +1,259 @@ diff --git a/src/locales/en/main.json b/src/locales/en/main.json index 0b6b5ba6b..eb81a4be4 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -10,8 +10,10 @@ "downloadVideo": "Download video", "editOrMaskImage": "Edit or mask image", "editImage": "Edit image", + "decrement": "Decrement", "deleteImage": "Delete image", "deleteAudioFile": "Delete audio file", + "increment": "Increment", "removeImage": "Remove image", "removeVideo": "Remove video", "chart": "Chart", @@ -1897,12 +1899,25 @@ "insufficientWorkflowMessage": "You don't have enough credits to run this workflow.", "creditsDescription": "Credits are used to run workflows or partner nodes.", "howManyCredits": "How many credits would you like to add?", + "usdAmount": "${amount}", "videosEstimate": "~{count} videos*", "templateNote": "*Generated with Wan Fun Control template", "buy": "Buy", "purchaseError": "Purchase Failed", "purchaseErrorDetail": "Failed to purchase credits: {error}", - "unknownError": "An unknown error occurred" + "unknownError": "An unknown error occurred", + "viewPricing": "View pricing details", + "youPay": "Amount (USD)", + "youGet": "Credits", + "buyCredits": "Continue to payment", + "minimumPurchase": "${amount} minimum ({credits} credits)", + "maximumAmount": "${amount} max.", + "creditsPerDollar": "credits per dollar", + "amountToPayLabel": "Amount to pay in dollars", + "creditsToReceiveLabel": "Credits to receive", + "selectAmount": "Select amount", + "needMore": "Need more?", + "contactUs": "Contact us" }, "creditsAvailable": "Credits available", "refreshes": "Refreshes {date}", @@ -1939,9 +1954,9 @@ "monthlyBonusDescription": "Monthly credit bonus", "prepaidDescription": "Pre-paid credits", "prepaidCreditsInfo": "Pre-paid credits expire after 1 year from purchase date.", - "creditsRemainingThisMonth": "Credits remaining this month", - "creditsRemainingThisYear": "Credits remaining this year", - "creditsYouveAdded": "Credits you've added", + "creditsRemainingThisMonth": "Included (Refills {date})", + "creditsRemainingThisYear": "Included (Refills {date})", + "creditsYouveAdded": "Additional", "monthlyCreditsInfo": "These credits refresh monthly and don't roll over", "viewMoreDetailsPlans": "View more details about plans & pricing", "nextBillingCycle": "next billing cycle", @@ -1996,7 +2011,7 @@ "subscribeTo": "Subscribe to {plan}", "monthlyCreditsLabel": "Monthly credits", "yearlyCreditsLabel": "Total yearly credits", - "maxDurationLabel": "Max duration of each workflow run", + "maxDurationLabel": "Max run duration", "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "addCreditsLabel": "Add more credits whenever", "customLoRAsLabel": "Import your own LoRAs", diff --git a/src/platform/cloud/subscription/components/SubscriptionPanel.vue b/src/platform/cloud/subscription/components/SubscriptionPanel.vue index a2d246a19..9017dee39 100644 --- a/src/platform/cloud/subscription/components/SubscriptionPanel.vue +++ b/src/platform/cloud/subscription/components/SubscriptionPanel.vue @@ -84,8 +84,8 @@ -
-
+
+
- +
@@ -120,60 +120,39 @@
-
-
- -
- {{ monthlyBonusCredits }} -
-
-
+ + + + + + + + + + +
+ + {{ includedCreditsDisplay }} + {{ creditsRemainingLabel }} - - - -
- -
- {{ prepaidCredits }} -
-
-
+
+ + {{ prepaidCredits }} + {{ $t('subscription.creditsYouveAdded') }} - - - - - +
-
+
{{ $t('subscription.yourPlanIncludes') }}
@@ -288,7 +267,7 @@