Add chat thread forking
TestFlight / Build and upload (push) Successful in 1m52s

This commit is contained in:
2026-08-16 17:42:39 -07:00
parent 42022bf055
commit eb2b0d3ca0
17 changed files with 1410 additions and 244 deletions
@@ -0,0 +1,5 @@
-- Add durable root grouping and one-time fork title generation state.
ALTER TABLE "Chat" ADD COLUMN "parentChatId" TEXT REFERENCES "Chat"("id") ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE "Chat" ADD COLUMN "titleGenerationPending" BOOLEAN NOT NULL DEFAULT false;
CREATE INDEX "Chat_parentChatId_idx" ON "Chat"("parentChatId");
+8 -1
View File
@@ -51,7 +51,8 @@ model Chat {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String?
title String?
titleGenerationPending Boolean @default(false)
initiatedProvider Provider?
initiatedModel String?
@@ -64,11 +65,17 @@ model Chat {
user User? @relation(fields: [userId], references: [id])
userId String?
// Forks always point directly to the single root chat, never to another fork.
parentChat Chat? @relation("ChatForks", fields: [parentChatId], references: [id], onDelete: Cascade)
parentChatId String?
childChats Chat[] @relation("ChatForks")
messages Message[]
calls LlmCall[]
projectItems ProjectItem[]
@@index([userId])
@@index([parentChatId])
}
model Message {