From e906a911b24d7ef77ed2de614e5b0955082ae9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=89=E9=91=AB=E5=8D=87?= Date: Fri, 19 Jun 2026 15:04:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(agent-sidebar):=20=E3=80=8C=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E4=BD=93=E3=80=8D=E5=8C=BA=E6=94=AF=E6=8C=81=E6=94=B6?= =?UTF-8?q?=E8=B5=B7/=E5=B1=95=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 标题栏改为可折叠头(chevron 切换),收起后仅留标题栏并隐藏来源下拉/搜索/列表, 下方「最近的对话」占满剩余空间;收起状态持久化到 localStorage。 Co-Authored-By: Claude Opus 4.8 --- .../workspace/agents/agent-chat-sidebar.tsx | 254 ++++++++++-------- 1 file changed, 148 insertions(+), 106 deletions(-) diff --git a/frontend-web/src/components/workspace/agents/agent-chat-sidebar.tsx b/frontend-web/src/components/workspace/agents/agent-chat-sidebar.tsx index 6863e4c4..a87be6ba 100644 --- a/frontend-web/src/components/workspace/agents/agent-chat-sidebar.tsx +++ b/frontend-web/src/components/workspace/agents/agent-chat-sidebar.tsx @@ -2,6 +2,7 @@ import { Bot, + ChevronDown, Download, FileJson, FileText, @@ -127,6 +128,18 @@ export function AgentChatSidebar({ activeAgentId }: { activeAgentId?: string }) return () => clearTimeout(timer); }, [searchInput]); + // 「智能体」区可收起(持久化);收起后只留标题栏,下方「最近的对话」占满剩余空间。 + const [agentsCollapsed, setAgentsCollapsed] = useState( + () => + typeof window !== "undefined" && + localStorage.getItem("agent-chat-sidebar:agents-collapsed") === "true", + ); + const toggleAgents = () => + setAgentsCollapsed((v) => { + localStorage.setItem("agent-chat-sidebar:agents-collapsed", String(!v)); + return !v; + }); + // 若所选广场被管理员删除,回退到「我的」,避免指向不存在的广场。 useEffect(() => { if ( @@ -151,119 +164,148 @@ export function AgentChatSidebar({ activeAgentId }: { activeAgentId?: string }) return ( // 配色与 AgentModuleSidebar 一致:浅色白底,深蓝主题半透明深蓝玻璃面板。