@@ -19,7 +19,6 @@ type CenterPanelProps =
1919 MainPanelsProps ,
2020 | "actionPrompt"
2121 | "authSnapshot"
22- | "compact"
2322 | "createView"
2423 | "controllerCwd"
2524 | "projectsRoot"
@@ -41,6 +40,7 @@ type CenterPanelProps =
4140 | "projectAuthSnapshot"
4241 | "selectedProjectSummary"
4342 | "terminalSession"
43+ | "viewportLayout"
4444 >
4545 & {
4646 readonly showProjectPanel : boolean
@@ -55,7 +55,6 @@ type CenterPanelContentProps = Pick<
5555 CenterPanelProps ,
5656 | "actionPrompt"
5757 | "authSnapshot"
58- | "compact"
5958 | "controllerCwd"
6059 | "createView"
6160 | "currentMenu"
@@ -73,6 +72,7 @@ type CenterPanelContentProps = Pick<
7372 | "projectNavigationArmed"
7473 | "projectsRoot"
7574 | "selectedProjectSummary"
75+ | "viewportLayout"
7676>
7777
7878const CenterPanelBody = (
@@ -95,7 +95,6 @@ const CenterPanelContent = (
9595 {
9696 actionPrompt,
9797 authSnapshot,
98- compact,
9998 controllerCwd,
10099 createView,
101100 currentMenu,
@@ -112,13 +111,14 @@ const CenterPanelContent = (
112111 projectAuthSnapshot,
113112 projectNavigationArmed,
114113 projectsRoot,
115- selectedProjectSummary
114+ selectedProjectSummary,
115+ viewportLayout
116116 } : CenterPanelContentProps
117117) : JSX . Element => (
118118 < ContentPanel
119119 actionPrompt = { actionPrompt }
120120 authSnapshot = { authSnapshot }
121- compact = { compact }
121+ compact = { viewportLayout . compact }
122122 controllerCwd = { controllerCwd }
123123 createView = { createView }
124124 currentMenu = { currentMenu }
@@ -143,7 +143,7 @@ const centerPanelWidth = (compact: boolean, showProjectPanel: boolean): string =
143143 if ( compact ) {
144144 return "100%"
145145 }
146- return showProjectPanel ? "42 %" : "69% "
146+ return showProjectPanel ? "48 %" : "auto "
147147}
148148
149149const CenterPanel = ( props : CenterPanelProps ) : JSX . Element => (
@@ -152,27 +152,45 @@ const CenterPanel = (props: CenterPanelProps): JSX.Element => (
152152 borderColor = "#24537d"
153153 borderStyle = "single"
154154 flexDirection = "column"
155+ flexGrow = { 1 }
156+ minHeight = { 0 }
157+ minWidth = { 0 }
158+ overflow = "hidden"
155159 padding = { 1 }
156- width = { centerPanelWidth ( props . compact , props . showProjectPanel ) }
160+ width = { centerPanelWidth ( props . viewportLayout . compact , props . showProjectPanel ) }
157161 >
158- < CenterPanelContent { ...props } />
159- < CenterPanelBody { ...props } />
162+ < Box
163+ flexDirection = "column"
164+ flexShrink = { 0 }
165+ maxHeight = { props . viewportLayout . dense ? "38%" : "46%" }
166+ overflowY = "auto"
167+ >
168+ < CenterPanelContent { ...props } />
169+ </ Box >
170+ < Box flexDirection = "column" flexGrow = { 1 } minHeight = { 0 } overflow = "hidden" >
171+ < CenterPanelBody { ...props } />
172+ </ Box >
160173 </ Box >
161174)
162175
163176const ProjectPanelSlot = (
164177 {
165- compact,
166178 currentMenu,
167179 dashboard,
168180 onSelectProject,
169181 projectNavigationArmed,
170182 selectedProjectId,
171- showProjectPanel
183+ showProjectPanel,
184+ viewportLayout
172185 } :
173186 & Pick <
174187 MainPanelsProps ,
175- "compact" | "currentMenu" | "dashboard" | "onSelectProject" | "projectNavigationArmed" | "selectedProjectId"
188+ | "currentMenu"
189+ | "dashboard"
190+ | "onSelectProject"
191+ | "projectNavigationArmed"
192+ | "selectedProjectId"
193+ | "viewportLayout"
176194 >
177195 & {
178196 readonly showProjectPanel : boolean
@@ -181,7 +199,7 @@ const ProjectPanelSlot = (
181199 showProjectPanel
182200 ? (
183201 < ProjectListPanel
184- compact = { compact }
202+ compact = { viewportLayout . compact }
185203 currentMenu = { currentMenu }
186204 dashboard = { dashboard }
187205 onSelectProject = { onSelectProject }
@@ -205,7 +223,6 @@ const MainCenterPanel = (
205223 < CenterPanel
206224 actionPrompt = { props . actionPrompt }
207225 authSnapshot = { props . authSnapshot }
208- compact = { props . compact }
209226 controllerCwd = { props . controllerCwd }
210227 projectsRoot = { props . projectsRoot }
211228 createView = { props . createView }
@@ -228,15 +245,22 @@ const MainCenterPanel = (
228245 selectedProjectSummary = { selectedProjectSummary }
229246 showProjectPanel = { showProjectPanel }
230247 terminalSession = { props . terminalSession }
248+ viewportLayout = { props . viewportLayout }
231249 />
232250)
233251
234252export const MainPanels = ( { selectedProjectSummary, ...props } : MainPanelsProps ) : JSX . Element => {
235253 const showProject = showsProjectPanel ( props . currentMenu )
236254 return (
237- < Box flexDirection = { props . compact ? "column" : "row" } flexGrow = { 1 } gap = { 1 } >
255+ < Box
256+ flexDirection = { props . viewportLayout . compact ? "column" : "row" }
257+ flexGrow = { 1 }
258+ gap = { 1 }
259+ minHeight = { 0 }
260+ overflow = "hidden"
261+ >
238262 < MenuSidebar
239- compact = { props . compact }
263+ compact = { props . viewportLayout . compact }
240264 currentMenu = { props . currentMenu }
241265 onSelectMenu = { props . onSelectMenu }
242266 projectNavigationArmed = { props . projectNavigationArmed }
@@ -245,13 +269,13 @@ export const MainPanels = ({ selectedProjectSummary, ...props }: MainPanelsProps
245269 />
246270 < MainCenterPanel props = { props } selectedProjectSummary = { selectedProjectSummary } showProjectPanel = { showProject } />
247271 < ProjectPanelSlot
248- compact = { props . compact }
249272 currentMenu = { props . currentMenu }
250273 dashboard = { props . dashboard }
251274 onSelectProject = { props . onSelectProject }
252275 projectNavigationArmed = { props . projectNavigationArmed }
253276 selectedProjectId = { props . selectedProjectId }
254277 showProjectPanel = { showProject }
278+ viewportLayout = { props . viewportLayout }
255279 />
256280 </ Box >
257281 )
0 commit comments