From 2b98c4d229cb25a5f1f819054fd90729d24ceffc Mon Sep 17 00:00:00 2001 From: Connor Johnstone Date: Wed, 3 Sep 2025 15:39:15 -0400 Subject: [PATCH] Hide event time display for single-slot events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hide time display for events with duration <= 30px (single time slots) to maximize space for event titles in compact event boxes. - Single-slot events show title only for better readability - Applies to both 15-minute and 30-minute time increment modes - Consistent behavior across static events and drag previews - Improves UX for short duration events where time display crowds the title 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- frontend/src/components/week_view.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/week_view.rs b/frontend/src/components/week_view.rs index 45c9c4d..e147de7 100644 --- a/frontend/src/components/week_view.rs +++ b/frontend/src/components/week_view.rs @@ -915,7 +915,7 @@ pub fn week_view(props: &WeekViewProps) -> Html { // Event content
{event.summary.as_ref().unwrap_or(&"Untitled".to_string())}
- {if !is_all_day { + {if !is_all_day && duration_pixels > 30.0 { html! {
{time_display}
} } else { html! {} @@ -985,7 +985,11 @@ pub fn week_view(props: &WeekViewProps) -> Html { style={format!("top: {}px; height: {}px; background-color: {}; opacity: 0.7;", preview_position, duration_pixels, event_color)} >
{event.summary.as_ref().unwrap_or(&"Untitled".to_string())}
-
{format!("{} - {}", new_start_time.format("%I:%M %p"), new_end_time.format("%I:%M %p"))}
+ {if duration_pixels > 30.0 { + html! {
{format!("{} - {}", new_start_time.format("%I:%M %p"), new_end_time.format("%I:%M %p"))}
} + } else { + html! {} + }}
} }, @@ -1014,7 +1018,11 @@ pub fn week_view(props: &WeekViewProps) -> Html { style={format!("top: {}px; height: {}px; background-color: {}; opacity: 0.7;", new_start_pixels, new_height, event_color)} >
{event.summary.as_ref().unwrap_or(&"Untitled".to_string())}
-
{format!("{} - {}", new_start_time.format("%I:%M %p"), original_end.time().format("%I:%M %p"))}
+ {if new_height > 30.0 { + html! {
{format!("{} - {}", new_start_time.format("%I:%M %p"), original_end.time().format("%I:%M %p"))}
} + } else { + html! {} + }} } }, @@ -1037,7 +1045,11 @@ pub fn week_view(props: &WeekViewProps) -> Html { style={format!("top: {}px; height: {}px; background-color: {}; opacity: 0.7;", original_start_pixels, new_height, event_color)} >
{event.summary.as_ref().unwrap_or(&"Untitled".to_string())}
-
{format!("{} - {}", original_start.time().format("%I:%M %p"), new_end_time.format("%I:%M %p"))}
+ {if new_height > 30.0 { + html! {
{format!("{} - {}", original_start.time().format("%I:%M %p"), new_end_time.format("%I:%M %p"))}
} + } else { + html! {} + }} } }