fix: 5 bugs critiques de l'éditeur (Phase 1 audit)
1. replaceAll (Find & Replace) — une seule transaction ProseMirror au lieu d'un forEach cassé. Tous les matchs sont maintenant remplacés. 2. Link Preview unwrap — deleteNode() au lieu de clearer les attrs qui laissaient un nœud fantôme invisible dans le document. 3. Conversion Markdown → richtext — breaks: true dans marked.parse() Les simple newlines sont maintenant convertis en <br>. + préserve les blocs custom (toggle, callout, math, columns, outline, link-preview) en commentaires HTML lors de l'export MD. 4. emitNoteChange exercices — shape corrigée (type:'created' attend un objet Note, pas noteId/notebookId séparés). 5. Raccourcis clavier sans conflit : Cmd+Shift+C → Cmd+Alt+C (callout, avant: copier) Cmd+Shift+O → Cmd+Alt+O (outline, avant: historique/signets) Cmd+Shift+L → Cmd+Alt+L (colonnes, avant: lock screen macOS)
This commit is contained in:
@@ -11,7 +11,7 @@ import { embeddingService } from '@/lib/ai/services/embedding.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'
|
||||
import { incrementUsageAsync } from '@/lib/entitlements'
|
||||
import { reserveUsageOrThrow } from '@/lib/entitlements'
|
||||
import { semanticSearchService } from '@/lib/ai/services/semantic-search.service'
|
||||
import { getAISettings } from '@/app/actions/ai-settings'
|
||||
import {
|
||||
@@ -521,7 +521,7 @@ export async function createNote(data: {
|
||||
const merged = [...new Set([...existingNames, ...appliedLabels])]
|
||||
await syncNoteLabels(noteId, merged, notebookId ?? null, userId)
|
||||
// Incrémenter le quota une seule fois par sauvegarde où des labels IA sont appliqués
|
||||
incrementUsageAsync(userId, 'auto_tag')
|
||||
await reserveUsageOrThrow(userId, 'auto_tag')
|
||||
if (!data.skipRevalidation) {
|
||||
revalidatePath('/home')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user