Commit Graph

22 Commits

Author SHA1 Message Date
Connor Johnstone
0453763c98 Make remember checkboxes more subtle and checked by default
- Remember checkboxes now default to checked for better user experience
- Reduced visual prominence with smaller size, lighter colors, and lower opacity
- Users get convenience by default while still being able to opt out

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 19:02:29 -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
51d5552156 Fix modal series editing to use correct backend endpoint
The modal update flow was calling the regular event update endpoint
instead of the series endpoint, preventing proper handling of the
three edit types (this event, this and future, all events).

## Changes:
- Add logic to detect when edit_scope is set for recurring events
- Route to update_series() when edit_scope is present and event has RRULE
- Map EditAction enum to backend update_scope strings:
  - EditThis → "this_only" (creates exception + EXDATE)
  - EditFuture → "this_and_future" (new series + UNTIL on original)
  - EditAll → "all_in_series" (update existing series)
- Pass occurrence date for single/future edits using original event date
- Fall back to regular update_event() for non-recurring events

Now the modal properly leverages the existing robust series endpoint
that handles RFC 5545 compliant recurring event modifications.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-31 19:06:11 -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
ed458e6c3a Implement complete Docker Compose CI/CD setup with optimized builds
- Add multi-stage Dockerfile with dependency caching for both frontend and backend
- Implement Docker Compose configuration with separate frontend/backend services
- Configure Caddy as reverse proxy with proper WASM and static file serving
- Add volume mounting for frontend assets shared between containers
- Optimize build process with staged compilation and workspace handling
- Add debug logging and WASM initialization tracking for production deployment
- Update README with project motivation and "vibe coded" disclaimer

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-31 17:54:44 -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
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
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
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
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
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