@@ -176,23 +176,30 @@ func (gui *Gui) sidePanelChildren(width int, height int) []*boxlayout.Box {
176176 }
177177
178178 // The project panel is compact (Size: 3) when not focused, but expands
179- // when focused to show the list of projects.
180- projectBox := & boxlayout.Box {
181- Window : sideWindowNames [0 ],
182- Size : 3 ,
183- }
184- if currentWindow == sideWindowNames [0 ] {
185- projectBox = & boxlayout.Box {
179+ // when focused to show the list of projects. This only applies when the
180+ // project panel is actually visible (i.e. we are inside a compose project).
181+ if len (sideWindowNames ) > 0 && sideWindowNames [0 ] == "project" {
182+ projectBox := & boxlayout.Box {
186183 Window : sideWindowNames [0 ],
187- Weight : 2 ,
184+ Size : 3 ,
185+ }
186+ if currentWindow == sideWindowNames [0 ] {
187+ projectBox = & boxlayout.Box {
188+ Window : sideWindowNames [0 ],
189+ Weight : 2 ,
190+ }
188191 }
192+
193+ return append ([]* boxlayout.Box {
194+ projectBox ,
195+ }, lo .Map (sideWindowNames [1 :], func (window string , _ int ) * boxlayout.Box {
196+ return accordionBox (& boxlayout.Box {Window : window , Weight : 1 })
197+ })... )
189198 }
190199
191- return append ([]* boxlayout.Box {
192- projectBox ,
193- }, lo .Map (sideWindowNames [1 :], func (window string , _ int ) * boxlayout.Box {
200+ return lo .Map (sideWindowNames , func (window string , _ int ) * boxlayout.Box {
194201 return accordionBox (& boxlayout.Box {Window : window , Weight : 1 })
195- })... )
202+ })
196203 } else {
197204 squashedHeight := 1
198205 if height >= 21 {
0 commit comments