From 4206e2955092487ffb985599541104c253bffb8b Mon Sep 17 00:00:00 2001 From: Xin Wang Date: Fri, 5 Jun 2026 15:13:58 +0800 Subject: [PATCH] Refactor Sidebar component for improved layout and user interaction Updated the Sidebar component to enhance the collapsed state behavior, including a new button for profile navigation with improved styling and animations. Removed the user profile item and adjusted the layout for better responsiveness. Added a ChevronRight icon for visual indication of the profile button and refined the toggle button for collapsing the sidebar. --- src/components/layout/Sidebar.tsx | 105 +++++++++++++++++++++++++----- 1 file changed, 88 insertions(+), 17 deletions(-) diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index 39a404b..dfc31e6 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx @@ -4,11 +4,11 @@ import { Bot, Boxes, ChevronLeft, + ChevronRight, Clock3, FileText, Home, PlayCircle, - User, Video, Workflow, } from "lucide-react"; @@ -31,7 +31,6 @@ const mainItems: Array<{ { key: "history", label: "历史记录", icon: Clock3 }, { key: "test", label: "测试助手", icon: PlayCircle }, { key: "workflow", label: "工作流", icon: Workflow }, - { key: "profile", label: "个人中心", icon: User }, ]; const assistantSubItems: Array<{ @@ -94,16 +93,25 @@ export function Sidebar({ />
-
- - {!collapsed && 创建助手} -
+ {collapsed ? ( + + ) : ( +
+ + 创建助手 +
+ )}
-
+
+ {/* 个人中心 */} + + + {/* 收起 / 展开侧栏 */}