Commit Graph

48 Commits

Author SHA1 Message Date
Connor Johnstone
3464754489 Remove debug logging from all-day event detection
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 12:22:34 -04:00
Connor Johnstone
e56253b9c2 Fix all-day recurring events RFC-5545 compliance
- Set all_day flag properly when creating VEvent in series handler
- Improve all-day event detection using VALUE=DATE parameter
- Add RFC-5545 compliance for exclusive end dates (backend adds 1 day)
- Fix end date display in event modal (frontend subtracts 1 day for display)
- Fix recurring all-day event expansion to maintain proper end date pattern

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 12:21:46 -04:00
Connor Johnstone
a773159016 Fix recurring event filtering for month view
Previously filtered events by start date only, which excluded recurring
events that started in previous months/years but have instances in the
current month.

New logic:
- Non-recurring events: filter by exact month match (unchanged)
- Recurring events: include if they could have instances in requested month
- Check event start date is before/during month
- Parse RRULE UNTIL date to exclude expired recurring events
- Let frontend handle proper RRULE expansion

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 11:36:28 -04:00
Connor Johnstone
5456d7140c Manual updates to fix some deployment steps
Some checks failed
Build and Push Docker Image / docker (push) Failing after 21s
2025-09-02 16:03:11 -04:00
Connor Johnstone
0899a84b42 Fix all-day events: validation and proper header positioning
Backend fixes:
- Fix all-day event creation validation error
- Allow same start/end date for all-day events (single-day events)
- Maintain strict validation for timed events (end must be after start)

Frontend improvements:
- Move all-day events from time grid to day headers
- Add dedicated all-day events container that stacks vertically
- Filter all-day events out of main time-based events area
- Add proper CSS styling for all-day event display and interaction
- Maintain event click handling and color themes

All-day events now appear in the correct location at the top of each
day column and properly stack when multiple events exist.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 11:13:54 -04:00
Connor Johnstone
970b0a07da Fix compiler warnings
- Remove unused import in auth handler
- Remove unused PreferencesService export
- Fix unused mutable variable in preferences
- Remove unused display_name method from Style enum
- Add dead_code attributes for future preferences service

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 10:38:13 -04:00
Connor Johnstone
73567c185c Implement comprehensive style system with Google Calendar theme
This commit adds a complete style system alongside the existing theme system, allowing users to switch between different UI styles while maintaining theme color variations.

**Core Features:**
- Style enum (Default, Google Calendar) separate from Theme enum
- Hot-swappable stylesheets with dynamic loading
- Style preference persistence (localStorage + database)
- Style picker UI in sidebar below theme picker

**Frontend Implementation:**
- Add Style enum to sidebar.rs with value/display methods
- Implement dynamic stylesheet loading in app.rs
- Add style picker dropdown with proper styling
- Handle style state management and persistence
- Add web-sys features for HtmlLinkElement support

**Backend Integration:**
- Add calendar_style column to user_preferences table
- Update all database operations (insert/update/select)
- Extend API models for style preference
- Add migration for existing users

**Google Calendar Style:**
- Clean Material Design-inspired interface
- White sidebar with proper contrast
- Enhanced calendar grid with subtle shadows
- Improved event styling with hover effects
- Google Sans typography throughout
- Professional color scheme and spacing

**Technical Details:**
- Trunk asset management for stylesheet copying
- High CSS specificity to override theme styles
- Modular CSS architecture for easy extensibility
- Comprehensive text contrast fixes
- Enhanced calendar cells and navigation

Users can now choose between the original gradient design (Default) and a clean Google Calendar-inspired interface (Google Calendar), with full preference persistence across sessions.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 20:08:05 -04:00
Connor Johnstone
03c0011445 Implement lightweight auth system with SQLite
Added SQLite database for session management and user preferences storage,
allowing users to have consistent settings across different sessions and devices.

Backend changes:
- Added SQLite database with users, sessions, and preferences tables
- Implemented session-based authentication alongside JWT tokens
- Created preference storage/retrieval API endpoints
- Database migrations for schema setup
- Session validation and cleanup functionality

Frontend changes:
- Added "Remember server" and "Remember username" checkboxes to login
- Created preferences service for syncing settings with backend
- Updated auth flow to handle session tokens and preferences
- Store remembered values in LocalStorage (not database) for convenience

Key features:
- User preferences persist across sessions and devices
- CalDAV passwords never stored, only passed through
- Sessions expire after 24 hours
- Remember checkboxes only affect local browser storage

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 18:55:09 -04:00
Connor Johnstone
79f287ed61 Fix calendar event fetching to use visible date range
Some checks failed
Build and Push Docker Image / docker (push) Failing after 1m7s
Moved event fetching logic from CalendarView to Calendar component to properly
use the visible date range instead of hardcoded current month. The Calendar
component already tracks the current visible date through navigation, so events
now load correctly for August and other months when navigating.

Changes:
- Calendar component now manages its own events state and fetching
- Event fetching responds to current_date changes from navigation
- CalendarView simplified to just render Calendar component
- Fixed cargo fmt/clippy formatting across codebase

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 18:31:51 -04:00
Connor Johnstone
e55e6bf4dd Clean up obsolete CalDAV environment variables
Some checks failed
Build and Push Docker Image / docker (push) Failing after 2s
## Removed Obsolete Environment Variables:
- `CALDAV_SERVER_URL` - provided by user login
- `CALDAV_USERNAME` - provided by user login
- `CALDAV_PASSWORD` - provided by user login
- `CALDAV_TASKS_PATH` - not used in any features

## Kept with Intelligent Discovery:
- `CALDAV_CALENDAR_PATH` - optional override, defaults to smart discovery

## Changes:
### Backend
- Remove `CalDAVConfig::from_env()` method (not used in main app)
- Add `CalDAVConfig::new()` constructor with credentials
- Remove `tasks_path` field from CalDAVConfig
- Update auth service to use new constructor
- Update tests to use hardcoded test values instead of env vars
- Update debug tools to use test credentials

### Frontend
- Remove unused `config.rs` file entirely (frontend uses backend API)

## Current Authentication Flow:
1. User provides CalDAV credentials via login API
2. Backend creates CalDAVConfig dynamically from login request
3. Backend tests authentication via calendar discovery
4. Optional `CALDAV_CALENDAR_PATH` env var can override discovery
5. No environment variables required for normal operation

This simplifies deployment - users only need to provide CalDAV
credentials through the web interface, no server-side configuration required.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-31 19:48:13 -04:00
Connor Johnstone
5a12c0e0d0 Implement comprehensive event series editing via modal
## Frontend Changes:
- Add EditAction enum (EditThis, EditFuture, EditAll) to event context menu
- Update context menu to show 3 edit options for recurring events
- Enhance EventCreationData with edit_scope and changed_fields tracking
- Update app component to handle EditAction types and pass to modal
- Add field change tracking infrastructure to CreateEventModal

## Backend Changes:
- Add changed_fields parameter to UpdateEventSeriesRequest for optimization
- Existing series endpoint already supports the three update types:
  - "this_only" - creates exception with EXDATE
  - "this_and_future" - creates new series with UNTIL on original
  - "all_in_series" - updates existing series in-place

## Implementation Details:
- Event context menu shows single edit option for non-recurring events
- Recurring events get three options: "Edit This Event", "Edit This and Future Events", "Edit All Events in Series"
- Modal tracks which fields user actually changed for efficient updates
- Backend series endpoint already has the logic for all three update scenarios
- Full RFC 5545 compliance with proper EXDATE and UNTIL handling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-31 18:49:56 -04:00
Connor Johnstone
63968280b8 Clean up unused code and compiler warnings
Removed unused functions and variables identified after RRULE parameter fix:
- Remove unused build_series_rrule function from backend series handler
- Remove unused RecurrenceType::from_rrule and helper functions from frontend
- Prefix unused state variables with underscores to suppress warnings

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-31 00:45:56 -04:00
Connor Johnstone
3ccf31f479 Remove debug logging from RRULE handling
Clean up extensive console logging that was added during RRULE debugging.
Removed debug logs from:
- Frontend RRULE generation in create event modal
- Frontend RRULE parsing in calendar service
- Weekly/monthly/yearly occurrence generation functions
- Backend RRULE processing in events and series handlers

The core functionality remains unchanged - this is purely a cleanup
of temporary debugging output that is no longer needed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-31 00:35:57 -04:00
Connor Johnstone
c599598390 Fix recurring event RRULE INTERVAL and COUNT parameter loss
This commit fixes a critical bug where INTERVAL and COUNT parameters
were being stripped from recurring events during backend processing.

Frontend was correctly generating complete RRULE strings like:
FREQ=WEEKLY;INTERVAL=2;BYDAY=TU,FR;COUNT=6

But backend was ignoring the complete RRULE and rebuilding from scratch,
resulting in simplified RRULEs like:
FREQ=WEEKLY;BYDAY=TU,FR (missing INTERVAL and COUNT)

Changes:
- Modified both events and series handlers to detect complete RRULE strings
- Added logic to use frontend RRULE directly when it starts with "FREQ="
- Maintained backwards compatibility with simple recurrence types
- Added comprehensive debug logging for RRULE generation
- Fixed weekly BYDAY occurrence counting to respect COUNT parameter
- Enhanced frontend RRULE generation with detailed logging

This ensures all RFC 5545 RRULE parameters are preserved from
frontend creation through CalDAV storage and retrieval.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-31 00:28:41 -04:00
Connor Johnstone
7538054b20 Refactor update_entire_series to use consistent clone-and-modify pattern
Aligns update_entire_series with the same metadata preservation approach
used in this_only and this_and_future update methods.

## Key Changes:

1. **Clone-and-Modify Pattern**:
   - Clone existing event to preserve all metadata (organizer, attendees, etc.)
   - Only modify specific properties that need to change
   - Maintains consistency with other update methods

2. **Smart Field Handling**:
   - Preserve original values when request fields are empty
   - Only overwrite when new values are explicitly provided
   - Same selective update logic as other scopes

3. **RRULE Preservation**:
   - Keep existing recurrence pattern unchanged for simple updates
   - Suitable for drag operations that just change start/end times
   - Avoids breaking complex RRULE patterns unnecessarily

4. **Proper Timestamp Management**:
   - Update dtstamp and last_modified to current time
   - Preserve original created timestamp for event history
   - Consistent timestamp handling across all update types

## Benefits:
- All three update scopes now follow the same metadata preservation pattern
- Simple time changes (drag operations) work without side effects
- Complex event properties maintained across all modification types
- Better RFC 5545 compliance through proper event structure preservation

## Removed:
- Complex RRULE regeneration logic (build_series_rrule function now unused)
- Manual field-by-field assignment replaced with selective clone modification

This ensures consistent behavior whether users modify single occurrences,
future events, or entire series - all maintain original event metadata.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 21:31:29 -04:00
Connor Johnstone
117dd2cc75 Fix this_only backend logic for proper RFC 5545 exception handling
Resolves multiple issues with single occurrence modification to implement
correct CalDAV/RFC 5545 exception patterns:

## Key Fixes:

1. **Eliminate Double Updates**:
   - Removed redundant client.update_event() call from update_single_occurrence
   - Main handler now performs single CalDAV update, preventing conflicts

2. **Preserve Event Metadata**:
   - Changed from creating new event to cloning existing event
   - Maintains organizer, attendees, categories, and all original properties
   - Only modifies necessary fields (times, title, recurrence rules)

3. **Fix UID Conflicts**:
   - Generate unique UID for exception event (exception-{uuid})
   - Prevents CalDAV from treating exception as update to original series
   - Original series keeps its UID, exception gets separate identity

4. **Correct Date/Time Handling**:
   - Use occurrence_date for both this_only and this_and_future scopes
   - Exception event now gets dragged date/time instead of original series date
   - Properly reflects user's drag operation in the exception event

## Implementation Details:
- Exception event clones original with unique UID and RECURRENCE-ID
- Original series gets EXDATE to exclude the modified occurrence
- Main handler performs single atomic CalDAV update
- Smart field preservation (keeps original values when request is empty)

## Result:
Single occurrence modifications now work correctly with proper RFC 5545
EXDATE + exception event pattern, maintaining all event metadata while
reflecting user modifications at the correct date/time.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 21:16:25 -04:00
Connor Johnstone
9536158f58 Clean up debug logs and add comprehensive documentation for this_and_future logic
This commit improves code maintainability by:

1. **Removing excessive debug logging**:
   - Cleaned up verbose datetime parsing and CalDAV operation logs
   - Kept essential error logging and status messages
   - Simplified request flow logging for better readability

2. **Adding comprehensive documentation**:
   - Detailed RFC 5545 compliant series splitting explanation
   - Clear operation overview with real-world examples
   - Frontend/backend interaction documentation
   - CalDAV operation sequencing and race condition prevention
   - Error handling and parameter validation details

The documentation explains how "this and future events" works:
- **Backend**: Creates comprehensive function-level docs with examples
- **Frontend**: Explains the user interaction flow and technical implementation
- **Integration**: Documents the atomic request handling and parameter passing

This makes the codebase more maintainable and helps future developers
understand the complex recurring event modification logic.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 20:23:48 -04:00
Connor Johnstone
783e13eb10 Fix recurring event series modification via drag and drop operations
This commit resolves the "Failed to fetch" errors when updating recurring
event series through drag operations by implementing proper request
sequencing and fixing time parameter handling.

Key fixes:
- Eliminate HTTP request cancellation by sequencing operations properly
- Add global mutex to prevent CalDAV HTTP race conditions
- Implement complete RFC 5545-compliant series splitting for "this_and_future"
- Fix frontend to pass dragged times instead of original times
- Add comprehensive error handling and request timing logs
- Backend now handles both UPDATE (add UNTIL) and CREATE (new series) in single request

Technical changes:
- Frontend: Remove concurrent CREATE request, pass dragged times to backend
- Backend: Implement full this_and_future logic with sequential operations
- CalDAV: Add mutex serialization and detailed error tracking
- Series: Create new series with occurrence date + dragged times

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 20:17:36 -04:00
Connor Johnstone
1794cf9a59 Fix non-recurring event update functionality by using actual CalDAV hrefs
This commit resolves the 404 error when dragging/updating non-recurring events.

The issue was in the regular event update handler where it was generating fake
event hrefs based on the UID (format: "{uid}.ics") instead of using the actual
href returned by the CalDAV server during event fetching.

Changes:
- Use event.href from the stored event data instead of generating fake hrefs
- Add comprehensive debug logging to track event updates
- Fallback to generated href only when the stored href is missing

Debug logging added:
- "🔍 Found event {uid} with href: {href}" - shows which href is being used
- "📝 Updating event {uid} at calendar_path: {path}, event_href: {href}" - tracks update parameters
- " Successfully updated event {uid}" - confirms successful CalDAV updates

This matches the fix previously applied to the deletion functionality and ensures
that CalDAV PUT requests target the correct resource URLs.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 18:44:55 -04:00
Connor Johnstone
ee1c6ee299 Fix single event deletion functionality with proper recurring vs non-recurring handling
This commit resolves multiple issues with event deletion:

Backend fixes:
- Fix CalDAV URL construction for DELETE requests (missing slash separator)
- Improve event lookup by href with exact matching and fallback to UID extraction
- Add support for both RFC3339 and simple YYYY-MM-DD date formats in occurrence parsing
- Implement proper logic to distinguish recurring vs non-recurring events in delete_this action
- For non-recurring events: delete entire event from CalDAV server
- For recurring events: add EXDATE to exclude specific occurrences
- Add comprehensive debug logging for troubleshooting deletion issues

Frontend fixes:
- Update callback signatures to support series endpoint parameters (7-parameter tuples)
- Add update_series method to CalendarService for series-specific operations
- Route single occurrence modifications through series endpoint with proper scoping
- Fix all component prop definitions to use new callback signature
- Update all emit calls to pass correct number of parameters

The deletion process now works correctly:
- Single events are completely removed from the calendar
- Recurring event occurrences are properly excluded via EXDATE
- Debug logging helps identify and resolve CalDAV communication issues

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 18:40:48 -04:00
Connor Johnstone
a6aac42c78 Fix frontend to use series endpoint for single occurrence modifications
- Extended update callback signature to include update_scope and occurrence_date parameters
- Modified app.rs to detect when series endpoint should be used vs regular endpoint
- Updated calendar_service to automatically set occurrence_date for "this_only" updates
- Modified all callback emit calls throughout frontend to include new parameters
- Week_view now properly calls series endpoint with "this_only" scope for single occurrence edits

This ensures that single occurrence modifications (RecurringEditAction::ThisEvent)
now go through the proper series endpoint which will:
- Add EXDATE to the original recurring series
- Create exception event with RECURRENCE-ID
- Show proper debug logging in backend

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 14:01:30 -04:00
Connor Johnstone
071fc3099f Fix series update to preserve original date when dragging events
- When dragging recurring events, preserve original series start date
- Only update time components, not date, to prevent series from shifting days
- For timed events: use original date with new start/end times from drag
- For all-day events: preserve original date and duration pattern
- Added debug logging to track date preservation behavior
- Maintains event duration for both timed and all-day recurring events

Fixes issue where dragging a recurring event would change the date
for all occurrences instead of just updating the time.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 13:44:54 -04:00
Connor Johnstone
78f1db7203 Refactor handlers.rs into modular structure for better maintainability
- Split 1921-line handlers.rs into focused modules:
  - handlers/auth.rs: Authentication handlers (login, verify_token, get_user_info)
  - handlers/calendar.rs: Calendar management (create_calendar, delete_calendar)
  - handlers/events.rs: Event operations (CRUD operations, fetch events)
  - handlers/series.rs: Event series operations (recurring events management)
- Main handlers.rs now serves as clean re-export module
- All tests passing (14 integration + 7 unit + 3 doc tests)
- Maintains backward compatibility with existing API routes
- Improves code organization and separation of concerns

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 13:35:13 -04:00
Connor Johnstone
e21430f6ff Implement complete event series endpoints with full CRUD support
## Backend Implementation
- Add dedicated series endpoints: create, update, delete
- Implement RFC 5545 compliant RRULE generation and modification
- Support all scope operations: this_only, this_and_future, all_in_series
- Add comprehensive series-specific request/response models
- Implement EXDATE and RRULE modification for precise occurrence control

## Frontend Integration
- Add automatic series detection and smart endpoint routing
- Implement scope-aware event operations with backward compatibility
- Enhance API payloads with series-specific fields
- Integrate existing RecurringEditModal for scope selection UI

## Testing
- Add comprehensive integration tests for all series endpoints
- Validate scope handling, RRULE generation, and error scenarios
- All 14 integration tests passing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 13:21:44 -04:00
Connor Johnstone
b195208ddc Fix doctest compilation errors in config.rs
- Fix doctest import paths to use calendar_backend::config::CalDAVConfig
- Add proper Result handling in doctest example with ?operator
- All doctests now passing (3/3)
- Complete test coverage: 7 unit + 9 integration + 3 doc = 19 tests

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 12:18:30 -04:00
Connor Johnstone
5cb77235da Add comprehensive integration tests for all API endpoints
- Add 9 integration tests covering all HTTP endpoints
- Test authentication flow: login, verify, user info
- Test calendar operations: create, delete, list events
- Test event CRUD: create, update, delete, refresh
- Add TestServer utility for automated server setup
- Test both success and error scenarios (401, 400, 404)
- Integration with real CalDAV server using .env credentials
- Fix test module visibility by making handlers public
- Move misplaced unit tests into proper test module
- All tests passing: 7 unit + 9 integration = 16 total

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 12:17:09 -04:00
Connor Johnstone
a6d72ce37f Remove v2 API endpoints and fix warnings
- Remove all v2 API routes (/api/v2/calendar/events/*)
- Delete models_v2.rs file and associated types
- Remove create_event_v2, update_event_v2, delete_event_v2 handlers
- Remove unused occurrence_date and exception_dates from UpdateEventRequest
- Remove unused ConfigError variant from CalDAVError
- Simplify backend to single unified v1 API using VEvent structures

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 12:07:33 -04:00
Connor Johnstone
15f2d0c6d9 Implement shared RFC 5545 VEvent library with workspace restructuring
- Created calendar-models/ shared library with RFC 5545-compliant VEvent structures
- Migrated backend to use shared VEvent with proper field mappings (dtstart/dtend, rrule, exdate, etc.)
- Converted CalDAV client to parse into VEvent structures with structured types
- Updated all CRUD handlers to use VEvent with CalendarUser, Attendee, VAlarm types
- Restructured project as Cargo workspace with frontend/, backend/, calendar-models/
- Updated Trunk configuration for new directory structure
- Fixed all compilation errors and field references throughout codebase
- Updated documentation and build instructions for workspace structure

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 11:45:58 -04:00
Connor Johnstone
f266d3f304 Implement RFC 5545-compliant calendar system with v2 API
This major refactor eliminates manual string parsing throughout the
codebase and introduces proper RFC 5545 iCalendar specification
compliance with significant code simplification benefits.

## Backend Improvements
- Add complete RFC 5545-compliant data structures (VEvent, VTodo, etc.)
- Create simplified v2 API endpoints with direct DateTime support
- Eliminate ~150 lines of manual string parsing in handlers
- Add structured attendee and alarm support
- Maintain backward compatibility with existing v1 APIs

## Frontend Improvements
- Replace 16+ parameter create_event calls with single structured request
- Add automatic date/time conversion in EventCreationData
- Eliminate enum-to-string conversions throughout event creation
- Add v2 API models with proper type safety

## Technical Benefits
- Direct DateTime<Utc> usage instead of error-prone string parsing
- Proper RFC 5545 compliance with DTSTAMP, SEQUENCE fields
- Vec<AttendeeV2> instead of comma-separated strings
- Structured alarm system with multiple reminder types
- Enhanced RRULE support for complex recurrence patterns

## Code Quality
- Reduced create_event call from 16 parameters to 1 structured request
- Added comprehensive integration plan documentation
- Both backend and frontend compile successfully
- Maintained full backward compatibility during transition

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 17:06:22 -04:00
Connor Johnstone
4af4aafd98 Implement comprehensive theme system with calendar view support
- Add 8 attractive themes (Default, Ocean, Forest, Sunset, Purple, Dark, Rose, Mint)
- Extend theme system to calendar header, month view, and week view components
- Add dynamic theme-aware event color palettes that change with selected theme
- Implement CSS custom properties for consistent theming across all components
- Add localStorage persistence for user theme preferences
- Create theme-aware calendar styling including day states, headers, and grid lines
- Optimize dark theme with proper contrast and readability improvements
- Add reactive event color system that updates when themes change

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 16:42:25 -04:00
Connor Johnstone
81805289e4 Implement complete recurring event drag modification system
- Add recurring edit modal with three modification options:
  • "Only this event" - Creates exception for single occurrence
  • "This and future events" - Splits series from occurrence forward
  • "All occurrences in this series" - Updates entire series time

- Enhance backend update API to support series modifications:
  • Add update_action parameter for recurring event operations
  • Implement time-only updates that preserve original start dates
  • Convert timestamped occurrence UIDs to base UIDs for series updates
  • Preserve recurrence rules during series modifications

- Fix recurring event drag operations:
  • Show modal for recurring events instead of direct updates
  • Handle EXDATE creation for single occurrence modifications
  • Support series splitting with UNTIL clause modifications
  • Maintain proper UID management for different modification types

- Clean up debug logging and restore page refresh for data consistency

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 15:22:34 -04:00
Connor Johnstone
2a2666e75f Implement complete event editing functionality with backend update endpoint
Frontend Changes:
- Add edit context menu option to EventContextMenu with pencil icon
- Enhance CreateEventModal to support both create and edit modes
- Add event data conversion methods for pre-populating edit forms
- Implement conditional submit logic (on_create vs on_update callbacks)
- Add update_event method to CalendarService with POST /calendar/events/update

Backend Changes:
- Add UpdateEventRequest and UpdateEventResponse models
- Implement update_event handler with event search by UID across calendars
- Add POST /api/calendar/events/update route
- Full validation and parsing of all event properties for updates
- Integrate with existing CalDAV client update_event functionality

Users can now right-click events, select "Edit Event", modify properties in the modal, and successfully update existing events instead of creating duplicates.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 09:41:16 -04:00
Connor Johnstone
1b57adab98 Implement complete recurring event deletion with EXDATE and RRULE UNTIL support
Frontend Changes:
- Add DeleteAction enum with DeleteThis, DeleteFollowing, DeleteSeries options
- Update EventContextMenu to show different delete options for recurring events
- Add exception_dates field to CalendarEvent struct
- Fix occurrence generation to respect EXDATE exclusions
- Add comprehensive RRULE parsing with UNTIL date support
- Fix UNTIL date parsing to handle backend format (YYYYMMDDTHHMMSSZ)
- Enhanced debugging for RRULE processing and occurrence generation

Backend Changes:
- Add exception_dates field to CalendarEvent struct with EXDATE parsing/generation
- Implement update_event method for CalDAV client
- Add fetch_event_by_href helper function
- Update DeleteEventRequest model with delete_action and occurrence_date fields
- Implement proper delete_this logic with EXDATE addition
- Implement delete_following logic with RRULE UNTIL modification
- Add comprehensive logging for delete operations

CalDAV Integration:
- Proper EXDATE generation in iCal format for excluded occurrences
- RRULE modification with UNTIL clause for partial series deletion
- Event updating via CalDAV PUT operations
- Full iCal RFC 5545 compliance for recurring event modifications

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 09:18:35 -04:00
Connor Johnstone
e1578ed11c Add calendar selection dropdown and fix multi-calendar event display
- Add calendar selection dropdown to event creation modal
- Update EventCreationData to include selected_calendar field
- Pass available calendars from user info to modal component
- Initialize dropdown with first available calendar as default
- Fix backend to fetch events from ALL calendars, not just the first
- Update refresh_event to search across all calendars
- Events created in any calendar now properly display in UI

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 08:45:40 -04:00
Connor Johnstone
811cceae52 Add weekday selection for weekly recurrence and fix RRULE generation
- Add weekday selection UI for weekly recurring events with checkboxes
- Implement BYDAY parameter generation in RRULE based on selected days
- Fix missing RRULE generation in iCalendar output
- Convert reminder durations to proper EventReminder structs
- Add responsive CSS styling for weekday selection interface

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 22:54:56 -04:00
Connor Johnstone
34461640af Add comprehensive iCal properties support to event creation modal
Enhanced the create event modal to include all major iCalendar properties:
- Event status (confirmed/tentative/cancelled)
- Privacy classification (public/private/confidential)
- Priority levels (0-9 numeric scale)
- Organizer email field
- Attendees list (comma-separated emails)
- Categories (comma-separated tags)
- Reminder options (none to 1 week before)
- Recurrence patterns (none/daily/weekly/monthly/yearly)

Updated backend to parse and handle all new fields, with proper enum conversion
and comma-separated list parsing. Events now generate complete iCal data with
STATUS, CLASS, PRIORITY, ORGANIZER, ATTENDEE, CATEGORIES, VALARM, and RRULE properties.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 22:43:03 -04:00
Connor Johnstone
3440403bed Implement complete event creation functionality with CalDAV backend
- Add CalDAV create_event method with proper iCalendar generation
- Add comprehensive backend API for event creation with validation
- Add event creation models and handlers with date/time parsing
- Add frontend service method for creating events via API
- Update frontend to call backend API instead of placeholder
- Fix CalDAV URL construction to avoid duplicate /dav.php paths
- Support all event fields: title, description, dates, location, all-day

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 22:29:06 -04:00
Connor Johnstone
7e62e3b7e3 Implement event deletion with right-click context menu
- Add EventContextMenu component with delete option
- Create DELETE /api/calendar/events/delete endpoint
- Implement CalDAV event deletion in backend
- Add proper URL construction for CalDAV event hrefs
- Integrate context menu with calendar event right-clicks
- Auto-refresh UI after successful event deletion

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 22:07:09 -04:00
Connor Johnstone
c454104c69 Implement calendar deletion with right-click context menu
Added complete calendar deletion functionality including:
- Context menu component with right-click activation on calendar items
- Backend API endpoint for calendar deletion with CalDAV DELETE method
- Frontend integration with calendar list refresh after deletion
- Fixed URL construction to prevent double /dav.php path issue
- Added proper error handling and user feedback

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 21:31:58 -04:00
Connor Johnstone
f9c87369e5 Implement complete calendar creation functionality
Add full end-to-end calendar creation feature including:
- Create Calendar button in sidebar footer
- Modal form with name, description, and color picker (16 predefined colors in 4x4 grid)
- Form validation and error handling with loading states
- Backend API endpoint for calendar creation with authentication
- CalDAV MKCALENDAR protocol implementation with proper XML generation
- Real-time calendar list refresh after successful creation
- Responsive design for mobile and desktop

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 21:21:30 -04:00
Connor Johnstone
f94d057f81 Implement interactive calendar color picker
Backend enhancements:
- Add calendar_path field to CalendarEvent for color mapping
- Generate consistent colors for calendars using path-based hashing
- Update CalDAV parsing to associate events with their calendar paths
- Add 16-color palette with hash-based assignment algorithm

Frontend features:
- Interactive color picker with 4x4 grid of selectable colors
- Click color swatches to open dropdown with all available colors
- Instant color changes for both sidebar and calendar events
- Persistent color preferences using local storage
- Enhanced UX with hover effects and visual feedback

Styling improvements:
- Larger 16px color swatches for better clickability
- Professional color picker dropdown with smooth animations
- Dynamic event coloring based on calendar assignment
- Improved contrast with text shadows and borders
- Click-outside-to-close functionality for better UX

Users can now personalize their calendar organization with custom colors
that persist across sessions and immediately update throughout the app.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 20:14:56 -04:00
Connor Johnstone
7c83a4522c Add user information and calendar list to sidebar
Backend changes:
- Add /api/user/info endpoint to fetch user details and calendar list
- Create UserInfo and CalendarInfo models for API responses
- Filter out generic calendar collections from sidebar display
- Extract readable calendar names with proper title case formatting

Frontend changes:
- Fetch and display user info (username, server URL) in sidebar header
- Show list of user's calendars with hover effects and styling
- Add loading states and error handling for user info
- Reorganize sidebar layout: header, navigation, calendar list, logout

Styling:
- Enhanced sidebar with user info section and calendar list
- Responsive design hides user info and calendar list on mobile
- Improved logout button positioning in sidebar footer
- Professional styling with proper spacing and visual hierarchy

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 19:58:02 -04:00
Connor Johnstone
d85898cae7 Refactor authentication from database to direct CalDAV authentication
Major architectural change to simplify authentication by authenticating directly against CalDAV servers instead of maintaining a local user database.

Backend changes:
- Remove SQLite database dependencies and user storage
- Refactor AuthService to authenticate directly against CalDAV servers
- Update JWT tokens to store CalDAV server info instead of user IDs
- Implement proper CalDAV calendar discovery with XML parsing
- Fix URL construction for CalDAV REPORT requests
- Add comprehensive debug logging for authentication flow

Frontend changes:
- Add server URL input field to login form
- Remove registration functionality entirely
- Update calendar service to pass CalDAV passwords via headers
- Store CalDAV credentials in localStorage for API calls

Key improvements:
- Simplified architecture eliminates database complexity
- Direct CalDAV authentication ensures credentials always work
- Proper calendar discovery automatically finds user calendars
- Robust error handling and debug logging for troubleshooting

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 18:40:22 -04:00
Connor Johnstone
d945c46e5a Implement real-time event refresh functionality
- Backend: Add GET /api/calendar/events/:uid endpoint for single event refresh
- Backend: Implement fetch_event_by_uid method to retrieve updated events from CalDAV
- Frontend: Add event click callback system to trigger refresh on interaction
- Frontend: Display loading state with orange pulsing animation during refresh
- Frontend: Smart event data updates without full calendar reload
- Frontend: Graceful error handling with fallback to cached data
- CSS: Add refreshing animation for visual feedback during updates

Events now automatically refresh from CalDAV server when clicked, ensuring
users always see the most current event data including changes made in
other calendar applications.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 17:51:30 -04:00
Connor Johnstone
1c4857ccad Add comprehensive reminder/alarm support to calendar events
- Backend: Parse VALARM components from CalDAV iCalendar data
- Backend: Add EventReminder struct with minutes_before, action, and description
- Backend: Support Display, Email, and Audio reminder types
- Backend: Parse ISO 8601 duration triggers (-PT15M, -P1D, etc.)
- Frontend: Add reminders field to CalendarEvent structure
- Frontend: Display reminders in event modal with human-readable formatting
- Frontend: Show reminder timing (15 minutes before, 1 day before) and action type
- Fix: Update Trunk.toml to properly copy CSS files to dist directory

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 17:37:30 -04:00
Connor Johnstone
5b0e84121b Implement complete CalDAV events integration
Added full CalDAV integration to display real calendar events from Baikal server:

Backend changes:
- Added CalDAV client with iCalendar parsing and XML handling
- Created /api/calendar/events endpoint with authentication
- Fixed multiline regex patterns for namespace-prefixed XML tags
- Added proper calendar path discovery and event filtering

Frontend changes:
- Created CalendarService for API communication
- Updated calendar UI to display events as blue boxes with titles
- Added loading states and error handling
- Integrated real-time event fetching on calendar load

Now successfully displays 3 test events from the Baikal server with proper date formatting and responsive design.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 17:03:28 -04:00
Connor Johnstone
b7b351416d Fix all compile warnings in frontend and backend
Removed unused imports, fields, methods, and structs that were generating warnings during compilation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 16:33:07 -04:00
Connor Johnstone
25bf194d19 Implement complete full-stack authentication system
- Restructure project with separate frontend/backend architecture
- Create dedicated backend with Axum, SQLite, JWT authentication
- Implement real API endpoints for register/login/verify
- Update frontend to use HTTP requests instead of mock auth
- Add bcrypt password hashing and secure token generation
- Separate Cargo.toml files for frontend and backend builds
- Fix Trunk compilation by isolating WASM-incompatible dependencies
- Create demo user in database for easy testing
- Both servers running: frontend (8081), backend (3000)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 16:15:37 -04:00