From c3927c85f81c9ac20a77e9302543bbd3fe0063ec Mon Sep 17 00:00:00 2001 From: Till JS Date: Sat, 21 Mar 2026 11:05:15 +0100 Subject: [PATCH] fix(calendar): use 1-hour default duration for grid click instead of 15 minutes The click-to-create handler was using SNAP_INTERVAL_MINUTES (15) as the initial event duration. Now uses DEFAULT_EVENT_DURATION_MINUTES (60) to match the configured default. Drag behavior still uses snap interval. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../apps/web/src/lib/composables/useDragToCreate.svelte.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/calendar/apps/web/src/lib/composables/useDragToCreate.svelte.ts b/apps/calendar/apps/web/src/lib/composables/useDragToCreate.svelte.ts index 2276b9f7e..411feefa3 100644 --- a/apps/calendar/apps/web/src/lib/composables/useDragToCreate.svelte.ts +++ b/apps/calendar/apps/web/src/lib/composables/useDragToCreate.svelte.ts @@ -3,7 +3,10 @@ * Handles click-and-drag on the calendar grid to create new events */ -import { SNAP_INTERVAL_MINUTES } from '$lib/utils/calendarConstants'; +import { + SNAP_INTERVAL_MINUTES, + DEFAULT_EVENT_DURATION_MINUTES, +} from '$lib/utils/calendarConstants'; export interface DragToCreateConfig { containerEl: HTMLElement | null; @@ -95,7 +98,7 @@ export function useDragToCreate(getConfig: () => DragToCreateConfig) { hasMoved = false; createTargetDay = day; createStartMinutes = snappedMinutes; - createEndMinutes = snappedMinutes + snap; + createEndMinutes = snappedMinutes + DEFAULT_EVENT_DURATION_MINUTES; updatePreview();