fix: 修复空会话返回 null 导致前端崩溃的问题 #193
@@ -217,7 +217,15 @@ body {
|
|||||||
background: rgba(10, 10, 15, 0.45);
|
background: rgba(10, 10, 15, 0.45);
|
||||||
backdrop-filter: blur(3px);
|
backdrop-filter: blur(3px);
|
||||||
-webkit-backdrop-filter: blur(3px);
|
-webkit-backdrop-filter: blur(3px);
|
||||||
animation: fadeIn 0.2s ease;
|
cursor: pointer;
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
transition: opacity 0.3s var(--transition-smooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-backdrop--visible {
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar {
|
.sidebar {
|
||||||
@@ -232,13 +240,18 @@ body {
|
|||||||
background: var(--color-surface);
|
background: var(--color-surface);
|
||||||
border-right: 1px solid var(--color-border);
|
border-right: 1px solid var(--color-border);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
animation: slideInLeft 0.3s var(--transition-smooth);
|
|
||||||
box-shadow: 8px 0 40px rgba(10, 10, 15, 0.4);
|
box-shadow: 8px 0 40px rgba(10, 10, 15, 0.4);
|
||||||
|
transition: transform 0.3s var(--transition-smooth);
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes slideInLeft {
|
.sidebar--collapsed {
|
||||||
from { transform: translateX(-100%); }
|
transform: translateX(-100%);
|
||||||
to { transform: translateX(0); }
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar--open {
|
||||||
|
transform: translateX(0);
|
||||||
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar--collapsed {
|
.sidebar--collapsed {
|
||||||
|
|||||||
@@ -118,8 +118,6 @@ export function SessionSidebar({
|
|||||||
return groups;
|
return groups;
|
||||||
}, [sessions, searchQuery]);
|
}, [sessions, searchQuery]);
|
||||||
|
|
||||||
if (!open) return null;
|
|
||||||
|
|
||||||
const groupLabels: Record<TimeGroup, string> = {
|
const groupLabels: Record<TimeGroup, string> = {
|
||||||
today: t("sidebar.today"),
|
today: t("sidebar.today"),
|
||||||
yesterday: t("sidebar.yesterday"),
|
yesterday: t("sidebar.yesterday"),
|
||||||
@@ -128,8 +126,11 @@ export function SessionSidebar({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="sidebar-backdrop" onClick={onClose} />
|
<div
|
||||||
<div className="sidebar">
|
className={`sidebar-backdrop ${open ? 'sidebar-backdrop--visible' : ''}`}
|
||||||
|
onClick={onClose}
|
||||||
|
/>
|
||||||
|
<div className={`sidebar ${open ? 'sidebar--open' : 'sidebar--collapsed'}`}>
|
||||||
{/* 头部:新建 + 收起 */}
|
{/* 头部:新建 + 收起 */}
|
||||||
<div className="sidebar__header">
|
<div className="sidebar__header">
|
||||||
<button className="sidebar__new-btn" onClick={onNewSession}>
|
<button className="sidebar__new-btn" onClick={onNewSession}>
|
||||||
|
|||||||
Reference in New Issue
Block a user