@@ -242,26 +242,8 @@ func (m *DashboardModel) renderFilter() string {
242
242
return minimalFilterStyle .Render (title + " " + content )
243
243
}
244
244
245
- // renderLogScroll renders the scrolling log section
246
- func (m * DashboardModel ) renderLogScroll (height int ) string {
247
- // Use most of terminal width for logs
248
- logWidth := m .width - 2 // Account for borders and minimal padding
249
- if logWidth < 40 {
250
- logWidth = 40 // Higher minimum for readability
251
- }
252
-
253
- // Highlight border when log section is active
254
- borderColor := ColorNavy
255
- if m .activeSection == SectionLogs {
256
- borderColor = ColorBlue
257
- }
258
-
259
- style := sectionStyle .
260
- Width (logWidth ).
261
- Height (height ).
262
- Border (lipgloss .NormalBorder ()).
263
- BorderForeground (borderColor )
264
-
245
+ // renderLogScrollContent generates the log content without border wrapper
246
+ func (m * DashboardModel ) renderLogScrollContent (height int , logWidth int ) []string {
265
247
var logLines []string
266
248
267
249
// Add paused indicator and help text when log section is active
@@ -295,10 +277,10 @@ func (m *DashboardModel) renderLogScroll(height int) string {
295
277
maxLines = 1
296
278
}
297
279
298
- // When in log section, don't auto-scroll to latest
299
- if m .activeSection != SectionLogs && len (m .logEntries ) > maxLines {
280
+ // When in log section or log viewer modal , don't auto-scroll to latest
281
+ if m .activeSection != SectionLogs && ! m . showLogViewerModal && len (m .logEntries ) > maxLines {
300
282
startIdx = len (m .logEntries ) - maxLines
301
- } else if m .activeSection == SectionLogs {
283
+ } else if m .activeSection == SectionLogs || m . showLogViewerModal {
302
284
// Keep selected log in view
303
285
if m .selectedLogIndex >= 0 && m .selectedLogIndex < len (m .logEntries ) {
304
286
// Center selected log if possible
@@ -316,8 +298,8 @@ func (m *DashboardModel) renderLogScroll(height int) string {
316
298
entry := m .logEntries [i ]
317
299
formatted := m .formatLogEntry (entry , logWidth )
318
300
319
- // Highlight selected log when in log section
320
- if m .activeSection == SectionLogs && i == m .selectedLogIndex {
301
+ // Highlight selected log when in log section or log viewer modal
302
+ if ( m .activeSection == SectionLogs || m . showLogViewerModal ) && i == m .selectedLogIndex {
321
303
selectedStyle := lipgloss .NewStyle ().
322
304
Background (ColorBlue ).
323
305
Foreground (ColorWhite )
@@ -348,5 +330,31 @@ func (m *DashboardModel) renderLogScroll(height int) string {
348
330
logLines = append (logLines , instructions ... )
349
331
}
350
332
333
+ return logLines
334
+ }
335
+
336
+ // renderLogScroll renders the scrolling log section
337
+ func (m * DashboardModel ) renderLogScroll (height int ) string {
338
+ // Use most of terminal width for logs
339
+ logWidth := m .width - 2 // Account for borders and minimal padding
340
+ if logWidth < 40 {
341
+ logWidth = 40 // Higher minimum for readability
342
+ }
343
+
344
+ // Highlight border when log section is active
345
+ borderColor := ColorNavy
346
+ if m .activeSection == SectionLogs {
347
+ borderColor = ColorBlue
348
+ }
349
+
350
+ style := sectionStyle .
351
+ Width (logWidth ).
352
+ Height (height ).
353
+ Border (lipgloss .NormalBorder ()).
354
+ BorderForeground (borderColor )
355
+
356
+ // Get log content
357
+ logLines := m .renderLogScrollContent (height , logWidth )
358
+
351
359
return style .Render (lipgloss .JoinVertical (lipgloss .Left , logLines ... ))
352
360
}
0 commit comments