From 6bca4e0d47122f5fe66714a7efa581875ab38fac Mon Sep 17 00:00:00 2001 From: hhs <386998068@qq.com> Date: Mon, 22 Jun 2026 11:15:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E5=BC=B9=E5=87=BA=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/go.mod | 2 +- frontend/src/App.tsx | 2 +- frontend/src/components/SessionSidebar/index.tsx | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/go.mod b/backend/go.mod index 68bb84a..65fe5c3 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -12,6 +12,7 @@ require ( github.com/gorilla/websocket v1.5.3 github.com/jackc/pgx/v5 v5.10.0 github.com/joho/godotenv v1.5.1 + github.com/oklog/ulid/v2 v2.1.1 github.com/redis/go-redis/v9 v9.20.1 github.com/spf13/viper v1.21.0 github.com/stretchr/testify v1.11.1 @@ -53,7 +54,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/nikolalohinski/gonja v1.5.3 // indirect - github.com/oklog/ulid/v2 v2.1.1 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index c1cdff1..0fcc6c4 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -316,7 +316,7 @@ function AppContent() { sessions={sessions} activeSessionId={activeSessionId} open={sidebarOpen} - onToggle={() => setSidebarOpen((v) => !v)} + onClose={() => setSidebarOpen(false)} onNewSession={handleNewSession} onSelectSession={handleSelectSession} onDeleteSession={handleDeleteSession} diff --git a/frontend/src/components/SessionSidebar/index.tsx b/frontend/src/components/SessionSidebar/index.tsx index 560b1a9..7d444d7 100644 --- a/frontend/src/components/SessionSidebar/index.tsx +++ b/frontend/src/components/SessionSidebar/index.tsx @@ -12,7 +12,7 @@ interface SessionSidebarProps { sessions: SessionSummary[]; activeSessionId: string | null; open: boolean; - onToggle: () => void; + onClose: () => void; onNewSession: () => void; onSelectSession: (id: string) => void; onDeleteSession: (id: string) => void; @@ -56,7 +56,7 @@ export function SessionSidebar({ sessions, activeSessionId, open, - onToggle, + onClose, onNewSession, onSelectSession, onDeleteSession, @@ -88,7 +88,7 @@ export function SessionSidebar({ const handleSelect = (id: string) => { onSelectSession(id); // 选择后自动收起侧边栏 - onToggle(); + onClose(); }; // 过滤 + 分组 @@ -128,14 +128,14 @@ export function SessionSidebar({ return ( <> -
+
{/* 头部:新建 + 收起 */}
-
-- 2.49.1