|
3 | 3 |
|
4 | 4 | import { useCallback, useRef, useState } from 'react'; |
5 | 5 | import { TreePanel } from './TreePanel'; |
6 | | -import { FileMap } from './FileMap'; |
| 6 | +import { SwimlaneOverview } from '../swimlane/SwimlaneOverview'; |
7 | 7 | import { DataPreview } from './DataPreview'; |
8 | 8 | import { DetailPanel } from '../detail/DetailPanel'; |
| 9 | +import { SummarySidebar } from '../detail/SummarySidebar'; |
9 | 10 |
|
10 | 11 | const MIN_PANEL_HEIGHT = 120; |
11 | 12 | const DEFAULT_PREVIEW_HEIGHT = 200; |
12 | 13 |
|
| 14 | +export type MainView = 'details' | 'swimlane'; |
| 15 | + |
13 | 16 | /** |
14 | | - * Main explorer area: tree panel (left) | detail + filemap + preview (right). |
| 17 | + * Main explorer area: tree panel (left) | the active main view (details or |
| 18 | + * swimlane, chosen in the top header) over a resizable data preview (right). The |
| 19 | + * tree stays put as column navigation while the header tabs switch the view. |
15 | 20 | * |
16 | 21 | * The preview panel at the bottom is vertically resizable via a drag handle. |
17 | 22 | */ |
18 | | -export function MainArea() { |
| 23 | +export function MainArea({ view }: { view: MainView }) { |
19 | 24 | const [previewHeight, setPreviewHeight] = useState(DEFAULT_PREVIEW_HEIGHT); |
20 | 25 | const dragging = useRef(false); |
21 | 26 | const startY = useRef(0); |
@@ -48,19 +53,29 @@ export function MainArea() { |
48 | 53 |
|
49 | 54 | return ( |
50 | 55 | <div className="flex flex-1 min-h-0 overflow-hidden"> |
51 | | - {/* Left: tree panel — full height, fixed width */} |
52 | | - <div className="w-[260px] flex-shrink-0 h-full overflow-hidden"> |
53 | | - <TreePanel /> |
54 | | - </div> |
| 56 | + {/* Left: tree panel — column navigation paired with the details view. The |
| 57 | + swimlane view hides it so the byte-bars get the full width. */} |
| 58 | + {view === 'details' && ( |
| 59 | + <div className="w-[260px] flex-shrink-0 h-full overflow-hidden"> |
| 60 | + <TreePanel /> |
| 61 | + </div> |
| 62 | + )} |
55 | 63 |
|
56 | | - {/* Right: detail pane, file map, data preview — stacked vertically */} |
| 64 | + {/* Right: active main view over the resizable data preview */} |
57 | 65 | <div ref={containerRef} className="flex-1 flex flex-col min-w-0 h-full overflow-hidden"> |
58 | | - {/* Detail pane — fills available vertical space, scrolls internally */} |
59 | | - <DetailPanel /> |
60 | | - |
61 | | - {/* File map strip */} |
62 | | - <div className="flex-shrink-0"> |
63 | | - <FileMap /> |
| 66 | + {/* Active view — fills available vertical space, scrolls internally. The |
| 67 | + swimlane keeps the summary sidebar alongside it, like the details view. */} |
| 68 | + <div className="flex-1 min-h-0 flex overflow-hidden"> |
| 69 | + {view === 'details' ? ( |
| 70 | + <DetailPanel /> |
| 71 | + ) : ( |
| 72 | + <> |
| 73 | + <div className="flex-1 min-w-0 flex flex-col"> |
| 74 | + <SwimlaneOverview /> |
| 75 | + </div> |
| 76 | + <SummarySidebar /> |
| 77 | + </> |
| 78 | + )} |
64 | 79 | </div> |
65 | 80 |
|
66 | 81 | {/* Resize handle */} |
|
0 commit comments