diff --git a/memento-note/app/actions/notes.ts b/memento-note/app/actions/notes.ts
index 32f4f4e..a221394 100644
--- a/memento-note/app/actions/notes.ts
+++ b/memento-note/app/actions/notes.ts
@@ -8,6 +8,7 @@ import { getAIProvider } from '@/lib/ai/factory'
import { parseNote, getHashColor } from '@/lib/utils'
import { upsertNoteEmbedding } from '@/lib/embeddings'
import { embeddingService } from '@/lib/ai/services/embedding.service'
+import { chunkIndexingService } from '@/lib/ai/services/chunk-indexing.service'
import { syncNoteLinksForNote } from '@/lib/notes/sync-note-links'
import { getSystemConfig, getConfigNumber, getConfigBoolean, SEARCH_DEFAULTS } from '@/lib/config'
import { contextualAutoTagService } from '@/lib/ai/services/contextual-auto-tag.service'
@@ -458,6 +459,12 @@ export async function createNote(data: {
console.error('[BG] Embedding generation failed:', e)
}
+ try {
+ await chunkIndexingService.indexNote(noteId, data.title, content)
+ } catch (e) {
+ console.error('[BG] Chunk indexing failed:', e)
+ }
+
// Background task 2: Auto-labeling (only if no user labels and has notebook)
if (!hasUserLabels && notebookId) {
try {
@@ -596,6 +603,12 @@ export async function updateNote(id: string, data: {
} catch (e) {
console.error('[BG] Embedding regeneration failed:', e);
}
+
+ try {
+ await chunkIndexingService.indexNote(noteId, title, content);
+ } catch (e) {
+ console.error('[BG] Chunk indexing failed:', e);
+ }
})();
}
diff --git a/memento-note/app/api/clip/save/route.ts b/memento-note/app/api/clip/save/route.ts
index 7cf496d..c1b1858 100644
--- a/memento-note/app/api/clip/save/route.ts
+++ b/memento-note/app/api/clip/save/route.ts
@@ -6,6 +6,7 @@ import { createNotification } from '@/app/actions/notifications'
import { buildClipSourceFooter, clipFooterLocaleTag } from '@/lib/clip/extract-article'
import { resolveClipLocale, wrapClipArticleHtml, applyRtlToHtmlBlocks } from '@/lib/clip/rtl-content'
import { embeddingService } from '@/lib/ai/services/embedding.service'
+import { chunkIndexingService } from '@/lib/ai/services/chunk-indexing.service'
import { upsertNoteEmbedding } from '@/lib/embeddings'
import DOMPurify from 'isomorphic-dompurify'
@@ -92,6 +93,8 @@ export async function POST(request: NextRequest) {
if (embedding?.length) {
await upsertNoteEmbedding(note.id, embedding)
}
+
+ await chunkIndexingService.indexNote(note.id, title || domain, fullContent)
} catch (error) {
console.error('[clip/save] embedding generation failed:', error)
}
diff --git a/memento-note/components/block-action-menu.tsx b/memento-note/components/block-action-menu.tsx
index 8856608..b0e2c0d 100644
--- a/memento-note/components/block-action-menu.tsx
+++ b/memento-note/components/block-action-menu.tsx
@@ -14,8 +14,10 @@ import {
Heading1, Heading2, Heading3, List, ListOrdered,
CheckSquare, Quote, CodeXml, Database,
ArrowUp, ArrowDown, AlignLeft, ClipboardCopy, Sparkles,
+ ChevronsRightLeft,
} from 'lucide-react'
import { replaceBlockWithStructuredView } from '@/components/tiptap-structured-view-block-extension'
+import { insertToggleBlock, turnIntoToggleBlock } from '@/components/tiptap-toggle-extension'
interface BlockActionMenuProps {
editor: Editor
@@ -369,6 +371,14 @@ export function BlockActionMenu({
+ {/* Section repliable */}
+
+
+
+
{/* Création de diagramme */}