From 039f9e4b8b70095a8f1f97ff5dc8f0126a75461e Mon Sep 17 00:00:00 2001 From: qixinbo Date: Sun, 29 Mar 2026 15:24:08 +0800 Subject: [PATCH] UI: polish menus --- frontend/src/components/Sidebar.tsx | 198 ++++++++++++++++++---------- frontend/src/i18n/locales/en.json | 2 + frontend/src/i18n/locales/zh.json | 6 +- 3 files changed, 137 insertions(+), 69 deletions(-) diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index d498004..e8d86f1 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx @@ -1,7 +1,7 @@ import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet"; import { Button } from "@/components/ui/button"; import { ScrollArea } from "@/components/ui/scroll-area"; -import { Menu, LayoutDashboard, Plus, MoreVertical, User, Search, Settings, Brain, Trash2, Pencil, Pin, Archive, Database, CheckSquare, Square, ListChecks, RotateCcw, Wand2, Folder, Globe, Bot, Mic, Loader2, CheckCircle2, XCircle } from "lucide-react"; +import { Menu, LayoutDashboard, Plus, MoreVertical, User, Search, Brain, Trash2, Pencil, Pin, Archive, Database, CheckSquare, Square, ListChecks, RotateCcw, Wand2, Folder, Globe, Bot, Loader2, CheckCircle2, XCircle, ChevronRight } from "lucide-react"; import { useState, useRef, useEffect } from "react"; import { Link, useNavigate, useLocation } from "react-router-dom"; import { useTranslation } from "react-i18next"; @@ -377,6 +377,8 @@ function SidebarBody() { const [showUserMenu, setShowUserMenu] = useState(false); const menuRef = useRef(null); const [voiceSettingsOpen, setVoiceSettingsOpen] = useState(false); + const [showKnowledgeSubmenu, setShowKnowledgeSubmenu] = useState(false); + const [showMoreSubmenu, setShowMoreSubmenu] = useState(false); const [whisperUrlDraft, setWhisperUrlDraft] = useState(""); const [isTestingVoice, setIsTestingVoice] = useState(false); const [voiceTestStatus, setVoiceTestStatus] = useState<"success" | "error" | null>(null); @@ -855,7 +857,13 @@ function SidebarBody() {
+ {user?.is_admin && ( + + )} + - + + {user?.is_admin && ( + + )} +
+ )} + + +
setShowMoreSubmenu(true)} + onMouseLeave={() => setShowMoreSubmenu(false)} > - - {t('personalSettings')} - + - - - {user?.is_admin && ( - <> - - - - - - - )} +
+ + {user?.is_admin && ( + + )} + +
+ )} +
diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index e96340b..92b2464 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -365,6 +365,8 @@ "noSubagents": "No subagents configured", "confirmDeleteSubagent": "Are you sure you want to delete this subagent?", "selectProjectToManageSubagents": "Please select a project to manage subagents", + "knowledgeBaseGroup": "Knowledge Base", + "moreGroup": "More", "knowledgeBases": "Knowledge Bases", "voiceSettings": "Voice Input Settings", "embeddingModels": "Embedding Models" diff --git a/frontend/src/i18n/locales/zh.json b/frontend/src/i18n/locales/zh.json index 48d4e27..a096fce 100644 --- a/frontend/src/i18n/locales/zh.json +++ b/frontend/src/i18n/locales/zh.json @@ -354,8 +354,8 @@ "noMcpServers": "暂无 MCP 服务器", "confirmDeleteMcpServer": "确定要删除这个 MCP 服务器吗?", "saveMcpServer": "保存 MCP 服务器", - "subagents": "子智能体", - "subagentManagement": "子智能体管理", + "subagents": "智能体编排", + "subagentManagement": "智能体编排", "manageSubagentsDesc": "管理该项目的子智能体", "addSubagent": "添加子智能体", "editSubagent": "编辑子智能体", @@ -365,6 +365,8 @@ "noSubagents": "暂无配置的子智能体", "confirmDeleteSubagent": "确定要删除这个子智能体吗?", "selectProjectToManageSubagents": "请先选择一个项目以管理其子智能体", + "knowledgeBaseGroup": "知识库", + "moreGroup": "更多", "knowledgeBases": "知识库管理", "voiceSettings": "语音输入配置", "embeddingModels": "Embedding 模型"