From 7e9f1bff1fee348e404cd78e139d6f62231b08b8 Mon Sep 17 00:00:00 2001 From: paul-nothaft <40865108-paul-nothaft@users.noreply.replit.com> Date: Thu, 11 Sep 2025 10:14:09 +0000 Subject: [PATCH] Improve calendar usability and task dragging interactions Adjusted calendar positioning to prevent menu overlap and added visual highlighting for hovered dates during task drag-and-drop, with enhanced styling for weekends. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ceced2fc-aa46-458d-ba87-ddd4b7bb1518 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/659922a9-0087-461c-90dd-6d9a58b81d4d/ceced2fc-aa46-458d-ba87-ddd4b7bb1518/0tPSQjg --- .replit | 4 +++ client/src/components/TasksWithCalendar.tsx | 30 +++++++++++++++------ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.replit b/.replit index 930416a..2a7479f 100644 --- a/.replit +++ b/.replit @@ -14,6 +14,10 @@ run = ["npm", "run", "start"] localPort = 5000 externalPort = 80 +[[ports]] +localPort = 39581 +externalPort = 3001 + [[ports]] localPort = 41353 externalPort = 3000 diff --git a/client/src/components/TasksWithCalendar.tsx b/client/src/components/TasksWithCalendar.tsx index c83677e..90e09ba 100644 --- a/client/src/components/TasksWithCalendar.tsx +++ b/client/src/components/TasksWithCalendar.tsx @@ -131,8 +131,21 @@ export default function TasksWithCalendar({ tasks, onTaskUpdate, onTaskEdit }: T } }; - const handleDragLeave = () => { - setHoveredDate(null); + const handleDragLeave = (e: React.DragEvent) => { + // Only clear hover if we're leaving the calendar entirely + const rect = e.currentTarget.getBoundingClientRect(); + const x = e.clientX; + const y = e.clientY; + + if (x < rect.left || x > rect.right || y < rect.top || y > rect.bottom) { + setHoveredDate(null); + } + }; + + const handleMouseMove = (e: React.MouseEvent, date: Date) => { + if (draggedTask) { + setHoveredDate(date); + } }; const navigateCalendar = (direction: 'prev' | 'next') => { @@ -280,9 +293,9 @@ export default function TasksWithCalendar({ tasks, onTaskUpdate, onTaskEdit }: T )} - {/* Calendar Section - Fixed at bottom with full width */} -