Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(settings): remove redundant model subscription badges

Chris2ec80960cdfa
diff --git a/apps/desktop/src/renderer/components/new-chat/UnifiedModelPanel.tsx b/apps/desktop/src/renderer/components/new-chat/UnifiedModelPanel.tsx
index 66b3fc87a8..b5ce00ce3a 100644
--- a/apps/desktop/src/renderer/components/new-chat/UnifiedModelPanel.tsx
+++ b/apps/desktop/src/renderer/components/new-chat/UnifiedModelPanel.tsx
@@ -923,7 +923,7 @@ export function UnifiedModelPanel({
const hasRows = rows.length > 0;
/**
- * 行内价格 / 订阅签的派生(设计稿 v4 定稿 F 样式):付费行显示 $ 档串,折扣行亮段按
+ * 行内价格的派生(设计稿 v4 定稿 F 样式):付费行显示 $ 档串,折扣行亮段按
* 折后价比例填充并尾随 ↓X%;限免显示淡染小徽标;无报价不渲染节点。
* 价格按**该行生效引擎的 wire id**查(同一逻辑模型换引擎可能换一条报价)。
*
@@ -934,45 +934,37 @@ export function UnifiedModelPanel({
(
entry: UnifiedModelEntry,
config: UnifiedRowConfig,
- ): {
- priceDisplay: NonNullable<Parameters<typeof UnifiedModelRow>[0]['priceDisplay']> | null;
- subscriptionRow: boolean;
- } => {
+ ): NonNullable<Parameters<typeof UnifiedModelRow>[0]['priceDisplay']> | null => {
const price = priceOf(entry.providerId, config.wireModelId ?? entry.modelId, config.agent);
- // 订阅接入且拿不到按量报价的行:画「订阅」小签,不画 $ 档串(那类模型走套餐额度,
- // 画钱会被读成按量计费)。判定用 provider.access.kind + 报价来源
- // (subscription-reference = 只是价值估算,不是账单价)。
+ // 接入方式由来源区域说明,行内不重复标注。订阅价值估算不作为按量报价展示。
const rowProvider = providers.find((item) => item.id === entry.providerId);
const subscriptionRow =
rowProvider?.access?.kind === 'subscription' &&
(price === null ||
price.kind !== 'priced' ||
price.current.source === 'subscription-reference');
- if (subscriptionRow) return { priceDisplay: null, subscriptionRow: true };
- if (price?.kind === 'free') return { priceDisplay: { kind: 'free' }, subscriptionRow: false };
- if (price?.kind !== 'priced') return { priceDisplay: null, subscriptionRow: false };
+ if (subscriptionRow) return null;
+ if (price?.kind === 'free') return { kind: 'free' };
+ if (price?.kind !== 'priced') return null;
// 符号个数按**标准价**判(original;折扣不改变模型的价格档),点亮几格按折扣比例
// 取整;颜色只由点亮格数决定(见 UnifiedModelRow priceDisplay 头注)。
const basis = price.original ?? price.current;
const discountPct = price.discount !== undefined ? Math.round(price.discount * 100) : 0;
return {
- subscriptionRow: false,
- priceDisplay: {
- kind: 'tier',
- tier: priceTierOf(basis.outputPerMtok, basis.currency),
- // 档串符号跟**报价币种**走(设计稿:中文报价是 ¥¥¥)。
- symbol: basis.currency === 'CNY' ? '¥' : '$',
- ...(discountPct > 0 && discountPct < 100
- ? {
- discountPct,
- paidPct: 100 - discountPct,
- title: t(
- 'newChat.modelSelector.pricing.discount',
- modelPriceDiscountLabelValues(price.discount ?? 0),
- ),
- }
- : {}),
- },
+ kind: 'tier',
+ tier: priceTierOf(basis.outputPerMtok, basis.currency),
+ // 档串符号跟**报价币种**走(设计稿:中文报价是 ¥¥¥)。
+ symbol: basis.currency === 'CNY' ? '¥' : '$',
+ ...(discountPct > 0 && discountPct < 100
+ ? {
+ discountPct,
+ paidPct: 100 - discountPct,
+ title: t(
+ 'newChat.modelSelector.pricing.discount',
+ modelPriceDiscountLabelValues(price.discount ?? 0),
+ ),
+ }
+ : {}),
};
},
[priceOf, providers, t],
@@ -1233,7 +1225,7 @@ export function UnifiedModelPanel({
{section.rows.map((row) => {
const config = configOf(row.entry, row.favorite);
const key = anchorKey(row.anchor);
- const { priceDisplay, subscriptionRow } = priceDisplayOf(row.entry, config);
+ const priceDisplay = priceDisplayOf(row.entry, config);
return (
<UnifiedModelRow
key={key}
@@ -1245,9 +1237,6 @@ export function UnifiedModelPanel({
isFavoriteRow={!!row.favorite}
justFavorited={justFavorited === key}
{...(priceDisplay ? { priceDisplay } : {})}
- {...(subscriptionRow
- ? { subscriptionLabel: t('settings.providers.models.subscription') }
- : {})}
interactionDisabled={interactionDisabled}
paymentRequired={row.entry.availability === 'requires_payment'}
{...(paymentRequiredLabel ? { paymentRequiredLabel } : {})}
@@ -1319,7 +1308,7 @@ export function UnifiedModelPanel({
</div>
{section.rows.map((row) => {
const config = configOf(row.entry, row.favorite, RAIL_ALL);
- const { priceDisplay, subscriptionRow } = priceDisplayOf(row.entry, config);
+ const priceDisplay = priceDisplayOf(row.entry, config);
return (
<UnifiedModelRow
key={anchorKey(row.anchor)}
@@ -1331,9 +1320,6 @@ export function UnifiedModelPanel({
isFavoriteRow={!!row.favorite}
justFavorited={false}
{...(priceDisplay ? { priceDisplay } : {})}
- {...(subscriptionRow
- ? { subscriptionLabel: t('settings.providers.models.subscription') }
- : {})}
interactionDisabled
paymentRequired={row.entry.availability === 'requires_payment'}
{...(paymentRequiredLabel ? { paymentRequiredLabel } : {})}
diff --git a/apps/desktop/src/renderer/components/new-chat/UnifiedModelRow.tsx b/apps/desktop/src/renderer/components/new-chat/UnifiedModelRow.tsx
index 2201f3f7f6..255fb3fc62 100644
--- a/apps/desktop/src/renderer/components/new-chat/UnifiedModelRow.tsx
+++ b/apps/desktop/src/renderer/components/new-chat/UnifiedModelRow.tsx
@@ -12,7 +12,6 @@ import type { AgentKind } from '@/hooks/useAgentCapabilities';
import { cn } from '@/lib/utils';
import type { Effort } from '@/lib/userPreferences.types';
-
import { ClaudeMark } from '@/components/icons/ClaudeMark';
import { CodexMark } from '@/components/icons/CodexMark';
import { PiMark } from '@/components/icons/PiMark';
@@ -27,7 +26,6 @@ import {
litWholeMarks,
PriceFreeBadge,
PriceTierMarks,
- SubscriptionBadge,
type UnifiedRowPriceDisplay,
} from './priceTierMarks';
import {
@@ -75,7 +73,6 @@ export function UnifiedModelRow({
onStar,
onRevealForKeyboard,
priceDisplay,
- subscriptionLabel,
layout = 'classic',
channelLabel,
onEngineCycle,
@@ -105,11 +102,6 @@ export function UnifiedModelRow({
onRevealForKeyboard: (anchor: UnifiedAnchor, element: HTMLElement) => void;
/** 行内价格展示;不传 = 无报价。字段语义见 `UnifiedRowPriceDisplay`。 */
priceDisplay?: UnifiedRowPriceDisplay;
- /**
- * 已本地化的「订阅」小签(设计稿 `.badge.sub`)。仅**订阅接入且无按量报价**的行传 ——
- * 那类模型走套餐额度,行内画 $ 档串会误导成按量计费。
- */
- subscriptionLabel?: string;
/**
* 列表样式(modelPickerLayout 试用开关):
* - 'classic'(默认):现行双行布局,行首来源图标、引擎在行尾三元组;
@@ -302,9 +294,6 @@ export function UnifiedModelRow({
>
{entry.displayName}
</span>
- {subscriptionLabel && (
- <SubscriptionBadge label={subscriptionLabel} />
- )}
{priceDisplay?.kind === 'free' && (
<PriceFreeBadge label={t('newChat.modelSelector.pricing.free')} />
)}
@@ -386,9 +375,6 @@ export function UnifiedModelRow({
>
{entry.displayName}
</span>
- {subscriptionLabel && (
- <SubscriptionBadge label={subscriptionLabel} />
- )}
{priceDisplay?.kind === 'free' && (
<PriceFreeBadge label={t('newChat.modelSelector.pricing.free')} />
)}
diff --git a/apps/desktop/src/renderer/components/new-chat/priceTierMarks.tsx b/apps/desktop/src/renderer/components/new-chat/priceTierMarks.tsx
index 1ee52cb651..38d263945c 100644
--- a/apps/desktop/src/renderer/components/new-chat/priceTierMarks.tsx
+++ b/apps/desktop/src/renderer/components/new-chat/priceTierMarks.tsx
@@ -148,23 +148,3 @@ export function PriceFreeBadge({ label }: { label: string }) {
</span>
);
}
-
-/**
- * 「订阅」小签 —— 订阅接入(ChatGPT / Claude 包月等)且拿不到按量报价的行画它,**不留空白**。
- *
- * 留空白会被读成「价格没查到 = 坏了」(2026-09-04 实测:OpenAI 面板里三个还没登记参考价的
- * 模型显示成空白,第一反应就是 bug)。而这类模型本来就走套餐额度,画 $ 档串反而更糟 ——
- * 会被读成按量计费。所以给它一个明确的、灰阶的事实标签。
- *
- * 底色走 chip 中性色而不是功能色:它陈述的是计费方式,不是好消息也不是警告。
- */
-export function SubscriptionBadge({ label }: { label: string }) {
- return (
- <span
- data-subscription-badge
- className="inline-flex shrink-0 items-center rounded-full bg-[var(--surface-chip)] px-2 py-[1px] text-10 font-normal leading-[1.45] text-[var(--text-secondary)]"
- >
- {label}
- </span>
- );
-}
diff --git a/apps/desktop/src/renderer/components/settings/UnifiedModelList.tsx b/apps/desktop/src/renderer/components/settings/UnifiedModelList.tsx
index ea7b361ad3..ccab7ad9a8 100644
--- a/apps/desktop/src/renderer/components/settings/UnifiedModelList.tsx
+++ b/apps/desktop/src/renderer/components/settings/UnifiedModelList.tsx
@@ -40,7 +40,6 @@ import {
litWholeMarks,
PriceFreeBadge,
PriceTierMarks,
- SubscriptionBadge,
type UnifiedRowPriceDisplay,
} from '@/components/new-chat/priceTierMarks';
import { priceTierOf } from '@/components/new-chat/unifiedModelSelection';
@@ -377,42 +376,36 @@ export function UnifiedModelList({
* 行不画档串(那类模型走套餐额度,画钱会被读成按量计费)。
*/
const rowPriceDisplay = useCallback(
- (row: UnionModelRow): { display: UnifiedRowPriceDisplay | null; subscription: boolean } => {
- const none = { display: null, subscription: false };
+ (row: UnionModelRow): UnifiedRowPriceDisplay | null => {
const agent = row.avail[0];
const model = agent ? row.byAgent[agent] : undefined;
- if (!agent || !model) return none;
+ if (!agent || !model) return null;
const price = pricePresentationOf(agent, model);
- // 订阅接入且拿不到按量报价 ⇒ 画「订阅」签,**不能留空白**:空白会被读成
- // 「价格查不到 = 坏了」(2026-09-04 实测:OpenAI 面板里 GPT-6 Astra 等还没登记
- // 参考价的模型显示成空白,第一眼就被当成 bug)。口径与模型选择器一致。
+ // 接入方式由供应商区域说明;缺少报价时不补订阅标签。
const subscriptionRow =
provider.access?.kind === 'subscription' &&
(price === null ||
price.kind !== 'priced' ||
price.current.source === 'subscription-reference');
- if (subscriptionRow) return { display: null, subscription: true };
- if (price?.kind === 'free') return { display: { kind: 'free' }, subscription: false };
- if (price?.kind !== 'priced') return none;
+ if (subscriptionRow) return null;
+ if (price?.kind === 'free') return { kind: 'free' };
+ if (price?.kind !== 'priced') return null;
const basis = price.original ?? price.current;
const discountPct = price.discount !== undefined ? Math.round(price.discount * 100) : 0;
return {
- subscription: false,
- display: {
- kind: 'tier',
- tier: priceTierOf(basis.outputPerMtok, basis.currency),
- symbol: basis.currency === 'CNY' ? '¥' : '$',
- ...(discountPct > 0 && discountPct < 100
- ? {
- discountPct,
- paidPct: 100 - discountPct,
- title: t(
- 'newChat.modelSelector.pricing.discount',
- modelPriceDiscountLabelValues(price.discount ?? 0),
- ),
- }
- : {}),
- },
+ kind: 'tier',
+ tier: priceTierOf(basis.outputPerMtok, basis.currency),
+ symbol: basis.currency === 'CNY' ? '¥' : '$',
+ ...(discountPct > 0 && discountPct < 100
+ ? {
+ discountPct,
+ paidPct: 100 - discountPct,
+ title: t(
+ 'newChat.modelSelector.pricing.discount',
+ modelPriceDiscountLabelValues(price.discount ?? 0),
+ ),
+ }
+ : {}),
};
},
[pricePresentationOf, provider.access?.kind, t],
@@ -738,10 +731,7 @@ export function UnifiedModelList({
是用来在读到某个模型名时顺手知道它贵不贵。拿不到报价就整个
不渲染 —— 不画假的「$」也不画「—」。 */}
{(() => {
- const { display, subscription } = rowPriceDisplay(row);
- if (subscription) {
- return <SubscriptionBadge label={t('settings.providers.models.subscription')} />;
- }
+ const display = rowPriceDisplay(row);
if (!display) return null;
if (display.kind === 'free') {
return <PriceFreeBadge label={t('newChat.modelSelector.pricing.free')} />;