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

View File

@ -218,6 +218,21 @@ export async function POST(request: NextRequest) {
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({
data: {
title,

View File

@ -601,9 +601,6 @@ h3 {
display: flex;
flex-direction: column;
min-height: 400px;
max-height: calc(100vh - 200px);
overflow-y: auto;
overflow-x: visible;
}
.weekly-day-column:first-child {
@ -975,9 +972,19 @@ h3 {
}
/* Ensure actions don't get clipped by the scrolling container */
.time-slots-container {
.time-slots-container,
.time-column-slots {
overflow-y: auto;
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 {