fix(web): name the preset in General settings, and say 预设 in Chinese
The preference row rendered `option.id` while every other surface — the new-session chip, the session header label, the preset cards — renders the metadata name. So the same roster read `标准模式` on one screen and `standard` on the next, and the id is addressing, not a label. A preset that names itself nothing still falls back to its id, which is then all there is to say about it. The row's Chinese copy also still ended on the English word: the section is `Agent 预设`, so the sentence about a running session keeping its composition says 预设 too.
This commit is contained in:
@@ -52,7 +52,12 @@ export function AgentPresetRow({ load, select, useAgentPreset, t }: AgentPresetR
|
||||
// every session shares the host composition — the row simply does not exist.
|
||||
if (state.status === 'unavailable') return null
|
||||
const busy = state.status === 'loading' || state.status === 'saving'
|
||||
const label = state.currentValue === '' ? t('loading') : state.currentValue
|
||||
// The metadata name is what every other surface shows — the new-session chip,
|
||||
// the session header, the preset cards — so this row shows it too; the id is
|
||||
// the addressing, not the label. A preset that names itself nothing falls
|
||||
// back to its id, which is then all there is to say about it.
|
||||
const chosen = state.options.find(option => option.id === state.currentValue)
|
||||
const label = state.currentValue === '' ? t('loading') : (chosen?.name ?? state.currentValue)
|
||||
const description: string = state.error ?? t('description')
|
||||
|
||||
return (
|
||||
@@ -69,7 +74,9 @@ export function AgentPresetRow({ load, select, useAgentPreset, t }: AgentPresetR
|
||||
// every preset as shipped and vetted.
|
||||
items={state.options.map(option => ({
|
||||
id: option.id,
|
||||
label: option.trust === 'user' ? `${option.id} · ${t('userTrust')}` : option.id,
|
||||
label: option.trust === 'user'
|
||||
? `${option.name ?? option.id} · ${t('userTrust')}`
|
||||
: option.name ?? option.id,
|
||||
}))}
|
||||
selectedId={state.currentValue}
|
||||
onSelect={(id) => {
|
||||
|
||||
@@ -64,7 +64,7 @@ export const en: Record<AgentPresetSettingsKey, string> = {
|
||||
/** Simplified Chinese copy. */
|
||||
export const zh: Record<AgentPresetSettingsKey, string> = {
|
||||
title: 'Agent 预设',
|
||||
description: '对此后新建的会话生效。运行中的会话保持它开始时的 preset。',
|
||||
description: '对此后新建的会话生效。运行中的会话保持它开始时的预设。',
|
||||
loading: '正在加载预设…',
|
||||
error: '无法加载 Agent 预设。',
|
||||
userTrust: '自定义',
|
||||
|
||||
Reference in New Issue
Block a user