Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -2955,6 +2955,9 @@
"memberCta": "Ok, got it",
"memberRunTooltip": "Contact your workspace owner to resubscribe",
"runLabel": "Run",
"salesManagedDescription": "You can't run workflows or add new members. Contact your Comfy account manager to restore access.",
"salesManagedSpendable": "Spendable once your plan is restored.",
"salesManagedEnded": "Plan credits ended with your subscription.",
"badge": "Inactive"
},
"paymentRecovery": {
Expand Down
40 changes: 35 additions & 5 deletions src/platform/cloud/subscription/components/CreditsTile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ const i18n = createI18n({
additionalCreditsInUse: 'In use',
usedAfterMonthly: 'Used after monthly runs out',
reactivateToUseCredits: 'Reactivate your plan to use these credits',
inactive: {
salesManagedSpendable: 'Spendable once your plan is restored.',
salesManagedEnded: 'Plan credits ended with your subscription.'
},
monthlyCreditsUsedUpTitle:
'Monthly credits are used up. Refills {date}',
monthlyCreditsUsedUpTitleNoDate: 'Monthly credits are used up',
Expand Down Expand Up @@ -413,11 +417,13 @@ describe('CreditsTile', () => {
expect(screen.queryByText('Add credits')).toBeNull()
})

it('keeps Add credits and the real balance on an inactive sales-managed plan', () => {
it('gives an inactive sales-managed plan the ended treatment with restore copy', () => {
activeProSubscription()
// A sales-managed plan has no self-serve reactivation to sell, so the
// reactivate-to-use-credits treatment must not apply.
state.canTopUp = true
// cloud#8001 withholds top-up once a sales-managed subscription is
// terminal, so the tile no longer keeps a live Add credits here. The note
// names restoration rather than reactivation: there is no Reactivate for
// a sales-managed plan, only the account manager.
state.canTopUp = false
state.tier = 'ENTERPRISE'
state.subscription = {
tier: 'ENTERPRISE',
Expand All @@ -426,10 +432,34 @@ describe('CreditsTile', () => {
}
const { container } = renderTile({ inactivePlan: true })

expect(container.textContent).toContain(
'Spendable once your plan is restored.'
)
expect(container.textContent).not.toContain(
'Reactivate your plan to use these credits'
)
expect(screen.getByText('Add credits')).toBeInTheDocument()
expect(screen.queryByText('Add credits')).toBeNull()
})

it('states what happened when an inactive sales-managed plan retained nothing', () => {
activeProSubscription()
state.canTopUp = false
state.tier = 'ENTERPRISE'
state.subscription = {
tier: 'ENTERPRISE',
duration: 'MONTHLY',
renewalDate: '2026-02-20T12:00:00Z'
}
state.balance = {
amountMicros: 0,
cloudCreditBalanceMicros: 0,
prepaidBalanceMicros: 0
}
const { container } = renderTile({ inactivePlan: true })

expect(container.textContent).toContain(
'Plan credits ended with your subscription.'
)
})

it('does not borrow a catalog monthly pool for an Enterprise plan', () => {
Expand Down
15 changes: 12 additions & 3 deletions src/platform/cloud/subscription/components/CreditsTile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,15 @@
</span>
</div>
<span class="text-sm">
{{ $t('subscription.reactivateToUseCredits') }}
{{
$t(
isSalesManagedPlan
? prepaidCreditsValue > 0
? 'subscription.inactive.salesManagedSpendable'
: 'subscription.inactive.salesManagedEnded'
: 'subscription.reactivateToUseCredits'
)
}}
</span>
</div>
</template>
Expand Down Expand Up @@ -296,8 +304,9 @@ const creditPoolTotalCredits = computed<number | null>(() => {
// credit pool above: can_top_up is a rollout-defaulted capability that also
// fails open for owners on an unreadable snapshot, which would drop a lapsed
// self-serve team out of this state during a capabilities outage.
const showsInactivePlanState = computed(
() => inactivePlan === true && !isSalesManagedTier(subscription.value?.tier)
const showsInactivePlanState = computed(() => inactivePlan === true)
const isSalesManagedPlan = computed(() =>
isSalesManagedTier(subscription.value?.tier)
)

const usage = computed(() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,11 @@ describe('SubscriptionPanelContentWorkspace', () => {
expect(
screen.queryByTestId('subscription-state-card')
).not.toBeInTheDocument()
expect(
screen.getByText(
"You can't run workflows or add new members. Contact your Comfy account manager to restore access."
)
).toBeInTheDocument()
})

it('marks an ended Personal plan inactive when it cannot self-serve', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@
<div v-if="planDateDisplay" class="text-sm text-text-secondary">
{{ planDateDisplay }}
</div>
<p
v-if="isNonCatalogPlan && isSubscriptionEnded"
class="m-0 text-sm text-text-secondary"
>
{{ $t('subscription.inactive.salesManagedDescription') }}
</p>
</div>

<div
Expand Down Expand Up @@ -316,7 +322,10 @@
<div class="w-full lg:max-w-md">
<CreditsTile
:zero-state="showZeroState"
:inactive-plan="showInactiveTeamSubscription"
:inactive-plan="
showInactiveTeamSubscription ||
(isNonCatalogPlan && isSubscriptionEnded)
"
/>
</div>

Expand Down
Loading