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>
This commit is contained in:
Connor Johnstone
2025-08-28 17:51:30 -04:00
parent 1c4857ccad
commit d945c46e5a
7 changed files with 178 additions and 5 deletions

View File

@@ -192,6 +192,17 @@ impl CalDAVClient {
Ok(events)
}
/// Fetch a single calendar event by UID from the CalDAV server
pub async fn fetch_event_by_uid(&self, calendar_path: &str, uid: &str) -> Result<Option<CalendarEvent>, CalDAVError> {
// First fetch all events and find the one with matching UID
let events = self.fetch_events(calendar_path).await?;
// Find event with matching UID
let event = events.into_iter().find(|e| e.uid == uid);
Ok(event)
}
/// Extract calendar data sections from CalDAV XML response
fn extract_calendar_data(&self, xml_response: &str) -> Vec<CalendarDataSection> {
let mut sections = Vec::new();