@@ -64,10 +64,10 @@ type chatPage struct {
66func (p *chatPage) Init() tea.Cmd {
66func (p *chatPage) Init() tea.Cmd {
67− cmd := p.layout.Init()
68 return tea.Batch(
67 return tea.Batch(
69− cmd,
68+ p.layout.Init(),
69+ p.compactSidebar.Init(),
70− p.layout.FocusPanel(layout.BottomPanel), // Focus on the bottom panel (editor)
70+ p.layout.FocusPanel(layout.BottomPanel), // Focus on the bottom panel (editor),
@@ -88,9 +88,7 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
88 h, cmd := p.header.Update(msg)
88 h, cmd := p.header.Update(msg)
89 cmds = append(cmds, cmd)
89 cmds = append(cmds, cmd)
90 p.header = h.(header.Header)
90 p.header = h.(header.Header)
91− if p.compactMode && p.showDetails {
92− cmds = append(cmds, p.compactSidebar.SetSize(msg.Width-4, 0))
91+ cmds = append(cmds, p.compactSidebar.SetSize(msg.Width-4, 0))
94 // the mode is only relevant when there is a session
92 // the mode is only relevant when there is a session
95 if p.session.ID != "" {
93 if p.session.ID != "" {
96 // Only auto-switch to compact mode if not forced
94 // Only auto-switch to compact mode if not forced
@@ -213,13 +211,7 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
213 p.showDetails = !p.showDetails
211 p.showDetails = !p.showDetails
214 p.header.SetDetailsOpen(p.showDetails)
212 p.header.SetDetailsOpen(p.showDetails)
215 if p.showDetails {
213 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(
214+ return p, tea.Batch()
221− p.compactSidebar.SetSize(p.wWidth-4, 0),
225 return p, nil
217 return p, nil
@@ -228,12 +220,12 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
228 u, cmd := p.layout.Update(msg)
220 u, cmd := p.layout.Update(msg)
229 cmds = append(cmds, cmd)
221 cmds = append(cmds, cmd)
230 p.layout = u.(layout.SplitPaneLayout)
222 p.layout = u.(layout.SplitPaneLayout)
231−
223+ h, cmd := p.header.Update(msg)
232− if p.compactMode && p.showDetails {
224+ p.header = h.(header.Header)
225+ cmds = append(cmds, cmd)
233− s, cmd := p.compactSidebar.Update(msg)
226+ s, cmd := p.compactSidebar.Update(msg)
234− p.compactSidebar = s.(layout.Container)
227+ p.compactSidebar = s.(layout.Container)
235− cmds = append(cmds, cmd)
228+ cmds = append(cmds, cmd)
237 return p, tea.Batch(cmds...)
229 return p, tea.Batch(cmds...)
@@ -409,7 +401,8 @@ func NewChatPage(app *app.App) ChatPage {
409 layout.WithFixedBottomHeight(5),
401 layout.WithFixedBottomHeight(5),
410 layout.WithFixedRightWidth(31),
402 layout.WithFixedRightWidth(31),
404+ compactSidebar: sidebarCmp(app, true),
412− keyMap: DefaultKeyMap(),
405+ keyMap: DefaultKeyMap(),
413− header: header.New(app.LSPClients),
406+ header: header.New(app.LSPClients),