fix(i18n): slash 子菜单选项改用 labelKey 渲染,修复显示空白

4aac18f7 将选项结构改为 labelKey/descriptionKey 后,slash 菜单的
工作模式/权限/执行环境/网络四个子菜单仍读取已不存在的 label/description
字段,导致菜单项标签与描述渲染为空。统一改为 t(labelKey)/t(descriptionKey)。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
JOJO 2026-08-29 12:17:26 +08:00
parent 3a4ea67e26
commit 640274b7c7

View File

@ -1751,12 +1751,12 @@ const permissionSlashMenuItems = computed<SlashMenuItem[]>(() => {
const lockedByPlan = props.currentWorkMode === 'plan';
return options.map((opt) => ({
id: `perm:${opt.value}`,
label: opt.label,
label: t(opt.labelKey),
description: lockedByPlan
? t('input.permissionLockedReadonlyDesc')
: opt.value === current
? t('input.optionWithCurrent', { desc: opt.description || '' })
: opt.description || '',
? t('input.optionWithCurrent', { desc: t(opt.descriptionKey) })
: t(opt.descriptionKey),
disabled: lockedByPlan,
action: () => emit('change-permission-mode', opt.value)
}));
@ -1769,12 +1769,12 @@ const executionSlashMenuItems = computed<SlashMenuItem[]>(() => {
const lockedByPlan = props.currentWorkMode === 'plan';
return options.map((opt) => ({
id: `exec:${opt.value}`,
label: opt.label,
label: t(opt.labelKey),
description: lockedByPlan
? t('input.executionLockedSandboxDesc')
: opt.value === current
? t('input.optionWithCurrent', { desc: opt.description || '' })
: opt.description || '',
? t('input.optionWithCurrent', { desc: t(opt.descriptionKey) })
: t(opt.descriptionKey),
disabled: lockedByPlan,
action: () => emit('change-execution-mode', opt.value)
}));
@ -1817,11 +1817,11 @@ const networkSlashMenuItems = computed<SlashMenuItem[]>(() => {
const current = String(props.currentNetworkPermission || '');
return options.map((opt) => ({
id: `network:${opt.value}`,
label: opt.label,
label: t(opt.labelKey),
description:
opt.value === current
? t('input.optionWithCurrent', { desc: opt.description || '' })
: opt.description || '',
? t('input.optionWithCurrent', { desc: t(opt.descriptionKey) })
: t(opt.descriptionKey),
action: () => emit('change-network-permission', opt.value)
}));
});
@ -1832,11 +1832,11 @@ const workModeSlashMenuItems = computed<SlashMenuItem[]>(() => {
const current = String(props.currentWorkMode || '');
return options.map((opt) => ({
id: `workmode:${opt.value}`,
label: opt.label,
label: t(opt.labelKey),
description:
opt.value === current
? t('input.optionWithCurrent', { desc: opt.description || '' })
: opt.description || '',
? t('input.optionWithCurrent', { desc: t(opt.descriptionKey) })
: t(opt.descriptionKey),
action: () => emit('change-work-mode', opt.value)
}));
});