fix: apply black background to banking TUI padding areas

Padding spaces (end-of-line and blank filler lines) were unstyled,
causing the terminal's default background to bleed through.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 00:55:33 +01:00
parent d226c32b9b
commit 5d0c8cc20c

View File

@@ -101,13 +101,14 @@ func formatCurrency(cents int64) string {
}
// padLine pads a single line (which may contain ANSI codes) to termWidth
// using its visual width.
// using its visual width. Padding uses a black background so the terminal's
// default background doesn't bleed through.
func padLine(line string) string {
w := lipgloss.Width(line)
if w >= termWidth {
return line
}
return line + strings.Repeat(" ", termWidth-w)
return line + baseStyle.Render(strings.Repeat(" ", termWidth-w))
}
// padLines pads every line in a multi-line string to termWidth so that
@@ -147,7 +148,7 @@ func screenFrame(bankName, terminalID, region, content string, height int) strin
// strings.Count gives newlines; add 1 for the line after the last \n.
contentLines := strings.Count(content, "\n") + 1
used := headerLines + contentLines + footerLines
blankLine := strings.Repeat(" ", termWidth)
blankLine := baseStyle.Render(strings.Repeat(" ", termWidth))
for i := used; i < height; i++ {
b.WriteString(blankLine)
b.WriteString("\n")