From 682f8b71187247144f5a825d9841766dcf1323d4 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Sun, 24 May 2026 19:05:39 +0000 Subject: [PATCH] fix(pdf-upload): correction de l ouverture en double et integration de la colonne d embedding manquante pour DocumentChunk --- memento-note/components/note-attachments.tsx | 5 ++++- memento-note/prisma/schema.prisma | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/memento-note/components/note-attachments.tsx b/memento-note/components/note-attachments.tsx index 5644fcb..f5dfff3 100644 --- a/memento-note/components/note-attachments.tsx +++ b/memento-note/components/note-attachments.tsx @@ -73,8 +73,11 @@ export function NoteAttachments({ noteId, onOpenDocQA, onCountChange, triggerUpl } }, [attachments, fetchAttachments]) + const lastTriggerRef = useRef(0) + useEffect(() => { - if (triggerUpload && triggerUpload > 0) { + if (triggerUpload && triggerUpload > lastTriggerRef.current) { + lastTriggerRef.current = triggerUpload if (attachments.length > 0) { sectionRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' }) } diff --git a/memento-note/prisma/schema.prisma b/memento-note/prisma/schema.prisma index 6106375..61c2115 100644 --- a/memento-note/prisma/schema.prisma +++ b/memento-note/prisma/schema.prisma @@ -683,6 +683,7 @@ model DocumentChunk { startChar Int? endChar Int? metadata String? + embedding Unsupported("vector(1536)")? createdAt DateTime @default(now()) attachment NoteAttachment @relation(fields: [attachmentId], references: [id], onDelete: Cascade)