@@ -64,10 +64,10 @@ type chatPage struct {
6464}
6565
6666func (p *chatPage) Init() tea.Cmd {
67− cmd := p.layout.Init()
6867 return tea.Batch(
69− cmd,
70− p.layout.FocusPanel(layout.BottomPanel), // Focus on the bottom panel (editor)
68+ p.layout.Init(),
69+ p.compactSidebar.Init(),
70+ p.layout.FocusPanel(layout.BottomPanel), // Focus on the bottom panel (editor),
7171 )
7272}
7373
@@ -88,9 +88,7 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
8888 h, cmd := p.header.Update(msg)
8989 cmds = append(cmds, cmd)
9090 p.header = h.(header.Header)
91− if p.compactMode && p.showDetails {
92− cmds = append(cmds, p.compactSidebar.SetSize(msg.Width-4, 0))
93− }
91+ cmds = append(cmds, p.compactSidebar.SetSize(msg.Width-4, 0))
9492 // the mode is only relevant when there is a session
9593 if p.session.ID != "" {
9694 // Only auto-switch to compact mode if not forced
@@ -213,13 +211,7 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
213211 p.showDetails = !p.showDetails
214212 p.header.SetDetailsOpen(p.showDetails)
215213 if p.showDetails {
216− p.compactSidebar = sidebarCmp(p.app, true)
217− c, cmd := p.compactSidebar.Update(chat.SessionSelectedMsg(p.session))
218− p.compactSidebar = c.(layout.Container)
219− return p, tea.Batch(
220− cmd,
221− p.compactSidebar.SetSize(p.wWidth-4, 0),
222− )
214+ return p, tea.Batch()
223215 }
224216
225217 return p, nil
@@ -228,12 +220,12 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
228220 u, cmd := p.layout.Update(msg)
229221 cmds = append(cmds, cmd)
230222 p.layout = u.(layout.SplitPaneLayout)
231−
232− if p.compactMode && p.showDetails {
233− s, cmd := p.compactSidebar.Update(msg)
234− p.compactSidebar = s.(layout.Container)
235− cmds = append(cmds, cmd)
236− }
223+ h, cmd := p.header.Update(msg)
224+ p.header = h.(header.Header)
225+ cmds = append(cmds, cmd)
226+ s, cmd := p.compactSidebar.Update(msg)
227+ p.compactSidebar = s.(layout.Container)
228+ cmds = append(cmds, cmd)
237229 return p, tea.Batch(cmds...)
238230}
239231
@@ -409,7 +401,8 @@ func NewChatPage(app *app.App) ChatPage {
409401 layout.WithFixedBottomHeight(5),
410402 layout.WithFixedRightWidth(31),
411403 ),
412− keyMap: DefaultKeyMap(),
413− header: header.New(app.LSPClients),
404+ compactSidebar: sidebarCmp(app, true),
405+ keyMap: DefaultKeyMap(),
406+ header: header.New(app.LSPClients),
414407 }
415408}