feat: v2 版本 #206

Merged
huanghaosheng merged 201 commits from v2 into main 2026-06-22 16:01:28 +08:00
3 changed files with 7 additions and 7 deletions
Showing only changes of commit 964c5c967e - Show all commits

View File

@@ -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

View File

@@ -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}

View File

@@ -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 (
<>
<div className="sidebar-backdrop" onClick={onToggle} />
<div className="sidebar-backdrop" onClick={onClose} />
<div className="sidebar">
{/* 头部:新建 + 收起 */}
<div className="sidebar__header">
<button className="sidebar__new-btn" onClick={onNewSession}>
{t("sidebar.new")}
</button>
<button className="sidebar__toggle" onClick={onToggle} title={t("sidebar.collapse")}>
<button className="sidebar__toggle" onClick={onClose} title={t("sidebar.collapse")}>
</button>
</div>