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>
This commit is contained in:
Connor Johnstone
2025-09-01 18:31:51 -04:00
parent e55e6bf4dd
commit 79f287ed61
38 changed files with 3922 additions and 2590 deletions

View File

@@ -1,6 +1,6 @@
use yew::prelude::*;
use web_sys::MouseEvent;
use crate::models::ical::VEvent;
use web_sys::MouseEvent;
use yew::prelude::*;
#[derive(Clone, PartialEq, Debug)]
pub enum DeleteAction {
@@ -30,7 +30,7 @@ pub struct EventContextMenuProps {
#[function_component(EventContextMenu)]
pub fn event_context_menu(props: &EventContextMenuProps) -> Html {
let menu_ref = use_node_ref();
if !props.is_open {
return html! {};
}
@@ -41,7 +41,9 @@ pub fn event_context_menu(props: &EventContextMenuProps) -> Html {
);
// Check if the event is recurring
let is_recurring = props.event.as_ref()
let is_recurring = props
.event
.as_ref()
.map(|event| event.rrule.is_some())
.unwrap_or(false);
@@ -64,9 +66,9 @@ pub fn event_context_menu(props: &EventContextMenuProps) -> Html {
};
html! {
<div
<div
ref={menu_ref}
class="context-menu"
class="context-menu"
style={style}
>
{
@@ -117,4 +119,4 @@ pub fn event_context_menu(props: &EventContextMenuProps) -> Html {
}
</div>
}
}
}