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

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