From 65f92ac8d3550367bafda6dc173fc870b1761ad5 Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 18 Feb 2026 21:48:32 +0100 Subject: [PATCH] feat(gantt): update drag/resize to handle partial-date task updates --- frontend/src/components/gantt/GanttChart.vue | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/gantt/GanttChart.vue b/frontend/src/components/gantt/GanttChart.vue index c616549ba..e4a08ad31 100644 --- a/frontend/src/components/gantt/GanttChart.vue +++ b/frontend/src/components/gantt/GanttChart.vue @@ -253,11 +253,23 @@ watch( ) function updateGanttTask(id: string, newStart: Date, newEnd: Date) { - emit('update:task', { + const task = tasks.value.get(Number(id)) + if (!task) return + + const update: ITaskPartialWithId = { id: Number(id), - startDate: roundToNaturalDayBoundary(newStart, true), - endDate: roundToNaturalDayBoundary(newEnd), - }) + } + + // Always set the dates that were dragged/resized + update.startDate = roundToNaturalDayBoundary(newStart, true) + update.endDate = roundToNaturalDayBoundary(newEnd) + + // If the task originally only had dueDate (no endDate), also update dueDate + if (!task.endDate && task.dueDate) { + update.dueDate = roundToNaturalDayBoundary(newEnd) + } + + emit('update:task', update) } function openTask(bar: GanttBarModel) {