feat: bloc Toggle/Section repliable + infrastructure embeddings par fragments
Some checks failed
CI / Lint, Unit Tests & Build (push) Failing after 1m33s
CI / Deploy production (on server) (push) Has been skipped

- Nouveau bloc Toggle : sections dépliables dans l'éditeur (slash menu + drag handle)
  - Transformer un bloc existant en section repliable via le menu d'action
  - Boutons désactiver (unwrap) et supprimer dans l'en-tête
  - i18n FR/EN complet
- Infrastructure embeddings par fragments (inspiré AppFlowy)
  - Table NoteEmbeddingChunk + index HNSW
  - Chunking sémantique (~1000 chars, overlap 200, dedup par hash)
  - Indexation incrémentale au save (createNote + updateNote + clip)
  - Queue concurrence 4, retry backoff exponentiel
This commit is contained in:
Antigravity
2026-06-14 16:23:56 +00:00
parent a623454347
commit fccad72d47
7 changed files with 219 additions and 1 deletions

View File

@@ -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)
}