From bc04f89ace5247e897af98c523142dcfc574ea91 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 7 Apr 2026 15:02:14 +0300 Subject: ui: highlight started tasks with yellow background in ultra mode Add UltraStartedBG (amber 220) to Theme and apply it as the card background when a task has a non-empty Start field. Selection highlight still takes priority when the cursor is on the same card. Co-Authored-By: Claude Sonnet 4.6 --- internal/ui/theme.go | 35 +++++++++++++++++++---------------- internal/ui/ultra.go | 12 ++++++++++-- 2 files changed, 29 insertions(+), 18 deletions(-) (limited to 'internal') diff --git a/internal/ui/theme.go b/internal/ui/theme.go index ad02a83..b7b3490 100644 --- a/internal/ui/theme.go +++ b/internal/ui/theme.go @@ -7,20 +7,21 @@ import ( // Theme holds color configuration for the UI. type Theme struct { - HeaderFG string - SelectedFG string - SelectedBG string - RowFG string - RowBG string - StatusFG string - StatusBG string - StartBG string - OverdueBG string - PrioLowBG string - PrioMedBG string - PrioHighBG string - SearchFG string - SearchBG string + HeaderFG string + SelectedFG string + SelectedBG string + RowFG string + RowBG string + StatusFG string + StatusBG string + StartBG string + UltraStartedBG string // background for started tasks in ultra mode + OverdueBG string + PrioLowBG string + PrioMedBG string + PrioHighBG string + SearchFG string + SearchBG string } // DefaultTheme returns the color theme used by Task Samurai. @@ -33,7 +34,8 @@ func DefaultTheme() Theme { RowBG: "57", StatusFG: "229", // light yellow StatusBG: "57", // dark purple — status bar background - StartBG: "6", + StartBG: "6", + UltraStartedBG: "220", // amber yellow — visually distinct "in progress" indicator OverdueBG: "1", PrioLowBG: "28", // dark green — subtler than bright 10 PrioMedBG: "33", // medium blue — subtler than bright 12 @@ -49,7 +51,8 @@ func RandomTheme() Theme { SelectedBG: randColor(), RowBG: randColor(), StatusBG: randColor(), - StartBG: randColor(), + StartBG: randColor(), + UltraStartedBG: randColor(), OverdueBG: randColor(), PrioLowBG: randColor(), PrioMedBG: randColor(), diff --git a/internal/ui/ultra.go b/internal/ui/ultra.go index fc28bc5..8419e78 100644 --- a/internal/ui/ultra.go +++ b/internal/ui/ultra.go @@ -650,7 +650,8 @@ func (m *Model) renderUltraCard(t task.Task, width int, selected bool, re *regex lines[0] = "! " + lines[0] card = strings.Join(lines, "\n") } - return ultraCardStyle(m.theme, width, selected, blink).Render(card) + started := t.Start != "" + return ultraCardStyle(m.theme, width, selected, started, blink).Render(card) } // renderUltraHeader renders the task's primary state line (no selection bg). @@ -855,9 +856,16 @@ func (m *Model) ultraKeyValue(re *regexp.Regexp, label, value, bg string) string return m.ultraStyledText(re, labelStyle, label+":", bg) + space + m.ultraStyledText(re, valueStyle, value, bg) } -func ultraCardStyle(theme Theme, width int, selected, blink bool) lipgloss.Style { +func ultraCardStyle(theme Theme, width int, selected, started, blink bool) lipgloss.Style { style := lipgloss.NewStyle().Width(width) + if started { + // Amber yellow background marks in-progress tasks; selection overrides it + // when the cursor is also on this card. + fg := contrastColor(theme.UltraStartedBG) + style = style.Foreground(lipgloss.Color(fg)).Background(lipgloss.Color(theme.UltraStartedBG)) + } if selected { + // Selection highlight takes priority over the started colour. style = style.Foreground(lipgloss.Color(theme.SelectedFG)).Background(lipgloss.Color(theme.SelectedBG)) } if blink { -- cgit v1.2.3