From 2ab4075fcd04aaca1170e49ac237ec60e69f5e08 Mon Sep 17 00:00:00 2001 From: Xin Wang Date: Wed, 11 Feb 2026 14:46:06 +0800 Subject: [PATCH] Update overview ui --- web/pages/Dashboard.tsx | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/web/pages/Dashboard.tsx b/web/pages/Dashboard.tsx index 5ce4034..a6351ad 100644 --- a/web/pages/Dashboard.tsx +++ b/web/pages/Dashboard.tsx @@ -12,7 +12,9 @@ export const DashboardPage: React.FC = () => { const [timeRange, setTimeRange] = useState<'week' | 'month' | 'year'>('week'); const [selectedAssistantId, setSelectedAssistantId] = useState('all'); const [assistants, setAssistants] = useState([]); + const [topRailHeight, setTopRailHeight] = useState(0); + const topRailRef = useRef(null); const workflowRef = useRef(null); const aboutRef = useRef(null); @@ -32,13 +34,35 @@ export const DashboardPage: React.FC = () => { loadAssistants(); }, []); + useEffect(() => { + const updateTopRailHeight = () => { + setTopRailHeight(topRailRef.current?.offsetHeight ?? 0); + }; + + updateTopRailHeight(); + + const observer = new ResizeObserver(() => { + updateTopRailHeight(); + }); + + if (topRailRef.current) { + observer.observe(topRailRef.current); + } + + window.addEventListener('resize', updateTopRailHeight); + return () => { + observer.disconnect(); + window.removeEventListener('resize', updateTopRailHeight); + }; + }, []); + const scrollToNext = (ref: React.RefObject) => { ref.current?.scrollIntoView({ behavior: 'smooth' }); }; return (
-
+
{/* SECTION 1: METRICS & CHARTS */} -
+
{/* 2. Main Dashboard Container */}
@@ -188,7 +215,7 @@ export const DashboardPage: React.FC = () => { {/* Scroll Indicator */}
scrollToNext(workflowRef)} - className="absolute bottom-4 left-1/2 -translate-x-1/2 flex flex-col items-center gap-2 cursor-pointer group animate-bounce-slow opacity-35 hover:opacity-100 transition-all duration-500 hover:scale-110" + className="mt-3 mb-1 self-center flex flex-col items-center gap-2 cursor-pointer group animate-bounce-slow opacity-35 hover:opacity-100 transition-all duration-500 hover:scale-110" > 核心流程