From 0babfc90f4e953365db23111a0a52719f581272f Mon Sep 17 00:00:00 2001 From: Connor Johnstone Date: Sat, 30 Aug 2025 22:13:05 -0400 Subject: [PATCH] Implement comprehensive tabbed event creation modal with full VEvent support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- frontend/src/components/create_event_modal.rs | 1191 +++++++++++++---- frontend/styles.css | 1046 +++++++++++++++ 2 files changed, 1974 insertions(+), 263 deletions(-) diff --git a/frontend/src/components/create_event_modal.rs b/frontend/src/components/create_event_modal.rs index cb4ba0f..dd5655f 100644 --- a/frontend/src/components/create_event_modal.rs +++ b/frontend/src/components/create_event_modal.rs @@ -1,5 +1,6 @@ use yew::prelude::*; use web_sys::{HtmlInputElement, HtmlTextAreaElement, HtmlSelectElement}; +use wasm_bindgen::JsCast; use chrono::{NaiveDate, NaiveTime, Local, TimeZone, Utc}; use crate::services::calendar_service::CalendarInfo; use crate::models::ical::VEvent; @@ -238,9 +239,26 @@ impl EventCreationData { } +#[derive(Clone, PartialEq)] +enum ModalTab { + BasicDetails, + Advanced, + People, + Categories, + Location, + Reminders, +} + +impl Default for ModalTab { + fn default() -> Self { + ModalTab::BasicDetails + } +} + #[function_component(CreateEventModal)] pub fn create_event_modal(props: &CreateEventModalProps) -> Html { let event_data = use_state(|| EventCreationData::default()); + let active_tab = use_state(|| ModalTab::default()); // Initialize with selected date or event data if provided use_effect_with((props.selected_date, props.event_to_edit.clone(), props.is_open, props.available_calendars.clone(), props.initial_start_time, props.initial_end_time), { @@ -554,6 +572,14 @@ pub fn create_event_modal(props: &CreateEventModalProps) -> Html { }) }; + // Tab switching callbacks + let switch_to_tab = { + let active_tab = active_tab.clone(); + Callback::from(move |tab: ModalTab| { + active_tab.set(tab); + }) + }; + let data = &*event_data; html! { @@ -568,273 +594,912 @@ pub fn create_event_modal(props: &CreateEventModalProps) -> Html {