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 一致:浅色白底,深蓝主题半透明深蓝玻璃面板。