22 * Fix Tab Component
33 *
44 * Displays the layer analyzer and code fix UI.
5- * Layout: Graph on top (toggleable), service list and candidates below.
5+ * Responsive layout:
6+ * - Wide (>120 cols): Graph on left, services/candidates stacked on right
7+ * - Narrow (<=120 cols): Graph on top, services/candidates side-by-side below
68 * Note: Status bar is handled by the parent index.tsx component.
79 */
810
911import { Show , createMemo } from "solid-js" ;
12+ import { useTerminalDimensions } from "@opentui/solid" ;
1013import { theme } from "./theme" ;
1114import { useStore } from "./store" ;
1215import { AnalysisStatusView } from "./AnalysisStatusView" ;
@@ -18,12 +21,16 @@ import { DependencyGraphPanel } from "./DependencyGraphView";
1821/**
1922 * Main Fix Tab component
2023 *
21- * Layout when results available:
22- * - Top : Graph view (toggleable with 'g' )
23- * - Bottom: Services list (left) | Layer candidates (right)
24+ * Responsive layout when results available:
25+ * - Wide (>120 cols) : Graph on left (60%), services/candidates stacked on right (40% )
26+ * - Narrow (<=120 cols): Graph on top (60% height), services/candidates side-by-side below
2427 */
2528export function FixTab ( ) {
2629 const { store } = useStore ( ) ;
30+ const dimensions = useTerminalDimensions ( ) ;
31+
32+ // Responsive breakpoint - matches OpenCode's pattern
33+ const isWide = createMemo ( ( ) => dimensions ( ) . width > 120 ) ;
2734
2835 const showGraph = createMemo ( ( ) => store . ui . showDependencyGraph ) ;
2936 const hasPreviousResults = createMemo (
@@ -63,7 +70,7 @@ export function FixTab() {
6370 { /* Results view: graph + service panels */ }
6471 < Show when = { showResultsView ( ) } >
6572 < box flexGrow = { 1 } flexDirection = "column" width = "100%" >
66- { /* Re-analyzing indicator - shown above graph when re-analyzing */ }
73+ { /* Re-analyzing indicator - shown at top when re-analyzing */ }
6774 < Show when = { isReAnalyzing ( ) } >
6875 < box
6976 flexDirection = "row"
@@ -82,31 +89,74 @@ export function FixTab() {
8289 </ box >
8390 </ Show >
8491
85- { /* Graph view (toggleable) */ }
86- < Show when = { showGraph ( ) } >
92+ { /* Wide layout: horizontal split (graph left, panels right) */ }
93+ < Show when = { isWide ( ) } >
94+ < box flexDirection = "row" flexGrow = { 1 } width = "100%" >
95+ { /* Graph on the left - 60% width */ }
96+ < Show when = { showGraph ( ) } >
97+ < box
98+ flexDirection = "column"
99+ width = "60%"
100+ height = "100%"
101+ border = { [ "right" ] }
102+ borderColor = { theme . bgSelected }
103+ >
104+ < DependencyGraphPanel />
105+ </ box >
106+ </ Show >
107+
108+ { /* Services and candidates stacked on the right */ }
109+ < box
110+ flexDirection = "column"
111+ flexGrow = { 1 }
112+ height = "100%"
113+ paddingLeft = { 2 }
114+ paddingRight = { 2 }
115+ paddingTop = { 1 }
116+ >
117+ < box
118+ flexDirection = "column"
119+ height = "50%"
120+ border = { [ "bottom" ] }
121+ borderColor = { theme . border }
122+ >
123+ < ServicesListPanel />
124+ </ box >
125+ < box flexDirection = "column" flexGrow = { 1 } paddingTop = { 1 } >
126+ < LayerCandidatesPanel showLeftBorder = { false } />
127+ </ box >
128+ </ box >
129+ </ box >
130+ </ Show >
131+
132+ { /* Narrow layout: vertical split (graph top, panels bottom) */ }
133+ < Show when = { ! isWide ( ) } >
134+ { /* Graph view (toggleable) */ }
135+ < Show when = { showGraph ( ) } >
136+ < box
137+ flexDirection = "column"
138+ height = "60%"
139+ width = "100%"
140+ border = { [ "bottom" ] }
141+ borderColor = { theme . bgSelected }
142+ >
143+ < DependencyGraphPanel />
144+ </ box >
145+ </ Show >
146+
147+ { /* Service list and candidates side-by-side */ }
87148 < box
88- flexDirection = "column "
89- height = "60%"
149+ flexDirection = "row "
150+ flexGrow = { 1 }
90151 width = "100%"
91- border = { [ "bottom" ] }
92- borderColor = { theme . bgSelected }
152+ paddingLeft = { 2 }
153+ paddingRight = { 2 }
154+ paddingTop = { 1 }
93155 >
94- < DependencyGraphPanel />
156+ < ServicesListPanel />
157+ < LayerCandidatesPanel />
95158 </ box >
96159 </ Show >
97-
98- { /* Service list and candidates - always visible when results available */ }
99- < box
100- flexDirection = "row"
101- flexGrow = { 1 }
102- width = "100%"
103- paddingLeft = { 2 }
104- paddingRight = { 2 }
105- paddingTop = { 1 }
106- >
107- < ServicesListPanel />
108- < LayerCandidatesPanel />
109- </ box >
110160 </ box >
111161 </ Show >
112162 </ box >
0 commit comments