diff --git a/src/main/services/app-state.service.ts b/src/main/services/app-state.service.ts index 84f4fb29..3b2ced19 100644 --- a/src/main/services/app-state.service.ts +++ b/src/main/services/app-state.service.ts @@ -153,7 +153,8 @@ export class AppStateService { * run to hundreds of KB and every state change broadcasts the whole object. */ getRendererState(): RendererAppState { - const { interviewConfig, ...rest } = this.state; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { interviewConfig, providedLLMModel, ...rest } = this.state; return { ...rest, interviewConfig: { diff --git a/src/main/types/app-state.ts b/src/main/types/app-state.ts index 193bf564..222200a3 100644 --- a/src/main/types/app-state.ts +++ b/src/main/types/app-state.ts @@ -204,6 +204,8 @@ export interface AppState { } /** The app state as sent to the renderer, with the interview config reduced to a summary. */ -export type RendererAppState = Omit & { +// `providedLLMModel` stays in main: the app shows a generic "free model" / "SOTA model" label, and +// the exact backend model name is not something to put on screen. +export type RendererAppState = Omit & { interviewConfig: InterviewConfigSummary; }; diff --git a/src/renderer/components/custom/credits-display.tsx b/src/renderer/components/custom/credits-display.tsx index 6771226b..900d186e 100644 --- a/src/renderer/components/custom/credits-display.tsx +++ b/src/renderer/components/custom/credits-display.tsx @@ -17,7 +17,6 @@ interface CreditsDisplayProps { /** The free-tier balance, in credits. */ credits: number; subscription: SubscriptionSummary; - llmModel?: string; /** From the backend ping; falls back to the compiled-in mirror while that has not arrived. */ creditsPerMinute?: number; className?: string; @@ -27,16 +26,17 @@ interface CreditsDisplayProps { export default function CreditsDisplay({ credits, subscription, - llmModel, creditsPerMinute, className, style, }: CreditsDisplayProps) { + const t = useT(); const now = useNow(); + const subscribed = isSubscriptionActive(subscription, now); return (
- {isSubscriptionActive(subscription, now) && subscription.expiresAt !== null ? ( + {subscribed && subscription.expiresAt !== null ? ( )} - {llmModel && ( - <> -
- {llmModel} - - )} + {/* The tier, never the backend's exact model name. */} +
+ + {subscribed ? t.creditsDisplay.sotaModel : t.creditsDisplay.freeModel} +
); } diff --git a/src/renderer/components/custom/status-panel.tsx b/src/renderer/components/custom/status-panel.tsx index 55d4d69e..3e760ca8 100644 --- a/src/renderer/components/custom/status-panel.tsx +++ b/src/renderer/components/custom/status-panel.tsx @@ -20,7 +20,6 @@ interface StatusPanelProps { runningState: RunningState; credits: number; subscription: SubscriptionSummary; - llmModel: string; creditsPerMinute?: number; } @@ -34,7 +33,6 @@ const badgeClass = (active: boolean) => export default function StatusPanel({ runningState, - llmModel, credits, subscription, creditsPerMinute, @@ -51,7 +49,6 @@ export default function StatusPanel({ diff --git a/src/renderer/components/custom/titlebar.tsx b/src/renderer/components/custom/titlebar.tsx index ed6b9614..f947e77b 100644 --- a/src/renderer/components/custom/titlebar.tsx +++ b/src/renderer/components/custom/titlebar.tsx @@ -90,7 +90,6 @@ export default function Titlebar() { diff --git a/src/renderer/hooks/use-app-state.tsx b/src/renderer/hooks/use-app-state.tsx index 771dcb72..fdb16960 100644 --- a/src/renderer/hooks/use-app-state.tsx +++ b/src/renderer/hooks/use-app-state.tsx @@ -43,7 +43,6 @@ class AppStateManager { subscriptionExpiresAt: raw.subscriptionExpiresAt, subscriptionPlan: raw.subscriptionPlan, userRole: raw.userRole, - providedLLMModel: raw.providedLLMModel, creditsPerMinute: raw.creditsPerMinute, interviewConfig: raw.interviewConfig ?? { fullName: '', hasProfileData: false, hasContextData: false }, interviewConfigLoaded: raw.interviewConfigLoaded ?? false, diff --git a/src/renderer/i18n/locales/de.ts b/src/renderer/i18n/locales/de.ts index b7e9309c..6fa68086 100644 --- a/src/renderer/i18n/locales/de.ts +++ b/src/renderer/i18n/locales/de.ts @@ -621,6 +621,9 @@ export const de: Translation = { creditsDisplay: { freePlan: 'Gratis', + /** The model tier, shown instead of the backend's exact model name. */ + freeModel: 'Gratis-Modell', + sotaModel: 'SOTA-Modell', planNames: { monthly: 'Monatlich', quarterly: 'Vierteljährlich', diff --git a/src/renderer/i18n/locales/en.ts b/src/renderer/i18n/locales/en.ts index d3346ee1..c9ca6e20 100644 --- a/src/renderer/i18n/locales/en.ts +++ b/src/renderer/i18n/locales/en.ts @@ -622,6 +622,9 @@ export const en = { creditsDisplay: { freePlan: 'Free', + /** The model tier, shown instead of the backend's exact model name. */ + freeModel: 'Free model', + sotaModel: 'SOTA model', /** The plan an active subscription was bought as; `other` when the backend did not say. */ planNames: { monthly: 'Monthly', diff --git a/src/renderer/i18n/locales/es.ts b/src/renderer/i18n/locales/es.ts index 76a082af..c501d3dd 100644 --- a/src/renderer/i18n/locales/es.ts +++ b/src/renderer/i18n/locales/es.ts @@ -617,6 +617,9 @@ export const es: Translation = { creditsDisplay: { freePlan: 'Gratis', + /** The model tier, shown instead of the backend's exact model name. */ + freeModel: 'Modelo gratuito', + sotaModel: 'Modelo SOTA', planNames: { monthly: 'Mensual', quarterly: 'Trimestral', diff --git a/src/renderer/i18n/locales/fr.ts b/src/renderer/i18n/locales/fr.ts index 971d4fd3..fb04b319 100644 --- a/src/renderer/i18n/locales/fr.ts +++ b/src/renderer/i18n/locales/fr.ts @@ -621,6 +621,9 @@ export const fr: Translation = { creditsDisplay: { freePlan: 'Gratuit', + /** The model tier, shown instead of the backend's exact model name. */ + freeModel: 'Modèle gratuit', + sotaModel: 'Modèle SOTA', planNames: { monthly: 'Mensuel', quarterly: 'Trimestriel', diff --git a/src/renderer/i18n/locales/ja.ts b/src/renderer/i18n/locales/ja.ts index b696d88c..cac258b7 100644 --- a/src/renderer/i18n/locales/ja.ts +++ b/src/renderer/i18n/locales/ja.ts @@ -606,6 +606,9 @@ export const ja: Translation = { creditsDisplay: { freePlan: '無料', + /** The model tier, shown instead of the backend's exact model name. */ + freeModel: '無料モデル', + sotaModel: '最先端モデル', planNames: { monthly: '月額', quarterly: '3 か月', diff --git a/src/renderer/i18n/locales/ko.ts b/src/renderer/i18n/locales/ko.ts index c03d7e49..55563f8c 100644 --- a/src/renderer/i18n/locales/ko.ts +++ b/src/renderer/i18n/locales/ko.ts @@ -593,6 +593,9 @@ export const ko: Translation = { creditsDisplay: { freePlan: '무료', + /** The model tier, shown instead of the backend's exact model name. */ + freeModel: '무료 모델', + sotaModel: '최신 모델', planNames: { monthly: '월간', quarterly: '3개월', diff --git a/src/renderer/i18n/locales/pt.ts b/src/renderer/i18n/locales/pt.ts index 1ec85daa..b0c99e45 100644 --- a/src/renderer/i18n/locales/pt.ts +++ b/src/renderer/i18n/locales/pt.ts @@ -603,6 +603,9 @@ export const pt: Translation = { creditsDisplay: { freePlan: 'Grátis', + /** The model tier, shown instead of the backend's exact model name. */ + freeModel: 'Modelo grátis', + sotaModel: 'Modelo SOTA', planNames: { monthly: 'Mensal', quarterly: 'Trimestral', diff --git a/src/renderer/i18n/locales/ru.ts b/src/renderer/i18n/locales/ru.ts index 1785b6d8..b96c75f9 100644 --- a/src/renderer/i18n/locales/ru.ts +++ b/src/renderer/i18n/locales/ru.ts @@ -643,6 +643,9 @@ export const ru: Translation = { creditsDisplay: { freePlan: 'Бесплатно', + /** The model tier, shown instead of the backend's exact model name. */ + freeModel: 'Базовая модель', + sotaModel: 'Передовая модель', planNames: { monthly: 'Месячная', quarterly: 'Квартальная', diff --git a/src/renderer/i18n/locales/zh.ts b/src/renderer/i18n/locales/zh.ts index 12fb49bf..7dc736e0 100644 --- a/src/renderer/i18n/locales/zh.ts +++ b/src/renderer/i18n/locales/zh.ts @@ -575,6 +575,9 @@ export const zh: Translation = { creditsDisplay: { freePlan: '免费', + /** The model tier, shown instead of the backend's exact model name. */ + freeModel: '免费模型', + sotaModel: '最先进模型', planNames: { monthly: '月度', quarterly: '季度', diff --git a/src/renderer/pages/main/index.tsx b/src/renderer/pages/main/index.tsx index ba3bbd63..7d4dab75 100644 --- a/src/renderer/pages/main/index.tsx +++ b/src/renderer/pages/main/index.tsx @@ -402,7 +402,6 @@ export default function MainPage() { runningState={appState?.runningState ?? RunningState.Idle} credits={appState?.credits ?? 0} subscription={subscriptionOf(appState)} - llmModel={appState?.providedLLMModel ?? ''} creditsPerMinute={appState?.creditsPerMinute} /> )} diff --git a/src/renderer/types/app-state.ts b/src/renderer/types/app-state.ts index 44a29f91..49ebefd0 100644 --- a/src/renderer/types/app-state.ts +++ b/src/renderer/types/app-state.ts @@ -52,7 +52,6 @@ export interface AppState { /** The last pass applied (`monthly` / `quarterly` / `yearly`), for display; null when unknown. */ subscriptionPlan?: string | null; userRole?: UserRole; - providedLLMModel?: string; interviewConfig: InterviewConfigSummary; interviewConfigLoaded: boolean; /** diff --git a/test/app-state.test.mjs b/test/app-state.test.mjs index 4f2f5034..dfa2a983 100644 --- a/test/app-state.test.mjs +++ b/test/app-state.test.mjs @@ -69,6 +69,10 @@ export async function run() { // No-op updates must not even schedule a broadcast, so flushing produces nothing. appStateService.flushRenderer(); check('identical updates do not broadcast', sent.length === baseline); + check( + 'the exact model name is never broadcast', + sent.every(({ payload }) => typeof payload !== 'object' || !('providedLLMModel' in payload)) + ); appStateService.updateState({ isBackendLive: false }); appStateService.flushRenderer();