Optimize all-day event layout rendering

Improves event removal and layout recalculation process

Enhances event removal by:
- Filtering out removed event
- Recalculating event layouts dynamically
- Re-rendering events with compressed layout
- Animating container height accordingly

Reduces visual gaps and improves layout responsiveness
This commit is contained in:
Janus C. H. Knudsen 2025-11-11 20:23:51 +01:00
parent 1011513b52
commit 7cda973f59

View file

@ -128,7 +128,17 @@ export class AllDayManager {
console.log('🔄 AllDayManager: All-day → timed conversion', { eventId });
// Mark for removal (sets data-removing attribute)
this.fadeOutAndRemove(dragEndPayload.originalElement);
// Recalculate layout WITHOUT the removed event to compress gaps
const remainingEvents = this.currentAllDayEvents.filter(e => e.id !== eventId);
const newLayouts = this.calculateAllDayEventsLayout(remainingEvents, this.currentWeekDates);
// Re-render all-day events with compressed layout
this.allDayEventRenderer.renderAllDayEventsForPeriod(newLayouts);
// NOW animate height with compressed layout
this.checkAndAnimateAllDayHeight();
}
});