@@ -52,11 +52,12 @@ const (
55− CompactModeBreakpoint = 120 // Width at which the chat page switches to compact mode
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
56− EditorHeight = 5 // Height of the editor input area including padding
57+ EditorHeight = 5 // Height of the editor input area including padding
57− SideBarWidth = 31 // Width of the sidebar
58+ SideBarWidth = 31 // Width of the sidebar
58− SideBarDetailsPadding = 1 // Padding for the sidebar details section
59+ SideBarDetailsPadding = 1 // Padding for the sidebar details section
59− HeaderHeight = 1 // Height of the header
60+ HeaderHeight = 1 // Height of the header
61 // Layout constants for borders and padding
62 // Layout constants for borders and padding
62 BorderWidth = 1 // Width of component borders
63 BorderWidth = 1 // Width of component borders
@@ -178,7 +179,7 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
178 if p.forceCompact {
179 if p.forceCompact {
179 p.setCompactMode(true)
180 p.setCompactMode(true)
180 cmd = p.updateCompactConfig(true)
181 cmd = p.updateCompactConfig(true)
181− } else if p.width >= CompactModeBreakpoint {
182+ } else if p.width >= CompactModeWidthBreakpoint && p.height >= CompactModeHeightBreakpoint {
182 p.setCompactMode(false)
183 p.setCompactMode(false)
183 cmd = p.updateCompactConfig(false)
184 cmd = p.updateCompactConfig(false)
@@ -421,20 +422,20 @@ func (p *chatPage) setCompactMode(compact bool) {
424−func (p *chatPage) handleCompactMode(newWidth int) {
425+func (p *chatPage) handleCompactMode(newWidth int, newHeight int) {
425 if p.forceCompact {
426 if p.forceCompact {
428− if newWidth < CompactModeBreakpoint && !p.compact {
429+ if (newWidth < CompactModeWidthBreakpoint || newHeight < CompactModeHeightBreakpoint) && !p.compact {
429 p.setCompactMode(true)
430 p.setCompactMode(true)
431− if newWidth >= CompactModeBreakpoint && p.compact {
432+ if (newWidth >= CompactModeWidthBreakpoint && newHeight >= CompactModeHeightBreakpoint) && p.compact {
432 p.setCompactMode(false)
433 p.setCompactMode(false)
436func (p *chatPage) SetSize(width, height int) tea.Cmd {
437func (p *chatPage) SetSize(width, height int) tea.Cmd {
437− p.handleCompactMode(width)
438+ p.handleCompactMode(width, height)
438 p.width = width
439 p.width = width
439 p.height = height
440 p.height = height
440 var cmds []tea.Cmd
441 var cmds []tea.Cmd