@@ -139,7 +139,8 @@ type chatPage struct {
139139 sessionState * service.SessionState
140140
141141 // State
142- working bool
142+ working bool
143+ leanMode bool
143144
144145 msgCancel context.CancelFunc
145146 streamCancelled bool
@@ -174,6 +175,16 @@ type chatPage struct {
174175func (p * chatPage ) computeSidebarLayout () sidebarLayout {
175176 innerWidth := p .width - appPaddingHorizontal
176177
178+ // Lean mode: no sidebar at all
179+ if p .leanMode {
180+ return sidebarLayout {
181+ mode : sidebarCollapsedNarrow ,
182+ innerWidth : innerWidth ,
183+ chatWidth : innerWidth ,
184+ chatHeight : max (1 , p .height ),
185+ }
186+ }
187+
177188 var mode sidebarLayoutMode
178189 switch {
179190 case p .width >= minWindowWidth && ! p .sidebar .IsCollapsed ():
@@ -300,7 +311,7 @@ func getEditorDisplayNameFromEnv(visual, editorEnv string) string {
300311}
301312
302313// New creates a new chat page
303- func New (a * app.App , sessionState * service.SessionState ) Page {
314+ func New (a * app.App , sessionState * service.SessionState , opts ... PageOption ) Page {
304315 p := & chatPage {
305316 sidebar : sidebar .New (sessionState ),
306317 messages : messages .New (sessionState ),
@@ -309,9 +320,23 @@ func New(a *app.App, sessionState *service.SessionState) Page {
309320 sessionState : sessionState ,
310321 }
311322
323+ for _ , opt := range opts {
324+ opt (p )
325+ }
326+
312327 return p
313328}
314329
330+ // PageOption configures a chat page.
331+ type PageOption func (* chatPage )
332+
333+ // WithLeanMode creates a lean chat page with no sidebar.
334+ func WithLeanMode () PageOption {
335+ return func (p * chatPage ) {
336+ p .leanMode = true
337+ }
338+ }
339+
315340// Init initializes the chat page
316341func (p * chatPage ) Init () tea.Cmd {
317342 var cmds []tea.Cmd
@@ -518,19 +543,26 @@ func (p *chatPage) View() string {
518543 bodyContent = lipgloss .JoinHorizontal (lipgloss .Left , chatView , toggleCol , sidebarView )
519544
520545 case sidebarCollapsed , sidebarCollapsedNarrow :
521- sidebarRendered := p .renderCollapsedSidebar (sl )
522-
523- chatView := styles .ChatStyle .
524- Height (sl .chatHeight ).
525- Width (sl .innerWidth ).
526- Render (messagesView )
527-
528- bodyContent = lipgloss .JoinVertical (lipgloss .Top , sidebarRendered , chatView )
546+ if p .leanMode {
547+ // Lean mode: no sidebar header, no fixed height
548+ bodyContent = styles .ChatStyle .
549+ Width (sl .innerWidth ).
550+ Render (messagesView )
551+ } else {
552+ sidebarRendered := p .renderCollapsedSidebar (sl )
553+ chatView := styles .ChatStyle .
554+ Height (sl .chatHeight ).
555+ Width (sl .innerWidth ).
556+ Render (messagesView )
557+ bodyContent = lipgloss .JoinVertical (lipgloss .Top , sidebarRendered , chatView )
558+ }
529559 }
530560
531- return styles .AppStyle .
532- Height (p .height ).
533- Render (bodyContent )
561+ appStyle := styles .AppStyle
562+ if ! p .leanMode {
563+ appStyle = appStyle .Height (p .height )
564+ }
565+ return appStyle .Render (bodyContent )
534566}
535567
536568// renderSidebarHandle renders the sidebar toggle/resize handle.
0 commit comments