Skip to content

Commit daa9aff

Browse files
christian-byrneclaudeactions-userMyestery
authored
[Backport] update subscription panel for new designs (#6397)
## Summary Backport of PR #6378 to `rh-test` branch. ## Changes - Extract credit calculations into useSubscriptionCredits composable - Extract action handlers into useSubscriptionActions composable - Add comprehensive component and unit tests - Update subscription panel layout to match Figma design exactly - Add proper design tokens for modal card surfaces - Update terminology from "API Nodes" to "Partner Nodes" - Make credit breakdown dynamic with real API data - Add proper loading states and error handling - Remove unused tailwindcss eslint dependencies ## Conflicts Resolved - Resolved merge conflicts in `packages/design-system/src/css/style.css` related to button surface CSS variables ## Test plan - Existing tests pass - New tests for subscription composables and components ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6397-Backport-update-subscription-panel-for-new-designs-29c6d73d3650812aaa12ff242fd5e078) by [Unito](https://www.unito.io) --------- Co-authored-by: Claude <[email protected]> Co-authored-by: GitHub Action <[email protected]> Co-authored-by: Johnpaul Chiwetelu <[email protected]>
1 parent 5fa4dcd commit daa9aff

File tree

11 files changed

+850
-150
lines changed

11 files changed

+850
-150
lines changed

packages/design-system/src/css/style.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@
126126
--content-hover-bg: #adadad;
127127
--content-hover-fg: #000;
128128

129+
--button-surface: var(--color-white);
130+
--button-surface-contrast: var(--color-black);
131+
132+
--modal-card-button-surface: var(--color-smoke-300);
133+
129134
/* Code styling colors for help menu*/
130135
--code-text-color: rgb(0 122 255 / 1);
131136
--code-bg-color: rgb(96 165 250 / 0.2);
@@ -168,6 +173,15 @@
168173
.dark-theme {
169174
--accent-primary: var(--color-pure-white);
170175
--backdrop: var(--color-neutral-900);
176+
177+
--button-surface: var(--color-charcoal-600);
178+
--button-surface-contrast: var(--color-white);
179+
--button-hover-surface: var(--color-charcoal-600);
180+
--button-active-surface: var(--color-charcoal-600);
181+
--button-icon: var(--color-smoke-800);
182+
183+
--modal-card-button-surface: var(--color-charcoal-300);
184+
171185
--dialog-surface: var(--color-neutral-700);
172186
--node-component-border: var(--color-stone-200);
173187
--node-component-border-error: var(--color-danger-100);
@@ -196,6 +210,12 @@
196210

197211
@theme inline {
198212
--color-backdrop: var(--backdrop);
213+
--color-button-active-surface: var(--button-active-surface);
214+
--color-button-hover-surface: var(--button-hover-surface);
215+
--color-button-icon: var(--button-icon);
216+
--color-button-surface: var(--button-surface);
217+
--color-button-surface-contrast: var(--button-surface-contrast);
218+
--color-modal-card-button-surface: var(--modal-card-button-surface);
199219
--color-dialog-surface: var(--dialog-surface);
200220
--color-node-component-border: var(--node-component-border);
201221
--color-node-component-executing: var(--node-component-executing);

src/components/topbar/TopbarBadge.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
>
3838
{{ badge.label }}
3939
</div>
40-
<div class="text-sm font-semibold">{{ badge.text }}</div>
40+
<div class="text-sm font-inter">{{ badge.text }}</div>
4141
<div v-if="badge.tooltip" class="text-xs">
4242
{{ badge.tooltip }}
4343
</div>
@@ -90,7 +90,7 @@
9090
>
9191
{{ badge.label }}
9292
</div>
93-
<div class="text-sm font-semibold">{{ badge.text }}</div>
93+
<div class="text-sm font-inter">{{ badge.text }}</div>
9494
<div v-if="badge.tooltip" class="text-xs">
9595
{{ badge.tooltip }}
9696
</div>
@@ -117,7 +117,7 @@
117117
>
118118
{{ badge.label }}
119119
</div>
120-
<div class="font-inter text-sm font-extrabold" :class="textClasses">
120+
<div class="font-inter text-sm" :class="textClasses">
121121
{{ badge.text }}
122122
</div>
123123
</div>

src/locales/en/main.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,18 +1931,24 @@
19311931
"renewsDate": "Renews {date}",
19321932
"expiresDate": "Expires {date}",
19331933
"manageSubscription": "Manage subscription",
1934-
"apiNodesBalance": "\"API Nodes\" Credit Balance",
1935-
"apiNodesDescription": "For running commercial/proprietary models",
1934+
"partnerNodesBalance": "\"Partner Nodes\" Credit Balance",
1935+
"partnerNodesDescription": "For running commercial/proprietary models",
19361936
"totalCredits": "Total credits",
19371937
"viewUsageHistory": "View usage history",
19381938
"addApiCredits": "Add API credits",
1939+
"addCredits": "Add credits",
1940+
"monthlyCreditsRollover": "These credits will rollover to the next month",
1941+
"monthlyBonusDescription": "Monthly credit bonus",
1942+
"prepaidDescription": "Pre-paid credits",
1943+
"prepaidCreditsInfo": "Credits purchased separately that don't expire",
1944+
"nextBillingCycle": "next billing cycle",
19391945
"yourPlanIncludes": "Your plan includes:",
19401946
"viewMoreDetails": "View more details",
19411947
"learnMore": "Learn more",
19421948
"messageSupport": "Message support",
19431949
"invoiceHistory": "Invoice history",
19441950
"benefits": {
1945-
"benefit1": "$10 in monthly credits for API models — top up when needed",
1951+
"benefit1": "Monthly credits for Partner Nodes — top up when needed",
19461952
"benefit2": "Up to 30 min runtime per job"
19471953
},
19481954
"required": {

src/platform/cloud/subscription/components/SubscriptionBenefits.vue

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<template>
2-
<div class="flex flex-col gap-4">
2+
<div class="flex flex-col items-start gap-1 self-stretch">
33
<div class="flex items-start gap-2">
4-
<i class="pi pi-check mt-1 text-sm" />
5-
<span class="text-sm">
4+
<i class="pi pi-check mt-1 text-xs text-text-primary" />
5+
<span class="text-sm text-text-primary">
66
{{ $t('subscription.benefits.benefit1') }}
77
</span>
88
</div>
99

10-
<div class="flex items-start gap-2 pb-2">
11-
<i class="pi pi-check mt-1 text-sm" />
12-
<span class="text-sm">
10+
<div class="flex items-start gap-2">
11+
<i class="pi pi-check mt-1 text-xs text-text-primary" />
12+
<span class="text-sm text-text-primary">
1313
{{ $t('subscription.benefits.benefit2') }}
1414
</span>
1515
</div>
@@ -19,8 +19,15 @@
1919
text
2020
icon="pi pi-external-link"
2121
icon-pos="left"
22-
size="small"
23-
class="self-start !p-0 text-sm hover:!bg-transparent [&]:!text-[inherit]"
22+
class="flex h-8 min-h-6 py-2 px-0 items-center gap-2 rounded text-text-secondary"
23+
:pt="{
24+
icon: {
25+
class: 'text-xs text-text-secondary'
26+
},
27+
label: {
28+
class: 'text-sm text-text-secondary'
29+
}
30+
}"
2431
@click="handleViewMoreDetails"
2532
/>
2633
</div>

0 commit comments

Comments
 (0)