@@ -21,6 +21,7 @@ func renderTooSmall(w, h int) string {
2121 w , h , minWidth , minHeight ,
2222 )
2323 return lipgloss .NewStyle ().
24+ Background (colorBg ).
2425 Foreground (tokenFgTooSmall ).
2526 Padding (1 , 2 ).
2627 Render (msg )
@@ -178,7 +179,10 @@ func renderSessionTableHeader(width, sortMode int) string {
178179 dim .Width (nameWidth ).Render (nameLabel ) +
179180 dim .Width (3 ).Render (" ST" )
180181
181- return row
182+ return lipgloss .NewStyle ().
183+ Background (tokenBgSurface ).
184+ Width (width ).
185+ Render (row )
182186}
183187
184188func renderSessionTableRow (s model.SessionInfo , selected , blinkOn bool , spinnerIdx , width int ) string {
@@ -232,7 +236,10 @@ func renderSessionTableRow(s model.SessionInfo, selected, blinkOn bool, spinnerI
232236 Width (width ).
233237 Render (row )
234238 }
235- return lipgloss .NewStyle ().Width (width ).Render (row )
239+ return lipgloss .NewStyle ().
240+ Background (tokenBgSurface ).
241+ Width (width ).
242+ Render (row )
236243}
237244
238245func typeTag (t model.ProcessType ) string {
@@ -317,7 +324,10 @@ func renderOutputTab(a App, width, height int) string {
317324
318325// ── Detail panel ────────────────────────────────────────────────────
319326
320- func renderDetail (s * model.SessionInfo , height int , insertMode bool ) string {
327+ func renderDetail (s * model.SessionInfo , width , height int , insertMode bool ) string {
328+ if width < 20 {
329+ width = 20
330+ }
321331 if s == nil {
322332 return panelHeadingStyle .Render ("Overview" ) + "\n " +
323333 lipgloss .NewStyle ().Foreground (tokenFgMuted ).
@@ -353,7 +363,7 @@ func renderDetail(s *model.SessionInfo, height int, insertMode bool) string {
353363 lipgloss .NewStyle ().Foreground (colorMagenta ).Render ("⎇ " + sanitizeField (s .GitBranch )))
354364 }
355365
356- lines = append (lines , "" , divider (40 ))
366+ lines = append (lines , "" , divider (min ( width , 40 ) ))
357367
358368 if s .ContextPct > 0 || s .ContextTokens > 0 {
359369 lines = append (lines , "" )
@@ -368,7 +378,7 @@ func renderDetail(s *model.SessionInfo, height int, insertMode bool) string {
368378 if s .LastActivity != "" {
369379 activity := sanitizeField (s .LastActivity )
370380 if len (activity ) > 80 {
371- activity = activity [:80 ] + "…"
381+ activity = activity [:min ( width , 80 ) ] + "…"
372382 }
373383 lines = append (lines , "" ,
374384 lipgloss .NewStyle ().Foreground (tokenFgMuted ).Italic (true ).
@@ -378,7 +388,7 @@ func renderDetail(s *model.SessionInfo, height int, insertMode bool) string {
378388 if s .TaskSummary != "" {
379389 task := sanitizeField (s .TaskSummary )
380390 if len (task ) > 76 {
381- task = task [:76 ] + "…"
391+ task = task [:min ( width , 76 ) ] + "…"
382392 }
383393 lines = append (lines , "" ,
384394 lipgloss .NewStyle ().Foreground (tokenFgAccent ).Bold (true ).Render ("Task: " )+
@@ -387,7 +397,7 @@ func renderDetail(s *model.SessionInfo, height int, insertMode bool) string {
387397
388398 // Pane preview
389399 if s .PaneContent != "" {
390- lines = append (lines , "" , divider (40 ))
400+ lines = append (lines , "" , divider (min ( width , 40 ) ))
391401
392402 paneLines := strings .Split (s .PaneContent , "\n " )
393403 for len (paneLines ) > 0 && strings .TrimSpace (paneLines [len (paneLines )- 1 ]) == "" {
@@ -407,11 +417,12 @@ func renderDetail(s *model.SessionInfo, height int, insertMode bool) string {
407417 preview := paneLines [start :]
408418
409419 var colored []string
420+ previewWidth := max (16 , width - 2 )
410421 for _ , pl := range preview {
411422 pl = strings .ReplaceAll (pl , "\r " , "" )
412423 pl = strings .ReplaceAll (pl , "\t " , " " )
413- if runes := []rune (pl ); len (runes ) > 76 {
414- pl = string (runes [:76 ])
424+ if runes := []rune (pl ); len (runes ) > previewWidth {
425+ pl = string (runes [:previewWidth ])
415426 }
416427 colored = append (colored , colorPreviewLine (pl ))
417428 }
@@ -425,7 +436,7 @@ func renderDetail(s *model.SessionInfo, height int, insertMode bool) string {
425436 boxStyle = boxStyle .BorderForeground (colorYellow )
426437 boxLabel = lipgloss .NewStyle ().Foreground (colorYellow ).Bold (true ).Render (" INSERT " )
427438 }
428- box := boxStyle .Width (78 ).Height (previewHeight ).
439+ box := boxStyle .Width (previewWidth ).Height (previewHeight ).
429440 Render (strings .Join (colored , "\n " ))
430441
431442 lines = append (lines , boxLabel , box )
0 commit comments