@@ -52,11 +52,12 @@ const (
5252)
5353
5454const (
55− CompactModeBreakpoint = 120 // Width at which the chat page switches to compact mode
56− EditorHeight = 5 // Height of the editor input area including padding
57− SideBarWidth = 31 // Width of the sidebar
58− SideBarDetailsPadding = 1 // Padding for the sidebar details section
59− HeaderHeight = 1 // Height of the header
55+ CompactModeWidthBreakpoint = 120 // Width at which the chat page switches to compact mode
56+ CompactModeHeightBreakpoint = 30 // Height at which the chat page switches to compact mode
57+ EditorHeight = 5 // Height of the editor input area including padding
58+ SideBarWidth = 31 // Width of the sidebar
59+ SideBarDetailsPadding = 1 // Padding for the sidebar details section
60+ HeaderHeight = 1 // Height of the header
6061
6162 // Layout constants for borders and padding
6263 BorderWidth = 1 // Width of component borders
@@ -178,7 +179,7 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
178179 if p.forceCompact {
179180 p.setCompactMode(true)
180181 cmd = p.updateCompactConfig(true)
181− } else if p.width >= CompactModeBreakpoint {
182+ } else if p.width >= CompactModeWidthBreakpoint && p.height >= CompactModeHeightBreakpoint {
182183 p.setCompactMode(false)
183184 cmd = p.updateCompactConfig(false)
184185 }
@@ -421,20 +422,20 @@ func (p *chatPage) setCompactMode(compact bool) {
421422 }
422423}
423424
424−func (p *chatPage) handleCompactMode(newWidth int) {
425+func (p *chatPage) handleCompactMode(newWidth int, newHeight int) {
425426 if p.forceCompact {
426427 return
427428 }
428− if newWidth < CompactModeBreakpoint && !p.compact {
429+ if (newWidth < CompactModeWidthBreakpoint || newHeight < CompactModeHeightBreakpoint) && !p.compact {
429430 p.setCompactMode(true)
430431 }
431− if newWidth >= CompactModeBreakpoint && p.compact {
432+ if (newWidth >= CompactModeWidthBreakpoint && newHeight >= CompactModeHeightBreakpoint) && p.compact {
432433 p.setCompactMode(false)
433434 }
434435}
435436
436437func (p *chatPage) SetSize(width, height int) tea.Cmd {
437− p.handleCompactMode(width)
438+ p.handleCompactMode(width, height)
438439 p.width = width
439440 p.height = height
440441 var cmds []tea.Cmd