Commit Graph

82 Commits

Author SHA1 Message Date
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
d0aa6fda08 Fix critical weekly recurring event BYDAY rendering bug
This commit resolves a significant bug where weekly recurring events with multiple selected days (BYDAY parameter) were only displaying the first 2 chronologically selected days instead of all selected days.

## Root Cause:
The `next_weekday_occurrence` function was designed for single-occurrence processing, causing it to:
- Find the first matching weekday in the current week
- Return immediately, skipping subsequent selected days
- Repeat this pattern across weeks, showing only the same first day repeatedly

## Solution:
- **New Function**: `generate_weekly_byday_occurrences()` handles multiple days per week
- **Week-by-Week Processing**: Generates events for ALL selected weekdays in each interval
- **Comprehensive Logic**: Properly handles INTERVAL, COUNT, UNTIL, and EXDATE constraints
- **Performance Optimized**: More efficient than single-occurrence iteration

## Technical Details:
- Replaced linear occurrence processing with specialized weekly BYDAY handler
- Added comprehensive debug logging for troubleshooting
- Maintains full RFC 5545 RRULE compliance
- Preserves existing functionality for non-BYDAY weekly events

## Expected Result:
Users creating weekly recurring events with multiple days (e.g., Mon/Wed/Fri/Sat) will now see events appear on ALL selected days in each week interval, not just the first two.

Example: "Every week on Mon, Wed, Fri, Sat" now correctly generates 4 events per week instead of just Monday events.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 23:32:21 -04:00
Connor Johnstone
62c39b8aa5 Implement comprehensive RRULE-based recurrence system with conditional UI
This commit introduces a complete RFC 5545-compliant recurrence management system that extends the event creation modal with sophisticated recurring event capabilities.

## New Features:

### Conditional Recurrence UI:
- **Interval Support**: "Every N days/weeks/months/years" with dynamic pluralization
- **End Conditions**: Never/Until date/After N occurrences with radio button interface
- **Weekly Options**: Enhanced weekday selection with existing checkbox interface
- **Monthly Options**: Choose between day-of-month (1-31) or positioned weekdays ("First Monday", "Last Friday")
- **Yearly Options**: Month selection grid allowing multiple months per year

### RRULE Parser & Generator:
- **Comprehensive Parser**: Handles FREQ, INTERVAL, BYDAY, BYMONTHDAY, BYMONTH, UNTIL, COUNT parameters
- **Smart Field Population**: Existing recurring events properly populate all recurrence fields from RRULE
- **RFC 5545 Compliance**: Full compliance with iCalendar recurrence specification
- **Round-trip Accuracy**: Parse → Edit → Generate produces identical RRULE

### Enhanced Data Model:
- **Extended EventCreationData**: Added 6 new fields for advanced recurrence options
- **Type Safety**: Strong typing with validation and bounds checking
- **Efficient Parsing**: Single-pass RRULE parsing with optimized data structures

### Professional Styling:
- **Responsive Design**: Mobile-friendly layout with proper spacing and grid systems
- **Visual Hierarchy**: Clean organization with grouped sections and proper labeling
- **User Experience**: Smart defaults, mutual exclusion logic, and intuitive workflows

## Technical Implementation:

### RRULE Examples:
- **Weekly**: `FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,WE,FR;COUNT=10`
- **Monthly**: `FREQ=MONTHLY;BYDAY=1MO;UNTIL=20241231T000000Z`
- **Yearly**: `FREQ=YEARLY;BYMONTH=3,5;INTERVAL=2`

### Test Coverage:
- **7 Test Cases**: Complete coverage of parsing, building, and transformation logic
- **Edge Cases**: Empty values, positioning logic, format validation
- **Integration Tests**: End-to-end RRULE round-trip verification

This implementation provides enterprise-grade recurrence management while maintaining backward compatibility with existing simple recurrence patterns. Users can now create and edit sophisticated recurring events with full fidelity to RFC 5545 standards.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 23:12:06 -04:00
Connor Johnstone
75eddcf85d Remove all user-facing emojis and improve modal styling
This commit enhances the professional appearance of the calendar application by removing all user-facing emojis while preserving debug logging functionality. Additionally, includes modal layout and styling improvements for better usability.

## Changes Made:

### Emoji Removal:
- **Event creation modal tabs**: Removed emojis from all 6 tab buttons (📅 Basic Details → Basic Details, etc.)
- **Modal content**: Removed emojis from alarm types, attachment types, pattern examples, and completion status
- **Theme picker**: Removed emojis from all 8 theme options (🌊 Ocean → Ocean, etc.)
- **Context menus**: Removed emojis from event context menu (edit/delete actions) and calendar context menu

### Modal Styling Improvements:
- **Width expansion**: Increased modal max-width from 500px to 900px (80% wider)
- **Enhanced padding**: Added more padding to modal header (2rem 3rem 1.5rem) and tab content areas
- **Responsive design**: Improved mobile adjustments while maintaining desktop experience
- **Checkbox fix**: Override width inheritance for "All Day" checkbox with auto width and inline-block display

### Form Layout Enhancement:
- **Field reordering**: Moved Repeat and Reminder options above date/time pickers for better workflow
- **Visual consistency**: Maintained clean, professional appearance throughout the interface

The application now presents a clean, professional interface suitable for business environments while retaining full functionality. Debug logging with emojis is preserved for development purposes.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 22:45:10 -04:00
Connor Johnstone
0babfc90f4 Implement comprehensive tabbed event creation modal with full VEvent support
Transform the basic event creation modal into a professional 6-tab interface
exposing all major RFC 5545 VEvent properties with enhanced UX:

• Basic Details: Essential fields (title, calendar, dates, location, basic recurrence/reminders)
• Advanced: Status, priority, classification, extended reminders/recurrence
• People: Organizer and attendee management with validation
• Categories: Interactive tagging system with quick-add buttons
• Location: Enhanced location handling with common shortcuts and geo features preview
• Reminders: Comprehensive alarm configuration with attachment features preview

Features:
- Complete RFC 5545 compliance throughout all tabs
- Interactive elements: 30+ clickable tags and quick-action buttons
- Professional styling with full theme compatibility (including dark mode)
- Mobile-responsive design with optimized layouts
- Educational content explaining calendar system capabilities
- Smooth tab navigation with active state management
- Form validation and smart defaults
- Future-proof extensible architecture

Technical implementation:
- Type-safe Rust/Yew state management with proper event handling
- Modular tab-based architecture for maintainability
- Performance optimized with efficient state updates
- JsCast integration for proper DOM element handling
- Comprehensive CSS with theme variants and responsive breakpoints

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 22:13:05 -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
b9e8778f8f Fix this_only concurrent request cancellation issue
Resolves the same "Failed to fetch" cancellation issue that was occurring
in the "modify single event in a series" flow by eliminating concurrent
HTTP requests from the frontend.

## Problem:
The RecurringEditAction::ThisEvent handler was making two concurrent requests:
1. UPDATE request via update_callback.emit()
2. CREATE request via create_callback.emit()

This caused the same race condition and HTTP cancellation (~700-900ms) that
we previously fixed in the "this_and_future" flow.

## Solution:
- **Remove concurrent CREATE request** from frontend
- **Use single UPDATE request** with "this_only" scope
- **Backend handles both operations** atomically:
  1. Add EXDATE to original series (exclude occurrence)
  2. Create exception event with RECURRENCE-ID (user modifications)

## Implementation:
- Frontend sends single request with occurrence_date and dragged times
- Backend update_single_occurrence() already handled both operations
- Added comprehensive RFC 5545 documentation for single occurrence modification
- Cleaned up unused imports and variables

## Benefits:
- No more HTTP request cancellation for single event modifications
- Proper RFC 5545 EXDATE + RECURRENCE-ID exception handling
- Atomic operations ensure data consistency
- Matches the pattern used in this_and_future fix

The "modify single event" drag operations now work reliably without
network errors, completing the fix for all recurring event modification flows.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 20:29:02 -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
663b322d97 Complete frontend migration to shared VEvent model
- Update frontend to use shared calendar-models library
- Add display methods to VEvent for UI compatibility
- Remove duplicate VEvent definitions in frontend
- Fix JSON field name mismatch (dtstart/dtend vs start/end)
- Create CalendarEvent type alias for backward compatibility
- Resolve "missing field start" parsing error

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 11:58:37 -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
6887e0b389 Fix create event functionality with proper timezone conversion
- Add UTC conversion to EventCreationData.to_create_event_params() method
- Restore app.rs event creation callback using existing create_event API
- Convert local datetime inputs to UTC before sending to backend
- Fix time format from HH:MM:SS to HH:MM as expected by server

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 20:01:10 -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
9f2f58e23e Fix recurring event positioning by removing CSS positioning conflict
- Remove conflicting `position: relative` CSS rule for .week-event
- This was causing `top: XXXpx` values to be applied as relative offsets
  instead of absolute positioning from container top
- Recurring events now position correctly at their calculated times
- Both regular and recurring events display at proper grid positions

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 14:16:14 -04:00
Connor Johnstone
53ea5e3fc1 Fix time snapping for event drag operations in week view
- Apply snapping to final event position after accounting for click offset
- Ensure preview position matches snapped final position
- Maintain time increment alignment during drag operations
- Fix scope issue for time_increment in mouseup handler

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 13:12:12 -04:00
Connor Johnstone
d35fc11267 Fix drag positioning to accurately follow mouse cursor in week view
- Fix coordinate system mismatch between event clicks and drag preview
- Convert event-relative coordinates to day-column-relative coordinates
- Add movement threshold to prevent accidental drag updates on clicks
- Ensure dragged events maintain proper offset from click position

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 13:09:25 -04:00
Connor Johnstone
697eb64dd4 Add event resize functionality with drag handles in week view
- Extend DragType enum to support ResizeEventStart and ResizeEventEnd operations
- Add visual resize handles at top/bottom edges of events for left-click resizing
- Implement start time resize by dragging top handle (preserves end time)
- Implement end time resize by dragging bottom handle (preserves start time)
- Add visual feedback with resizing event preview during drag operations
- Integrate resize operations with existing CalDAV update system
- Add CSS styling for resize handles with hover effects and resize cursors
- Maintain minimum 15-minute event duration during resize operations
- Preserve context menu functionality while preventing conflicts during drag
- Clean up code by removing experimental right-click drag functionality

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 12:54:45 -04:00
Connor Johnstone
d36609d8c2 Implement drag-to-move functionality for events in week view with CalDAV server integration
- Add drag-to-move event handlers to existing events in week view
- Extend drag state management to support both create and move operations
- Implement visual feedback with event preview during drag and hidden original
- Calculate new start/end times while preserving event duration
- Add CalDAV server update integration via calendar service
- Wire event update callbacks through component hierarchy (WeekView → Calendar → RouteHandler → App)
- Preserve all original event properties (title, description, location, reminders, etc.)
- Handle timezone conversion from local to UTC for server storage
- Add error handling with user feedback and success confirmation
- Include moving event CSS styling with enhanced visual feedback

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 12:36:29 -04:00
Connor Johnstone
e23278d71e Implement fixed-height month view rows with event overflow handling
- Change calendar grid to use equal row heights instead of min-height on cells
- Add "+n more" indicator for days with too many events to display
- Limit visible events to fit available space (default 3 events per day)
- Add window resize handler to recalculate event limits dynamically
- Remove gaps between calendar rows for cleaner appearance

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 12:27:24 -04:00
Connor Johnstone
edd209238f Add configurable time increment toggle for event creation
- Add toggle button (15/30 minutes) in calendar header next to navigation arrows
- Implement circular frosted styling consistent with nav buttons
- Add configurable snapping for drag-to-create events in week view
- Persist time increment setting across browser sessions using localStorage
- Update snap function to accept configurable increment instead of hardcoded 15 minutes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 12:17:31 -04:00
Connor Johnstone
4fbef8a5dc Fix context menu click-outside behavior to prevent underlying actions
When a context menu is open, clicking outside should only close the menu
without triggering underlying actions (like drag-to-create in week view).

Implementation:
- Enhanced global click handler to prevent default actions when menus are open
- Added context menu state propagation through component hierarchy
- Modified interactive components to check context menu state before acting
- Provides double protection at both global and component levels

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 11:58:17 -04:00
Connor Johnstone
edb216347d Fix event calendar change to use delete + create instead of update
When changing an event's calendar, the system now properly handles this as:
- Delete the event from the original calendar
- Create a new event in the target calendar

This ensures proper CalDAV compliance and prevents issues with cross-calendar updates.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 11:47:45 -04:00
Connor Johnstone
508c4f129f Fix drag-to-create event bugs and improve week view UX
- Restrict drag-to-create to left-click only (ignore right-clicks)
- Prevent drag-to-create when clicking on existing events
- Remove unnecessary right-click context menu from week view empty spaces

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 11:43:03 -04:00
Connor Johnstone
1c0140292f Complete drag-to-create event functionality with proper timezone handling
Integrate drag-to-create functionality with the full event creation pipeline:

- Connect WeekView drag events to CreateEventModal via callback chain
- Add event creation request callback through Calendar → RouteHandler → App
- Implement proper timezone conversion throughout the entire flow
- Fix pixels_to_time calculation (1px = 1 minute, not complex formula)
- Add initial_start_time/initial_end_time props to CreateEventModal
- Convert local times to UTC in both event creation and update functions
- Ensure modal displays correct local times while backend receives UTC
- Support both temporary drag events and real server events in modal

The complete flow now works: drag selection → modal with correct times →
proper UTC conversion → backend storage → correct display in calendar.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 11:33:14 -04:00
Connor Johnstone
53815c4814 Add 15-minute snapping and time display to drag-to-create functionality
Enhance the drag-to-create event feature with precision improvements:

- Add snap_to_15_minutes() function to align drag coordinates to 15-minute increments
- Update mousedown and mousemove handlers to use coordinate snapping
- Replace pixel coordinate display with actual time ranges in temporary event box
- Display times in 12-hour format with AM/PM (e.g., "2:15 PM - 3:30 PM")
- Remove unused wasm_bindgen::JsCast import for cleaner code

Users can now create events that automatically align to 15-minute boundaries with clear visual feedback showing the exact time range being selected.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 11:04:13 -04:00
Connor Johnstone
df714a43a2 Implement drag-to-create event functionality in week view
Add interactive drag-to-create event functionality that allows users to click and drag in empty spaces of the week view to create new events. Features include:

- Mouse event handlers for drag interaction (mousedown, mousemove, mouseup)
- Real-time temporary event box display with visual feedback during drag
- Proper coordinate calculation using layer_y() for accurate time positioning
- Minimum 15-minute event duration enforcement
- Integration with event creation modal via callback with pre-filled start/end times
- CSS pointer-events optimizations to prevent child element interference
- Time-to-pixel and pixel-to-time conversion functions for accurate positioning

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 11:00:32 -04:00
Connor Johnstone
a8bb2c8164 Implement comprehensive calendar UX improvements
- Add time range display to week view events showing "start - end" format
- Optimize time display with smart AM/PM formatting to reduce redundancy
- Fix context menu overlap by adding stop_propagation to event handlers
- Implement persistent view mode (Month/Week) across page refreshes using localStorage
- Replace month-based tracking with intelligent selected date tracking
- Add day selection in month view with visual feedback and click handlers
- Fix view switching to navigate to week containing selected day, not first week of month
- Separate selected_date from display_date for proper context switching
- Simplify week view header to show "Month Year" instead of "Week of Month Day"
- Add backward compatibility for existing localStorage keys

Greatly improves calendar navigation and user experience with persistent state

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 10:44:44 -04:00
Connor Johnstone
5d0628878b Implement accurate time-based event positioning in week view
- Add calculate_event_position() function to convert UTC times to pixel coordinates
- Position events based on actual start/end times with 60px per hour scaling
- Handle timezone conversion from UTC to local time for proper display
- Implement dynamic event heights that stretch from start to end time
- Add special handling for all-day events positioned at top of day columns
- Create enhanced event display with title and formatted time information
- Style all-day events distinctly with gradient background and italic text
- Filter events to show only those belonging to specific dates
- Add CSS styling for event titles, times, and all-day event appearance
- Support minimum 20px height for very short events and multi-day capping

Events now render at their correct times making week view much more useful for scheduling

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 10:31:09 -04:00
Connor Johnstone
dacc18fe5d Implement time-based week view with scrollable 24-hour layout
- Add comprehensive time grid structure with hourly and half-hourly divisions
- Implement scrollable week view with sticky header and time labels
- Create 25 time labels (12 AM through 11 PM plus boundary) with proper formatting
- Add 25 matching time slot backgrounds for visual alignment
- Style time labels with appropriate sizing and boundary indicators
- Position events absolutely over time grid (basic positioning for now)
- Set proper container heights and scrollable content area

Note: Time slot alignment still needs refinement for complete 24-hour coverage

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 10:27:24 -04:00
Connor Johnstone
9ab6377d16 Refactor calendar component into modular architecture with view switching
- Split monolithic Calendar component into focused sub-components:
  - CalendarHeader: Navigation buttons and title display
  - MonthView: Monthly calendar grid layout and event rendering
  - WeekView: Weekly calendar view with full-height day containers
- Add ViewMode enum for Month/Week view switching in sidebar dropdown
- Fix event styling by correcting CSS class from "event" to "event-box"
- Implement proper week view layout with full-height day containers
- Maintain all existing functionality: event handling, context menus, localStorage persistence

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 10:14:53 -04:00
Connor Johnstone
197157cecb Persist calendar month across page refreshes using localStorage
- Load saved month from localStorage on calendar initialization
- Fall back to current date if no saved month exists
- Save current month to localStorage on all navigation actions:
  - Previous month navigation
  - Next month navigation
  - Today button clicks
- Use YYYY-MM-DD format for localStorage storage
- Maintain month view after page refreshes from event creation/editing
- Preserve user's selected month during manual browser refreshes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 09:51:21 -04:00
Connor Johnstone
c273a8625a Add 'Today' button to calendar header for quick navigation to current month
- Add go_to_today callback that navigates to first day of current month
- Position Today button between month title and next month arrow
- Center month/year title using absolute positioning
- Group Today button and next arrow in header-right container with 0.5rem gap
- Style Today button with pill shape, semi-transparent background, and hover effects
- Add responsive styling for mobile screens with smaller text and padding
- Maintain clean, balanced header layout on all screen sizes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 09:48:36 -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
7a53228ec8 Added readme 2025-08-29 08:36:23 -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