@@ -6,6 +6,7 @@ import ChartContainer from './components/ChartContainer';
66import { ComparisonControls } from './components/ComparisonControls' ;
77import { Header } from './components/Header' ;
88import { FileConfigModal } from './components/FileConfigModal' ;
9+ import { PanelLeftClose , PanelLeftOpen } from 'lucide-react' ;
910
1011function App ( ) {
1112 const [ uploadedFiles , setUploadedFiles ] = useState ( [ ] ) ;
@@ -37,6 +38,7 @@ function App() {
3738 const [ , setDragCounter ] = useState ( 0 ) ;
3839 const [ xRange , setXRange ] = useState ( { min : undefined , max : undefined } ) ;
3940 const [ maxStep , setMaxStep ] = useState ( 0 ) ;
41+ const [ sidebarVisible , setSidebarVisible ] = useState ( true ) ;
4042
4143 const handleFilesUploaded = useCallback ( ( files ) => {
4244 const filesWithDefaults = files . map ( file => ( {
@@ -188,7 +190,7 @@ function App() {
188190 < div className = "min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 relative" >
189191 { /* 全页面拖拽覆盖层 */ }
190192 { globalDragOver && (
191- < div
193+ < div
192194 className = "fixed inset-0 bg-blue-600 bg-opacity-95 z-50 flex items-center justify-center backdrop-blur-sm drag-overlay-fade-in"
193195 >
194196 < div
@@ -230,20 +232,31 @@ function App() {
230232 </ div >
231233 ) }
232234
235+ { ! sidebarVisible && (
236+ < button
237+ onClick = { ( ) => setSidebarVisible ( true ) }
238+ className = "fixed top-3 left-3 z-40 p-2 bg-white rounded-full shadow-md text-gray-600 hover:text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500"
239+ aria-label = "显示工具栏"
240+ >
241+ < PanelLeftOpen size = { 20 } aria-hidden = "true" />
242+ </ button >
243+ ) }
244+
233245 < div className = "w-full px-3 py-3" >
234-
235- < main
246+
247+ < main
236248 id = "main-content"
237- className = "grid grid-cols-1 xl:grid-cols-5 gap-3"
249+ className = "grid grid-cols-1 xl:grid-cols-5 gap-3"
238250 role = "main"
239251 >
240- < aside
241- className = "xl:col-span-1 space-y-3"
242- role = "complementary"
243- aria-label = "控制面板"
244- >
245- { /* 标题信息 */ }
246- < div className = "bg-white rounded-lg shadow-md p-3" >
252+ { sidebarVisible && (
253+ < aside
254+ className = "xl:col-span-1 space-y-3"
255+ role = "complementary"
256+ aria-label = "控制面板"
257+ >
258+ { /* 标题信息 */ }
259+ < div className = "bg-white rounded-lg shadow-md p-3" >
247260 < div className = "flex items-center gap-2 mb-2" >
248261 < div className = "p-2 bg-blue-100 rounded-lg" >
249262 < svg className = "w-5 h-5 text-blue-600" fill = "none" viewBox = "0 0 24 24" stroke = "currentColor" >
@@ -253,6 +266,13 @@ function App() {
253266 < h1 className = "text-lg font-bold text-gray-800" >
254267 Log Analyzer
255268 </ h1 >
269+ < button
270+ onClick = { ( ) => setSidebarVisible ( false ) }
271+ className = "ml-auto p-1 text-gray-400 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded"
272+ aria-label = "隐藏工具栏"
273+ >
274+ < PanelLeftClose size = { 16 } aria-hidden = "true" />
275+ </ button >
256276 </ div >
257277 < p className = "text-sm text-gray-600 mb-3" >
258278 📊 分析和可视化大模型训练日志中的损失函数和梯度范数数据
@@ -375,10 +395,11 @@ function App() {
375395 </ div >
376396 </ div >
377397 </ div >
378- </ section >
379- </ aside >
398+ </ section >
399+ </ aside >
400+ ) }
380401
381- < section
402+ < section
382403 className = "xl:col-span-4"
383404 role = "region"
384405 aria-label = "图表显示区域"
0 commit comments