diff --git a/.planning/phases/03-calendar-integration/03-01-PLAN.md b/.planning/phases/03-calendar-integration/03-01-PLAN.md
index 6c8bcfe..6681095 100644
--- a/.planning/phases/03-calendar-integration/03-01-PLAN.md
+++ b/.planning/phases/03-calendar-integration/03-01-PLAN.md
@@ -4,13 +4,14 @@ plan: 01
type: execute
wave: 1
depends_on: []
-files_modified: [src/lib/google-calendar.ts, src/lib/apple-calendar.ts, src/app/api/calendar/google/oauth/route.ts, src/app/api/calendar/apple/oauth/route.ts]
+files_modified: [src/lib/google-calendar.ts, src/lib/apple-calendar.ts, src/app/api/calendar/google/oauth/route.ts, src/app/api/calendar/apple/oauth/route.ts, src/lib/calendar-events.ts, src/components/WeeklyView.tsx]
autonomous: true
must_haves:
truths:
- "User can connect their Google Calendar account"
- "User can connect their Apple Calendar account"
- "Connected calendars appear in user's calendar settings"
+ - "User can view calendar events alongside tasks in weekly view"
artifacts:
- path: "src/lib/google-calendar.ts"
provides: "Google Calendar OAuth flow and API wrapper"
@@ -24,6 +25,12 @@ must_haves:
- path: "src/app/api/calendar/apple/oauth/route.ts"
provides: "Apple OAuth callback endpoint"
exports: ["GET"]
+ - path: "src/lib/calendar-events.ts"
+ provides: "Utility functions for fetching and formatting calendar events for display"
+ min_lines: 20
+ - path: "src/components/WeeklyView.tsx"
+ provides: "Weekly view component that displays both tasks and calendar events"
+ min_lines: 50
key_links:
- from: "src/app/api/calendar/google/oauth/route.ts"
to: "src/lib/google-calendar.ts"
@@ -33,13 +40,17 @@ must_haves:
to: "src/lib/apple-calendar.ts"
via: "import and use"
pattern: "import.*apple-calendar"
+ - from: "src/components/WeeklyView.tsx"
+ to: "src/lib/calendar-events.ts"
+ via: "import and use"
+ pattern: "import.*calendar-events"
---
-Implement the calendar integration system allowing users to connect Google and Apple calendar accounts with OAuth.
+Implement the calendar integration system allowing users to connect Google and Apple calendar accounts with OAuth and view calendar events alongside tasks.
Purpose: Enable users to view and synchronize their calendar events with the weekly task view.
-Output: Google Calendar and Apple Calendar OAuth flows with API wrappers for calendar event retrieval.
+Output: Google Calendar and Apple Calendar OAuth flows with API wrappers for calendar event retrieval, plus calendar event display in the weekly view.
@@ -89,6 +100,36 @@ Output: Google Calendar and Apple Calendar OAuth flows with API wrappers for cal
Module exports initializeOAuth, getUserCalendars, and getUpcomingEvents functions
+
+ Create Calendar Events Utility Functions
+ src/lib/calendar-events.ts
+ Create a TypeScript module that provides functions for:
+ - Fetching calendar events from connected accounts
+ - Formatting events for display in the weekly view
+ - Handling event merging with existing tasks (avoiding duplicates)
+ - Filtering events by date range (week view)
+ - Determining event visibility based on user settings
+
+ Reference calendar data structures from Phase 2 and API patterns from Phase 1.
+ npm test passes and the module exports required functions without error
+ Module exports getCalendarEvents, formatEventForDisplay, mergeWithTasks functions
+
+
+
+ Enhance Weekly View with Calendar Events
+ src/components/WeeklyView.tsx
+ Modify the existing WeeklyView component to:
+ - Fetch calendar events alongside tasks from the data store
+ - Render calendar events in the appropriate day slots
+ - Differentiate visually from tasks (color coding, icons, etc.)
+ - Handle event click interactions (view details, etc.)
+ - Maintain existing task functionality while adding calendar events
+
+ Follow UI patterns from Phase 2 and component architecture from Phase 1.
+ Component renders without error and displays both tasks and calendar events
+ Component correctly displays tasks and calendar events in the weekly view
+
+
@@ -98,6 +139,9 @@ Verify that all components work in concert:
3. Calendar list can be fetched for connected accounts
4. Events from calendars are retrievable
5. UI for calendar settings shows connected accounts
+6. Calendar events appear alongside tasks in the weekly view
+7. Events are properly formatted and differentiated from tasks
+8. Event display settings can be configured and persisted
@@ -105,6 +149,9 @@ Verify that all components work in concert:
- Connected calendars appear in the user's calendar settings
- Calendar events can be retrieved for display in the weekly view
- Tokens are securely stored for accessing calendar data
+- Users can view calendar events alongside tasks in the weekly view
+- Calendar events are visually differentiated from tasks
+- Users can configure how calendar events are displayed