diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-07 08:53:06 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-07 09:24:18 +0300 |
| commit | 0689fd71cbb2890aacb7a24c6ec8baa4956ad8eb (patch) | |
| tree | 0de66ccfea04371eb0ac900c42d2b4220bc65942 | |
| parent | b3b9922f6675c495695920d3eefed170b36b8582 (diff) | |
ui: fix black inter-section gaps on selected ultra cards
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 <noreply@anthropic.com>
| -rw-r--r-- | internal/ui/ultra.go | 21 |
1 files changed, 19 insertions, 2 deletions
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) } |
