From 9776b4e46cf8d2cfd08f296e9a404333b33f56bb Mon Sep 17 00:00:00 2001 From: Phantom Date: Mon, 27 Oct 2025 20:35:12 +0800 Subject: [PATCH] fix(sidebar): replace 'agents' with 'store' in sidebar (#10989) refactor(sidebar): replace 'agents' with 'store' in sidebar icons and labels Update sidebar icon mapping and translation keys to use 'store' instead of 'agents' for consistency with the application's terminology. The change includes both the label definitions and the icon component mapping. --- src/renderer/src/i18n/label.ts | 14 ++++++++++- .../DisplaySettings/SidebarIconsManager.tsx | 25 ++++++++++--------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/renderer/src/i18n/label.ts b/src/renderer/src/i18n/label.ts index e679200804..64125c2a8d 100644 --- a/src/renderer/src/i18n/label.ts +++ b/src/renderer/src/i18n/label.ts @@ -165,9 +165,21 @@ export const getThemeModeLabel = (key: string): string => { return getLabel(themeModeKeyMap, key) } +// const sidebarIconKeyMap = { +// assistants: t('assistants.title'), +// store: t('assistants.presets.title'), +// paintings: t('paintings.title'), +// translate: t('translate.title'), +// minapp: t('minapp.title'), +// knowledge: t('knowledge.title'), +// files: t('files.title'), +// code_tools: t('code.title'), +// notes: t('notes.title') +// } as const + const sidebarIconKeyMap = { assistants: 'assistants.title', - agents: 'agents.title', + store: 'assistants.presets.title', paintings: 'paintings.title', translate: 'translate.title', minapp: 'minapp.title', diff --git a/src/renderer/src/pages/settings/DisplaySettings/SidebarIconsManager.tsx b/src/renderer/src/pages/settings/DisplaySettings/SidebarIconsManager.tsx index e79af44eb6..62887d8a7f 100644 --- a/src/renderer/src/pages/settings/DisplaySettings/SidebarIconsManager.tsx +++ b/src/renderer/src/pages/settings/DisplaySettings/SidebarIconsManager.tsx @@ -23,7 +23,7 @@ import { Palette, Sparkle } from 'lucide-react' -import { FC, useCallback, useMemo } from 'react' +import { FC, ReactNode, useCallback, useMemo } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' @@ -118,17 +118,18 @@ const SidebarIconsManager: FC = ({ // 使用useMemo缓存图标映射 const iconMap = useMemo( - () => ({ - assistants: , - agents: , - paintings: , - translate: , - minapp: , - knowledge: , - files: , - notes: , - code_tools: - }), + () => + ({ + assistants: , + store: , + paintings: , + translate: , + minapp: , + knowledge: , + files: , + notes: , + code_tools: + }) satisfies Record, [] )