fix: add padding to SummaryBox for consistent border width

This commit is contained in:
Willie Hung
2026-01-23 21:14:09 +08:00
parent 6fad4335d2
commit f9f4e595e0
+14 -1
View File
@@ -190,9 +190,22 @@ func SummaryBox(title string, items map[string]string) {
lines = append(lines, fmt.Sprintf(" %-10s %s", k+":", v))
}
// Find max line length for consistent box width
maxLen := 0
for _, line := range lines {
if len(line) > maxLen {
maxLen = len(line)
}
}
// Pad lines to same length
content := ""
for i, line := range lines {
content += line
padded := line
if len(line) < maxLen {
padded = line + strings.Repeat(" ", maxLen-len(line))
}
content += padded
if i < len(lines)-1 {
content += "\n"
}