Skip to content

Commit cdd62cc

Browse files
committed
fix: truncate risk panel content to prevent top clipping
1 parent f4f0549 commit cdd62cc

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

internal/tui/risk_panel.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,18 @@ func (p riskPanel) render(caps detect.Capabilities, mode detect.PastewatchMode,
386386
}
387387
}
388388

389-
return b.String()
389+
// Truncate to fit panel height — keep top sections visible.
390+
content := b.String()
391+
maxLines := p.height - 2 // panel border
392+
if maxLines > 0 {
393+
lines := strings.Split(content, "\n")
394+
if len(lines) > maxLines {
395+
lines = lines[:maxLines-1]
396+
lines = append(lines, styleDim.Render(" ..."))
397+
content = strings.Join(lines, "\n")
398+
}
399+
}
400+
return content
390401
}
391402

392403
func (p riskPanel) renderPastewatchStatus(b *strings.Builder, caps detect.Capabilities, mode detect.PastewatchMode, scan detect.ScanResult) {

0 commit comments

Comments
 (0)