diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-07 15:02:14 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-07 15:02:14 +0300 |
| commit | bc04f89ace5247e897af98c523142dcfc574ea91 (patch) | |
| tree | f3b1658c2eabb93e0fc5ab6175b6c33cda765a72 | |
| parent | d5fcc8f9293fc02cfc60fa7027c3f829138907a3 (diff) | |
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 <noreply@anthropic.com>
| -rw-r--r-- | internal/ui/theme.go | 35 | ||||
| -rw-r--r-- | internal/ui/ultra.go | 12 |
2 files changed, 29 insertions, 18 deletions
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 { |
