summaryrefslogtreecommitdiff
path: root/issues/008-add-google-calendar-support.md
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-01-26 16:49:44 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-01-26 16:49:44 -1000
commit42a4e32daca13b518e64e5821080ff3d6adf0e39 (patch)
tree639c790e25b961ecf51ab6ea75206bc3432f1548 /issues/008-add-google-calendar-support.md
parent8de1b5cb8915ed9a6e32566431d05fafafeb338d (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/008-add-google-calendar-support.md')
-rw-r--r--issues/008-add-google-calendar-support.md85
1 files changed, 0 insertions, 85 deletions
diff --git a/issues/008-add-google-calendar-support.md b/issues/008-add-google-calendar-support.md
deleted file mode 100644
index f3a1f3b..0000000
--- a/issues/008-add-google-calendar-support.md
+++ /dev/null
@@ -1,85 +0,0 @@
-# [FEATURE] Add Google Calendar support
-
-## Description
-Add Google Calendar support.
-
-## User Story
-As a user, I want my Google Calendar events displayed so I have a unified daily view.
-
-## Technical Context
-- New integration following existing patterns in `internal/api/`
-- OAuth2 flow required; store refresh token in `sync_tokens` table
-- New partial for calendar events display
-
-## Test Strategy
-
-### Unit Test (Red)
-**File:** `internal/api/gcal_test.go`
-
-```go
-func TestParseCalendarEvents(t *testing.T) {
- // Mock Google Calendar API response
- // Assert events parsed correctly with title, time, all-day flag
-}
-
-func TestGCalClient_FetchEvents(t *testing.T) {
- // Mock HTTP client
- // Assert correct API calls made
- // Assert events returned in expected format
-}
-```
-
-### Integration Test (Red)
-Test cache/store roundtrip for events.
-
-```go
-func TestGCalEventsCache(t *testing.T) {
- // Store events in cache
- // Retrieve from cache
- // Assert data integrity
-}
-```
-
-## Proposed Approach
-
-1. **OAuth Setup:**
- - Add `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` to config
- - Implement OAuth2 flow with PKCE
- - Store refresh token in `sync_tokens` table
-
-2. **API Client:**
- - Create `internal/api/gcal.go` implementing interface pattern from existing clients
- - Use `google.golang.org/api/calendar/v3`
- - Fetch events for configurable date range (default: today + 7 days)
-
-3. **Data Model:**
- - Add `calendar_events` table or reuse existing structure
- - Handle all-day vs timed events
-
-4. **UI:**
- - New partial: `partials/gcal-events.html`
- - Integrate into existing tabs or new calendar tab
-
-## Traps to Avoid
-- **All-day events:** Google returns these differently (date vs dateTime)
-- **Timezone:** Events have their own timezone; convert to user's local
-- **Recurring events:** Decide whether to expand or show as single item
-- **Token refresh:** Handle expired access tokens gracefully
-
-## Affected Components
-- `internal/api/gcal.go` (new)
-- `internal/api/gcal_test.go` (new)
-- `internal/api/interfaces.go` (add interface)
-- `internal/config/config.go`
-- `internal/store/sqlite.go` (new table/queries)
-- `web/templates/partials/gcal-events.html` (new)
-- `cmd/dashboard/main.go` (wire up client)
-
-## Definition of Done
-- [ ] OAuth2 flow authenticates with Google
-- [ ] Events fetched from Google Calendar API
-- [ ] Events cached in SQLite
-- [ ] Events displayed in UI
-- [ ] All-day and timed events handled correctly
-- [ ] Token refresh works
-- [ ] Unit and integration tests pass