fix(weekly-view): hide individual scrollbars and fix task creation P2003 error

This commit is contained in:
mARTin 2026-03-05 11:36:17 +01:00
parent 5b95ede85a
commit 5dad5aa492
3 changed files with 51 additions and 29 deletions

View File

@ -10,7 +10,6 @@ datasource db {
model User { model User {
id String @id @default(cuid()) id String @id @default(cuid())
accountNumber Int @unique @default(autoincrement())
email String @unique email String @unique
passwordHash String? passwordHash String?
name String? name String?
@ -77,7 +76,6 @@ model User {
dateAlignment String @default("center") dateAlignment String @default("center")
hourLabelFormat String @default("short") hourLabelFormat String @default("short")
showSubHourSlots Boolean @default(true) showSubHourSlots Boolean @default(true)
dayHeaderGap String? @default("0.75em")
allDayPosition String @default("above") allDayPosition String @default("above")
cwColor String? @default("#333333") cwColor String? @default("#333333")
cwFontFamily String? @default("Oswald") cwFontFamily String? @default("Oswald")
@ -88,15 +86,17 @@ model User {
yearFontSize String? @default("1.5rem") yearFontSize String? @default("1.5rem")
yearFontWeight String? @default("700") yearFontWeight String? @default("700")
showTaskCheckboxes Boolean @default(false) showTaskCheckboxes Boolean @default(false)
emailVerificationCode String?
dayHeaderGap String? @default("0.75em")
accountNumber Int @unique @default(autoincrement())
showCompletedTasks Boolean @default(true) showCompletedTasks Boolean @default(true)
showLines Boolean @default(true) showLines Boolean @default(true)
startDayOffset Int @default(-1) startDayOffset Int @default(-1)
quoteSourceUrls String[] @default([]) quoteSourceUrls String[] @default([])
emailVerificationCode String?
accounts Account[] accounts Account[]
projects Project[]
cachedCalendarEvents CachedCalendarEvent[] cachedCalendarEvents CachedCalendarEvent[]
calendarConnections CalendarConnection[] calendarConnections CalendarConnection[]
projects Project[]
sessions Session[] sessions Session[]
somedayLists SomedayList[] somedayLists SomedayList[]
tasks Task[] tasks Task[]
@ -166,12 +166,12 @@ model Task {
lastSyncedAt DateTime? lastSyncedAt DateTime?
deletedAt DateTime? deletedAt DateTime?
parentTaskId String? parentTaskId String?
projectId String?
somedaySlotIndex Int? somedaySlotIndex Int?
projectId String?
parent Task? @relation("SubTasks", fields: [parentTaskId], references: [id], onDelete: Cascade) parent Task? @relation("SubTasks", fields: [parentTaskId], references: [id], onDelete: Cascade)
subTasks Task[] @relation("SubTasks") subTasks Task[] @relation("SubTasks")
project Project? @relation(fields: [projectId], references: [id])
somedayList SomedayList? @relation(fields: [somedayListId], references: [id]) somedayList SomedayList? @relation(fields: [somedayListId], references: [id])
project Project? @relation(fields: [projectId], references: [id], onDelete: SetNull)
user User @relation(fields: [userId], references: [id], onDelete: Cascade) user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@index([userId, dayOfWeek]) @@index([userId, dayOfWeek])
@ -214,30 +214,30 @@ model CalendarConnection {
} }
model CachedCalendarEvent { model CachedCalendarEvent {
id String @id @default(cuid()) id String @id @default(cuid())
userId String userId String
externalId String externalId String
connectionId String connectionId String
provider String provider String
calendarId String calendarId String
calendarTitle String calendarTitle String
calendarColor String? calendarColor String?
title String title String
description String? description String?
location String? location String?
startDateTime DateTime?
startDate String?
endDateTime DateTime?
endDate String?
weekStart DateTime
syncedAt DateTime @default(now())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
url String? url String?
recurringEventId String? recurringEventId String?
isRecurring Boolean @default(false) isRecurring Boolean @default(false)
startDateTime DateTime? connection CalendarConnection @relation(fields: [connectionId], references: [id], onDelete: Cascade)
startDate String? user User @relation(fields: [userId], references: [id], onDelete: Cascade)
endDateTime DateTime?
endDate String?
weekStart DateTime
syncedAt DateTime @default(now())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
connection CalendarConnection @relation(fields: [connectionId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([userId, externalId, provider]) @@unique([userId, externalId, provider])
@@index([userId, startDateTime]) @@index([userId, startDateTime])

View File

@ -218,6 +218,21 @@ export async function POST(request: NextRequest) {
isRolling = user?.autoRolling || false; isRolling = user?.autoRolling || false;
} }
console.log('API POST - Creating task for user:', userId);
// Safety check: ensure user exists before creation to provide better error
const userExists = await prisma.user.findUnique({
where: { id: userId }
});
if (!userExists) {
console.error('CRITICAL: User ID in session does not exist in database:', userId);
return NextResponse.json(
{ error: 'User does not exist in database. Please log out and back in.' },
{ status: 400 }
);
}
const task = await prisma.task.create({ const task = await prisma.task.create({
data: { data: {
title, title,

View File

@ -601,9 +601,6 @@ h3 {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
min-height: 400px; min-height: 400px;
max-height: calc(100vh - 200px);
overflow-y: auto;
overflow-x: visible;
} }
.weekly-day-column:first-child { .weekly-day-column:first-child {
@ -975,9 +972,19 @@ h3 {
} }
/* Ensure actions don't get clipped by the scrolling container */ /* Ensure actions don't get clipped by the scrolling container */
.time-slots-container { .time-slots-container,
.time-column-slots {
overflow-y: auto; overflow-y: auto;
overflow-x: visible; overflow-x: visible;
scrollbar-width: none;
-ms-overflow-style: none;
}
.time-slots-container::-webkit-scrollbar,
.time-column-slots::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
} }
.dark .time-slot-task > .task-actions { .dark .time-slot-task > .task-actions {