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 ( <> -
+
{/* 头部:新建 + 收起 */}
-