diff --git a/memento-note/app/actions/notes.ts b/memento-note/app/actions/notes.ts index e3bfeb6..c822258 100644 --- a/memento-note/app/actions/notes.ts +++ b/memento-note/app/actions/notes.ts @@ -472,7 +472,7 @@ export async function createNote(data: { const autoLabelingEnabled = userAISettings.autoLabeling !== false const autoLabelingConfidence = await getConfigNumber('AUTO_LABELING_CONFIDENCE_THRESHOLD', 70) - console.log('[BG] Auto-labeling check: enabled=', autoLabelingEnabled, 'confidence=', autoLabelingConfidence, 'notebookId=', notebookId) + // console.log('[BG] Auto-labeling check: enabled=', autoLabelingEnabled, 'confidence=', autoLabelingConfidence, 'notebookId=', notebookId) if (autoLabelingEnabled) { // Detect user's language from their existing notes for localized prompts @@ -497,7 +497,7 @@ export async function createNote(data: { userLang ) - console.log('[BG] Auto-labeling suggestions:', suggestions.length, suggestions.map(s => s.label)) + // console.log('[BG] Auto-labeling suggestions:', suggestions.length, suggestions.map(s => s.label)) const appliedLabels = suggestions .filter(s => s.confidence >= autoLabelingConfidence) @@ -531,7 +531,7 @@ export async function createNote(data: { console.error('[BG] Auto-labeling failed:', error) } } else { - console.log('[BG] Auto-labeling skipped: hasUserLabels=', hasUserLabels, 'notebookId=', notebookId) + // console.log('[BG] Auto-labeling skipped: hasUserLabels=', hasUserLabels, 'notebookId=', notebookId) } })().catch(e => console.error('[BG] Uncaught background error:', e)) @@ -632,14 +632,14 @@ export async function updateNote(id: string, data: { updateData.contentUpdatedAt = new Date() } - console.log('[updateNote] Attempting update, id:', id, 'userId:', session.user.id) + // console.log('[updateNote] Attempting update, id:', id, 'userId:', session.user.id) let note try { note = await prisma.note.update({ where: { id, userId: session.user.id }, data: updateData }) - console.log('[updateNote] Succeeded, note id:', note?.id) + // console.log('[updateNote] Succeeded, note id:', note?.id) } catch (dbError: any) { console.error('[updateNote] FAILED:', dbError.code, dbError.message) throw dbError @@ -693,7 +693,7 @@ export async function updateNote(id: string, data: { const structuralFields = ['isPinned', 'isArchived', 'labels', 'notebookId'] const isStructuralChange = structuralFields.some(field => field in data) - console.log('[updateNote] Structural check — data fields:', Object.keys(data), '| isStructural:', isStructuralChange) + // console.log('[updateNote] Structural check — data fields:', Object.keys(data), '| isStructural:', isStructuralChange) if (!options?.skipRevalidation) { try { revalidatePath(`/note/${id}`) } catch {} diff --git a/memento-note/components/chart-suggestions-dialog.tsx b/memento-note/components/chart-suggestions-dialog.tsx index 39c9503..bcec087 100644 --- a/memento-note/components/chart-suggestions-dialog.tsx +++ b/memento-note/components/chart-suggestions-dialog.tsx @@ -53,7 +53,7 @@ export function ChartSuggestionsDialog({ suggestCharts({ content, selection, noteId }) .then(data => { if (aborted) return - console.log('[ChartSuggestionsDialog] Response:', data) + // [debug removed — was logging user content] setResponse(data) setLoading(false) }) diff --git a/memento-note/components/rich-text-editor.tsx b/memento-note/components/rich-text-editor.tsx index fa9747d..5eabdc5 100644 --- a/memento-note/components/rich-text-editor.tsx +++ b/memento-note/components/rich-text-editor.tsx @@ -595,6 +595,7 @@ export const RichTextEditor = forwardRef { + // Debounce getHTML() — it's expensive on long notes emitContentChange(e.getHTML()) if (!e.isEditable) return const { from, empty } = e.state.selection @@ -857,7 +858,7 @@ export const RichTextEditor = forwardRef