From 0689fd71cbb2890aacb7a24c6ec8baa4956ad8eb Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 7 Apr 2026 08:53:06 +0300 Subject: ui: fix black inter-section gaps on selected ultra cards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The blank lines inserted between card sections (header/meta/desc/ annotations) by ultraJoinSections had no background style, so they rendered in the terminal-default black even when the card was selected. Add ultraJoinSectionsWithBlank(blankLine, sections...) that accepts an explicit blank-line separator. renderUltraCard now passes a Width(width)+Background(SelectedBG) styled empty string as the separator when the card is selected, ensuring every line — including the blank inter-section gaps — carries the grey background. Co-Authored-By: Claude Sonnet 4.6 --- internal/ui/ultra.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'internal') diff --git a/internal/ui/ultra.go b/internal/ui/ultra.go index 0bbd198..9213af1 100644 --- a/internal/ui/ultra.go +++ b/internal/ui/ultra.go @@ -594,7 +594,16 @@ func (m *Model) renderUltraCard(t task.Task, width int, selected bool, re *regex if selected { bg = m.theme.SelectedBG } - card := ultraJoinSections( + + // Blank line between sections must also carry bg; otherwise the terminal + // default (black) shows through on the empty separator line. + blankLine := lipgloss.NewStyle().Width(width).Background(lipgloss.Color(bg)).Render("") + if bg == "" { + blankLine = "" + } + + card := ultraJoinSectionsWithBlank( + blankLine, m.renderUltraHeaderWithRegex(t, width, re, bg), m.renderUltraMetaWithRegex(t, width, re, bg), m.renderUltraDescriptionWithRegex(t, width, re, bg), @@ -830,13 +839,21 @@ func ultraPriorityStyle(theme Theme, priority string) lipgloss.Style { } func ultraJoinSections(sections ...string) string { + return ultraJoinSectionsWithBlank("", sections...) +} + +// ultraJoinSectionsWithBlank joins non-empty sections separated by blankLine. +// When blankLine is a styled empty string (e.g. with a background colour), +// the inter-section gap carries that style instead of falling back to the +// terminal default. +func ultraJoinSectionsWithBlank(blankLine string, sections ...string) string { var parts []string for _, sec := range sections { if sec == "" { continue } if len(parts) > 0 { - parts = append(parts, "") + parts = append(parts, blankLine) } parts = append(parts, sec) } -- cgit v1.2.3