summaryrefslogtreecommitdiff
path: root/internal/handlers/timeline.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-07-16 07:03:03 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-07-16 07:03:03 +0000
commit6651dc17110a558342a4ef0a97a5b37adbfa04c7 (patch)
tree238d26106f88abb5a00ace811779bc7274997ff9 /internal/handlers/timeline.go
parent8a200f7f56c2894349b3f2831cd82625655acc7f (diff)
Show a scheduled-vs-available indicator on the web timeline's Today section
Task 11 of the task-budgets-and-availability plan: reuse the computeBudgetStatus helper (Task 8) in HandleTimeline so the dashboard's Today section header shows scheduled/available minutes when a budget-tracked task exists. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PQaPGQVSfmKUiHXB87qRTC
Diffstat (limited to 'internal/handlers/timeline.go')
-rw-r--r--internal/handlers/timeline.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/handlers/timeline.go b/internal/handlers/timeline.go
index 9656d4c..9284451 100644
--- a/internal/handlers/timeline.go
+++ b/internal/handlers/timeline.go
@@ -101,6 +101,10 @@ type TimelineData struct {
// Current time for "now" line
NowHour int
NowMinute int
+
+ // Opt-in budget/availability indicator for Today -- nil when no
+ // budget-tracked task exists (see computeBudgetStatus).
+ BudgetStatus *models.BudgetStatus
}
// HandleTimeline renders the timeline view
@@ -204,6 +208,12 @@ func (h *Handler) HandleTimeline(w http.ResponseWriter, r *http.Request) {
data.TomorrowHours = append(data.TomorrowHours, h)
}
+ budgetStatus, err := h.computeBudgetStatus(now)
+ if err != nil {
+ log.Printf("Warning: failed to compute budget status: %v", err)
+ }
+ data.BudgetStatus = budgetStatus
+
HTMLResponse(w, h.renderer, "timeline-tab", data)
}