fix: cross-day drag-and-drop + persist showCalendarProviderIcon setting

- Cross-day drag now works: getEventsForSlot uses drag state's current
  start time to assign the dragged event to the correct day column
- Add showCalendarProviderIcon to Prisma schema, profile API GET/PATCH
  so the setting persists across sessions (was frontend-only before)
- DB migration applied via prisma db push

v1.68.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
mARTin 2026-03-24 12:30:42 +01:00
parent 343cc87e4d
commit 13bd90bd2a
4 changed files with 10 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "my-weekly-todo-list", "name": "my-weekly-todo-list",
"version": "1.67.1", "version": "1.68.0",
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view", "description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -25,6 +25,7 @@ model User {
timezone String @default("UTC") timezone String @default("UTC")
autoRolling Boolean @default(false) autoRolling Boolean @default(false)
protectEventTimes Boolean @default(false) protectEventTimes Boolean @default(false)
showCalendarProviderIcon Boolean @default(false)
language String @default("de") language String @default("de")
dateFormat String @default("yyyy-MM-dd") dateFormat String @default("yyyy-MM-dd")
timeFormat String @default("24h") timeFormat String @default("24h")

View File

@ -18,6 +18,7 @@ export async function GET(request: NextRequest) {
timezone: true, timezone: true,
autoRolling: true, autoRolling: true,
protectEventTimes: true, protectEventTimes: true,
showCalendarProviderIcon: true,
language: true, language: true,
dateFormat: true, dateFormat: true,
timeFormat: true, timeFormat: true,
@ -126,7 +127,7 @@ export async function PATCH(request: NextRequest) {
try { try {
const body = await request.json(); const body = await request.json();
const { const {
name, timezone, password, autoRolling, protectEventTimes, name, timezone, password, autoRolling, protectEventTimes, showCalendarProviderIcon,
language, dateFormat, timeFormat, startHour, endHour, language, dateFormat, timeFormat, startHour, endHour,
showNextTask, calendarEditMode, focusTimerDuration, focusBreakDuration, showNextTask, calendarEditMode, focusTimerDuration, focusBreakDuration,
showTimeGrid, showSomeday, showAllDayEvents, showSchedule, showTimeGrid, showSomeday, showAllDayEvents, showSchedule,
@ -156,6 +157,7 @@ export async function PATCH(request: NextRequest) {
...(timezone !== undefined && { timezone }), ...(timezone !== undefined && { timezone }),
...(autoRolling !== undefined && { autoRolling }), ...(autoRolling !== undefined && { autoRolling }),
...(protectEventTimes !== undefined && { protectEventTimes }), ...(protectEventTimes !== undefined && { protectEventTimes }),
...(showCalendarProviderIcon !== undefined && { showCalendarProviderIcon }),
...(language !== undefined && { language }), ...(language !== undefined && { language }),
...(dateFormat !== undefined && { dateFormat }), ...(dateFormat !== undefined && { dateFormat }),
...(timeFormat !== undefined && { timeFormat }), ...(timeFormat !== undefined && { timeFormat }),

View File

@ -3605,11 +3605,11 @@ export default function WeeklyView() {
const isAllDay = isAllDayEvent(event); const isAllDay = isAllDayEvent(event);
if (isAllDay) return false; if (isAllDay) return false;
if (event.title.includes("Valentinstag")) { // During drag, use the drag state's current start time for slot assignment
// Debug removed const isDraggedEvent = eventDragState?.eventId === event.id && eventDragState?.hasMoved && eventDragState?.mode === 'move';
} const startTime = isDraggedEvent ? eventDragState!.currentStartTime : event.startTime;
const eventDate = new Date(event.startTime); const eventDate = new Date(startTime);
if (!isSameDay(eventDate, date)) return false; if (!isSameDay(eventDate, date)) return false;
// Extract hour:minute from event start time and compare with slot // Extract hour:minute from event start time and compare with slot
@ -3625,7 +3625,7 @@ export default function WeeklyView() {
return eventStart >= slotStart && eventStart < slotEnd; return eventStart >= slotStart && eventStart < slotEnd;
}); });
}, },
[calendarEvents, effectiveCellDuration], [calendarEvents, effectiveCellDuration, eventDragState],
); );
// Precompute overlap layout: { [eventId]: { column, totalColumns } } // Precompute overlap layout: { [eventId]: { column, totalColumns } }