From d818eddecbecab417b05943c5d6ca9aac537fde5 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Thu, 26 Feb 2026 12:57:22 +0300 Subject: [PATCH] fix(ui): embed vertical padding as content to fix background banding Lipgloss PaddingTop/PaddingBottom adds raw newlines that don't receive background color styling. Prepend/append newlines to the content string instead so they are part of the styled content and get the background. --- internal/ui/block_renderer.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/ui/block_renderer.go b/internal/ui/block_renderer.go index 7bc0b06c..8a5c776d 100644 --- a/internal/ui/block_renderer.go +++ b/internal/ui/block_renderer.go @@ -146,10 +146,18 @@ func renderContentBlock(content string, containerWidth int, options ...rendering option(renderer) } + // Embed vertical padding as content newlines rather than style + // PaddingTop/PaddingBottom — lipgloss adds those as raw newlines + // that don't receive the background color, causing visible banding. + for range renderer.paddingTop { + content = "\n" + content + } + for range renderer.paddingBottom { + content = content + "\n" + } + theme := GetTheme() style := lipgloss.NewStyle(). - PaddingTop(renderer.paddingTop). - PaddingBottom(renderer.paddingBottom). PaddingLeft(renderer.paddingLeft). PaddingRight(renderer.paddingRight). Foreground(theme.Text)