diff options
author | T <t@tjp.lol> | 2025-08-08 10:11:07 -0600 |
---|---|---|
committer | T <t@tjp.lol> | 2025-08-08 10:11:19 -0600 |
commit | 54c791927b2851fb6739ed75897090c3c39ecca1 (patch) | |
tree | 8f97b3509ccffed1351fe3d101e70c1cf0d861a9 /internal/tui/history_box.go | |
parent | a7ee7f7280d593481501446008acc05e32abcd22 (diff) |
create forms for clients and projects
Diffstat (limited to 'internal/tui/history_box.go')
-rw-r--r-- | internal/tui/history_box.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/tui/history_box.go b/internal/tui/history_box.go index 99fa4ac..00b39f3 100644 --- a/internal/tui/history_box.go +++ b/internal/tui/history_box.go @@ -159,7 +159,8 @@ func (m HistoryBoxModel) View(width, height int, isSelected bool, timer TimerBox var content string if len(m.entries) == 0 { - content = "📝 Recent History\n\nNo recent entries\n\nStart tracking time to\nsee your history here." + content = "📝 Recent History\n\n" + content += inactiveTimerStyle.Render("No recent entries\n\nStart tracking time to\nsee your history here.") } else { switch m.viewLevel { case HistoryLevelSummary: @@ -283,6 +284,9 @@ func (m HistoryBoxModel) renderSummaryView(timer TimerBoxModel) string { } func (m HistoryBoxModel) selectedEntries() []queries.TimeEntry { + if len(m.summaryItems) == 0 { + return nil + } summary := m.summaryItems[m.summarySelection] key := HistorySummaryKey{ Date: summary.Date.Local(), @@ -417,6 +421,10 @@ func (m HistoryBoxModel) selectedEntry() queries.TimeEntry { } func (m HistoryBoxModel) selection() (string, string, string, *float64) { + if len(m.summaryItems) == 0 { + return "", "", "", nil + } + item := m.summaryItems[m.summarySelection] clientID := strconv.FormatInt(item.ClientID, 10) |