From 515648411fefd99e0428fb186bfa220187622c9f Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 12 Nov 2026 01:48:35 -0800 Subject: [PATCH] fix(cloud): ENTITLEMENTS-D plan-unavailable body stays muted (design-squad); feature-copy test uses the real translator --- .../src/components/billing/checkout/CheckoutPanel.tsx | 5 ++++- .../src/components/billing/plans/plan-feature-copy.test.ts | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/components/billing/checkout/CheckoutPanel.tsx b/src/renderer/src/components/billing/checkout/CheckoutPanel.tsx index 5c65ffe052b..e800f2559f2 100644 --- a/src/renderer/src/components/billing/checkout/CheckoutPanel.tsx +++ b/src/renderer/src/components/billing/checkout/CheckoutPanel.tsx @@ -256,7 +256,10 @@ export function CheckoutPanel(props: CheckoutPanelProps): React.JSX.Element { id={bodyId} className={cn( 'max-w-sm text-sm text-pretty', - phase.kind === 'open-failed' ? 'text-destructive' : 'text-muted-foreground' + // Unavailable is not the buyer's error: the title and icon carry it, the body stays muted. + phase.kind === 'open-failed' && phase.result.status !== 'plan-unavailable' + ? 'text-destructive' + : 'text-muted-foreground' )} > {body} diff --git a/src/renderer/src/components/billing/plans/plan-feature-copy.test.ts b/src/renderer/src/components/billing/plans/plan-feature-copy.test.ts index 4770c1348b5..8f7cba62dba 100644 --- a/src/renderer/src/components/billing/plans/plan-feature-copy.test.ts +++ b/src/renderer/src/components/billing/plans/plan-feature-copy.test.ts @@ -1,10 +1,7 @@ import { describe, expect, it } from 'vitest' +import { translate as t } from '@/i18n/i18n' import { planFeatureLine, planFeatureLines } from './plan-feature-copy' -// The default-value translator the renderer falls back to (interpolates {{name}}). -const t = ((_key: string, fallback: string, values?: Record) => - fallback.replace(/\{\{(\w+)\}\}/g, (_, name: string) => String(values?.[name] ?? ''))) as never - const context = { overage: { centsPerHour: 100, defaultSpendCapCents: 2500 }, currency: 'usd' } describe('plan feature copy', () => {