Editing Series Events via the Modal #5

Merged
connor merged 2 commits from feature/modal-series-editing into main 2025-08-31 19:10:27 -04:00
Owner

Implement Comprehensive Event Series Editing via Modal

🎯 Overview

Adds robust recurring event editing through the event modal with three distinct update types: "Edit This Event", "Edit This and Future Events", and "Edit All Events in Series". This provides a user-friendly alternative to drag-and-drop for comprehensive field editing of
recurring events.

Features

Smart Context Menu

  • Non-recurring events: Shows single "Edit Event" option
  • Recurring events: Shows three granular options:
    • 📝 "Edit This Event" - Modify only the clicked occurrence
    • ⏭️ "Edit This and Future Events" - Modify from this occurrence forward
    • 🔄 "Edit All Events in Series" - Modify the entire recurring series

Comprehensive Field Editing

  • Edit any field in the event (title, description, time, location, status, etc.)
  • Field change tracking for optimization (infrastructure in place)
  • Proper timezone handling and validation
  • Full integration with existing modal UI

RFC 5545 Compliant Backend

  • "This Event" → Creates exception event + adds EXDATE to original series
  • "This and Future" → Creates new series from date + adds UNTIL to original
  • "All Events" → Updates existing series in-place
  • Leverages existing robust /series/update endpoint with proper CalDAV sync

🔧 Technical Implementation

Frontend Changes

  • EditAction enum with three edit types
  • Enhanced EventCreationData with edit_scope and changed_fields tracking
  • Smart endpoint routing: series endpoint for recurring, regular endpoint for non-recurring
  • Automatic EditAction → backend scope mapping
  • Proper occurrence date handling for single/future edits

Backend Enhancements

  • Added changed_fields parameter to UpdateEventSeriesRequest for future optimization
  • Existing series endpoint already handles all three update scenarios correctly
  • Full RRULE, EXDATE, and UNTIL support with proper CalDAV synchronization

🛠️ Key Technical Details

Endpoint Routing Logic

let use_series_endpoint = updated_data.edit_scope.is_some() && original_event.rrule.is_some();

let update_scope = match updated_data.edit_scope.unwrap() {
EditAction::EditThis => "this_only",
EditAction::EditFuture => "this_and_future",
EditAction::EditAll => "all_in_series",
};

Action Mapping

  • EditThis → "this_only" → Exception with EXDATE
  • EditFuture → "this_and_future" → New series + UNTIL
  • EditAll → "all_in_series" → In-place update

🧪 Testing Notes

  • Frontend and backend compile successfully
  • Proper fallback to regular endpoint for non-recurring events
  • Consistent with existing drag-and-drop series editing behavior
  • All three edit types route to correct backend logic

🔄 Backward Compatibility

  • Non-recurring events work exactly as before
  • Existing drag-and-drop series editing unchanged
  • Regular event updates use same endpoint as before
  • No breaking changes to existing workflows

🚀 User Experience

  1. Right-click any recurring event
  2. Choose appropriate edit scope based on intent
  3. Make comprehensive changes in familiar modal interface
  4. Submit → Backend handles complex RFC 5545 operations automatically
  5. Calendar refreshes with changes applied correctly

This implementation provides the comprehensive recurring event editing experience users expect while maintaining full CalDAV compliance and leveraging the existing robust backend infrastructure.

Implement Comprehensive Event Series Editing via Modal 🎯 Overview Adds robust recurring event editing through the event modal with three distinct update types: "Edit This Event", "Edit This and Future Events", and "Edit All Events in Series". This provides a user-friendly alternative to drag-and-drop for comprehensive field editing of recurring events. ✨ Features Smart Context Menu - Non-recurring events: Shows single "Edit Event" option - Recurring events: Shows three granular options: - 📝 "Edit This Event" - Modify only the clicked occurrence - ⏭️ "Edit This and Future Events" - Modify from this occurrence forward - 🔄 "Edit All Events in Series" - Modify the entire recurring series Comprehensive Field Editing - Edit any field in the event (title, description, time, location, status, etc.) - Field change tracking for optimization (infrastructure in place) - Proper timezone handling and validation - Full integration with existing modal UI RFC 5545 Compliant Backend - "This Event" → Creates exception event + adds EXDATE to original series - "This and Future" → Creates new series from date + adds UNTIL to original - "All Events" → Updates existing series in-place - Leverages existing robust /series/update endpoint with proper CalDAV sync 🔧 Technical Implementation Frontend Changes - EditAction enum with three edit types - Enhanced EventCreationData with edit_scope and changed_fields tracking - Smart endpoint routing: series endpoint for recurring, regular endpoint for non-recurring - Automatic EditAction → backend scope mapping - Proper occurrence date handling for single/future edits Backend Enhancements - Added changed_fields parameter to UpdateEventSeriesRequest for future optimization - Existing series endpoint already handles all three update scenarios correctly - Full RRULE, EXDATE, and UNTIL support with proper CalDAV synchronization 🛠️ Key Technical Details Endpoint Routing Logic let use_series_endpoint = updated_data.edit_scope.is_some() && original_event.rrule.is_some(); let update_scope = match updated_data.edit_scope.unwrap() { EditAction::EditThis => "this_only", EditAction::EditFuture => "this_and_future", EditAction::EditAll => "all_in_series", }; Action Mapping - EditThis → "this_only" → Exception with EXDATE - EditFuture → "this_and_future" → New series + UNTIL - EditAll → "all_in_series" → In-place update 🧪 Testing Notes - ✅ Frontend and backend compile successfully - ✅ Proper fallback to regular endpoint for non-recurring events - ✅ Consistent with existing drag-and-drop series editing behavior - ✅ All three edit types route to correct backend logic 🔄 Backward Compatibility - Non-recurring events work exactly as before - Existing drag-and-drop series editing unchanged - Regular event updates use same endpoint as before - No breaking changes to existing workflows 🚀 User Experience 1. Right-click any recurring event 2. Choose appropriate edit scope based on intent 3. Make comprehensive changes in familiar modal interface 4. Submit → Backend handles complex RFC 5545 operations automatically 5. Calendar refreshes with changes applied correctly This implementation provides the comprehensive recurring event editing experience users expect while maintaining full CalDAV compliance and leveraging the existing robust backend infrastructure.
connor added 2 commits 2025-08-31 19:09:58 -04:00
## 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>
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>
connor merged commit 1fa3bf44b6 into main 2025-08-31 19:10:27 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: connor/calendar#5
No description provided.