fix: 修复前端侧边栏弹出异常问题
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user