From cc7c596d1955eb1f5474496660ab2a178c279ef9 Mon Sep 17 00:00:00 2001 From: Marlon May Date: Fri, 26 Jun 2026 08:16:52 +0200 Subject: [PATCH] fix(planner): correct delete navigation, recurring projection, and load robustness Return to the originating view (not the project list) when deleting a task from the detail overlay, and drop deleted tasks from the planner. Fix recurring projection for long-past start dates, multi-task create dropping tasks, and add loading/error state, load sequencing, drag-listener cleanup, and input clamping. --- frontend/src/i18n/lang/en.json | 1 + frontend/src/stores/tasks.ts | 3 + frontend/src/views/planner/PlannerSidebar.vue | 7 +- frontend/src/views/planner/PlannerView.vue | 53 ++++++++++++--- .../src/views/planner/grid/CalendarBlock.vue | 41 ++++++++---- .../views/planner/grid/CalendarDayColumn.vue | 41 ++++++++---- .../src/views/planner/grid/CalendarGrid.vue | 52 ++++++++++----- .../planner/helpers/expandOccurrences.test.ts | 13 ++++ .../planner/helpers/expandOccurrences.ts | 33 ++++++++-- .../src/views/planner/helpers/taskColor.ts | 10 +++ .../views/planner/helpers/usePlannerTasks.ts | 66 ++++++++++++++++--- frontend/src/views/tasks/TaskDetailView.vue | 9 ++- 12 files changed, 260 insertions(+), 69 deletions(-) create mode 100644 frontend/src/views/planner/helpers/taskColor.ts diff --git a/frontend/src/i18n/lang/en.json b/frontend/src/i18n/lang/en.json index ccaa684b6..bb24504af 100644 --- a/frontend/src/i18n/lang/en.json +++ b/frontend/src/i18n/lang/en.json @@ -763,6 +763,7 @@ "allDay": "All day", "saved": "Saved", "saveError": "Something went wrong saving the task", + "loadError": "Something went wrong loading your tasks", "createTitle": "New task", "createAllDay": "All day · {date}", "sortDefault": "Default order", diff --git a/frontend/src/stores/tasks.ts b/frontend/src/stores/tasks.ts index ac27ff0d2..da4eaaad2 100644 --- a/frontend/src/stores/tasks.ts +++ b/frontend/src/stores/tasks.ts @@ -154,6 +154,7 @@ export const useTaskStore = defineStore('task', () => { const isLoading = ref(false) const draggedTask = ref(null) const lastUpdatedTask = ref(null) + const lastDeletedTask = ref(null) const hasTasks = computed(() => Object.keys(tasks.value).length > 0) @@ -214,6 +215,7 @@ export const useTaskStore = defineStore('task', () => { const taskService = new TaskService() const response = await taskService.delete(task) kanbanStore.removeTaskInBucket(task) + lastDeletedTask.value = task return response } @@ -594,6 +596,7 @@ export const useTaskStore = defineStore('task', () => { isLoading, draggedTask, lastUpdatedTask, + lastDeletedTask, hasTasks, diff --git a/frontend/src/views/planner/PlannerSidebar.vue b/frontend/src/views/planner/PlannerSidebar.vue index 035cf2a73..8e03ed607 100644 --- a/frontend/src/views/planner/PlannerSidebar.vue +++ b/frontend/src/views/planner/PlannerSidebar.vue @@ -78,6 +78,7 @@ import type {PlannerSidebarSort} from './helpers/usePlannerTasks' import FilterPopup from '@/components/project/partials/FilterPopup.vue' import PriorityLabel from '@/components/tasks/partials/PriorityLabel.vue' import {useProjectStore} from '@/stores/projects' +import {plannerTaskColor} from './helpers/taskColor' defineProps<{ tasks: ITask[] @@ -121,11 +122,7 @@ function onDrop(event: DragEvent) { const projectStore = useProjectStore() function taskColor(task: ITask): string { - const hex = projectStore.projects[task.projectId]?.hexColor || task.hexColor - if (!hex) { - return 'var(--primary)' - } - return hex.startsWith('#') ? hex : `#${hex}` + return plannerTaskColor(task.hexColor, projectStore.projects[task.projectId]?.hexColor) } function projectName(task: ITask): string { diff --git a/frontend/src/views/planner/PlannerView.vue b/frontend/src/views/planner/PlannerView.vue index a4b845e4d..c37bad5b2 100644 --- a/frontend/src/views/planner/PlannerView.vue +++ b/frontend/src/views/planner/PlannerView.vue @@ -62,9 +62,22 @@ + + + + {{ $t('planner.loadError') }} + +