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:
@@ -101,13 +101,14 @@ func formatCurrency(cents int64) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// padLine pads a single line (which may contain ANSI codes) to termWidth
|
// 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 {
|
func padLine(line string) string {
|
||||||
w := lipgloss.Width(line)
|
w := lipgloss.Width(line)
|
||||||
if w >= termWidth {
|
if w >= termWidth {
|
||||||
return line
|
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
|
// 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.
|
// strings.Count gives newlines; add 1 for the line after the last \n.
|
||||||
contentLines := strings.Count(content, "\n") + 1
|
contentLines := strings.Count(content, "\n") + 1
|
||||||
used := headerLines + contentLines + footerLines
|
used := headerLines + contentLines + footerLines
|
||||||
blankLine := strings.Repeat(" ", termWidth)
|
blankLine := baseStyle.Render(strings.Repeat(" ", termWidth))
|
||||||
for i := used; i < height; i++ {
|
for i := used; i < height; i++ {
|
||||||
b.WriteString(blankLine)
|
b.WriteString(blankLine)
|
||||||
b.WriteString("\n")
|
b.WriteString("\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user