From 960d269ca2037464d74a10613a831733448cf673 Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Tue, 21 Apr 2026 16:55:12 +0200 Subject: [PATCH] fix(schedule): deduplicate @for track key for split event segments Split projections (RepeatProjectionSplit, SplitTaskContinued, and related types) share the underlying task/repeat-cfg id across their visual segments, producing NG0955 duplicate-key warnings in the week-view grid. Combine id, plannedForDay, and startHours so each segment has a unique track key and Angular can reconcile views cleanly. --- .../schedule/schedule-week/schedule-week.component.html | 4 ++-- .../schedule/schedule-week/schedule-week.component.ts | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/app/features/schedule/schedule-week/schedule-week.component.html b/src/app/features/schedule/schedule-week/schedule-week.component.html index 591f8b3ee4..98f99de9f7 100644 --- a/src/app/features/schedule/schedule-week/schedule-week.component.html +++ b/src/app/features/schedule/schedule-week/schedule-week.component.html @@ -93,7 +93,7 @@ } - @for (ev of safeEvents(); track ev.id) { + @for (ev of safeEvents(); track trackEventKey(ev)) { @if (isDraggableSE(ev)) { hourglass_disabled {{ beyondBudgetDay.length }} - @for (ev of beyondBudgetDay; track ev.id) { + @for (ev of beyondBudgetDay; track trackEventKey(ev)) { @if (isDraggableSE(ev)) { this.events() || []); safeBeyondBudget = computed(() => this.beyondBudget() || []); + // Split projections (RepeatProjectionSplit, SplitTaskContinued, …) share the + // task/repeat-cfg id across segments. Combine day + start hour so each visual + // segment has a unique @for track key and Angular can reconcile them. + trackEventKey(ev: ScheduleEvent): string { + return `${ev.id}_${ev.plannedForDay ?? ''}_${ev.startHours}`; + } + newTaskPlaceholder = signal<{ style: string; time: string;