From 71a2cdbb28a90ebe362602e7775332a2554dc13b Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 2 Mar 2026 10:31:12 +0100 Subject: [PATCH] fix(gantt): update relation arrows in real-time during drag and resize --- frontend/src/components/gantt/GanttChart.vue | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/gantt/GanttChart.vue b/frontend/src/components/gantt/GanttChart.vue index b6714a353..f162f226d 100644 --- a/frontend/src/components/gantt/GanttChart.vue +++ b/frontend/src/components/gantt/GanttChart.vue @@ -339,14 +339,30 @@ const ROW_HEIGHT = 40 const barPositions = computed(() => { const positions = new Map() + const ds = dragState.value + const dragPixelOffset = ds ? ds.currentDays * DAY_WIDTH_PIXELS : 0 ganttBars.value.forEach((rowBars, rowIndex) => { for (const bar of rowBars) { const taskId = Number(bar.id) - const x = computeBarX(bar.start) - const width = computeBarWidth(bar) + let x = computeBarX(bar.start) + let width = computeBarWidth(bar) const y = rowIndex * ROW_HEIGHT + ROW_HEIGHT / 2 + // Apply drag/resize offset for the active bar + if (ds && bar.id === ds.barId && dragPixelOffset !== 0) { + if (isDragging.value) { + x += dragPixelOffset + } else if (isResizing.value) { + if (ds.edge === 'start') { + x += dragPixelOffset + width -= dragPixelOffset + } else { + width += dragPixelOffset + } + } + } + positions.set(taskId, {x, y, width, rowIndex}) } })