diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-26 16:49:44 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-26 16:49:44 -1000 |
| commit | 42a4e32daca13b518e64e5821080ff3d6adf0e39 (patch) | |
| tree | 639c790e25b961ecf51ab6ea75206bc3432f1548 /issues/011-add-timeline-view.md | |
| parent | 8de1b5cb8915ed9a6e32566431d05fafafeb338d (diff) | |
Use configured timezone throughout codebase
- Add config/timezone.go with timezone utilities:
- SetDisplayTimezone(), GetDisplayTimezone()
- Now(), Today() - current time/date in display TZ
- ParseDateInDisplayTZ(), ToDisplayTZ() - parsing helpers
- Initialize timezone at startup in main.go
- Update all datetime logic to use configured timezone:
- handlers/handlers.go - all time.Now() calls
- handlers/timeline.go - date parsing
- handlers/timeline_logic.go - now calculation
- models/atom.go - ComputeUIFields()
- models/timeline.go - ComputeDaySection()
- api/plantoeat.go - meal date parsing
- api/todoist.go - due date parsing
- api/trello.go - due date parsing
This ensures all dates/times display correctly regardless
of server timezone setting.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'issues/011-add-timeline-view.md')
| -rw-r--r-- | issues/011-add-timeline-view.md | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/issues/011-add-timeline-view.md b/issues/011-add-timeline-view.md deleted file mode 100644 index 49e744a..0000000 --- a/issues/011-add-timeline-view.md +++ /dev/null @@ -1,86 +0,0 @@ -# [FEATURE] Add timeline view - -## Description -Add timeline view. - -## User Story -As a user, I want a timeline/agenda view so I can see my day's schedule visually. - -## Technical Context -- New view aggregating multiple data sources by time -- Requires merging tasks + meals + (future) calendar events -- New tab or view mode in existing UI - -## Test Strategy - -### Unit Test (Red) -**File:** `internal/handlers/handlers_test.go` - -```go -func TestBuildTimeline(t *testing.T) { - tasks := []Task{{Name: "Task 1", DueDate: todayAt(10, 0)}} - meals := []Meal{{Name: "Lunch", Date: today, Type: "lunch"}} // lunch = 12:00 - - timeline := BuildTimeline(tasks, meals) - - assert.Len(t, timeline, 2) - assert.Equal(t, "Task 1", timeline[0].Title) - assert.Equal(t, "Lunch", timeline[1].Title) -} - -func TestTimelineItemsSortedByTime(t *testing.T) { - // Items from different sources - // Assert sorted by timestamp regardless of source -} -``` - -### E2E Test (Red) -Timeline renders with correct order and time markers. - -## Proposed Approach - -1. **Data Structure:** - ```go - type TimelineItem struct { - Time time.Time - Title string - Source string // "task", "meal", "calendar" - Type string // source-specific type - URL string - Metadata map[string]any - } - ``` - -2. **Handler:** - - New endpoint `GET /timeline` or extend tab handler - - Aggregate items from tasks, meals, (future) calendar - - Sort by time ascending - - Group by hour or time block - -3. **UI:** - - Vertical timeline with time gutter on left - - Color-coded by source - - Expandable items for details - -4. **Meal time mapping:** - - breakfast: 08:00 - - lunch: 12:00 - - dinner: 18:00 - - snack: configurable or omit from timeline - -## Affected Components -- `internal/handlers/handlers.go` or `internal/handlers/timeline.go` (new) -- `internal/handlers/handlers_test.go` -- `internal/models/types.go` (TimelineItem struct) -- `web/templates/partials/timeline-tab.html` (new) -- `web/templates/index.html` (add tab) - -## Definition of Done -- [ ] Timeline view accessible from UI -- [ ] Tasks with times appear at correct position -- [ ] Meals appear at appropriate meal times -- [ ] Items sorted chronologically -- [ ] Visual time markers/gutter -- [ ] Color coding by source -- [ ] Unit tests for timeline building -- [ ] E2E test for rendering |
