From 89d2ffad469e8b3ee56c16289f3092a9f0a68d87 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Sun, 28 Jun 2026 10:02:33 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20emitNoteChange=20apr=C3=A8s=20enableNote?= =?UTF-8?q?History=20=E2=80=94=20carte=20se=20met=20=C3=A0=20jour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit enableNoteHistory() mettait à jour la DB mais ne notifiait pas la home page. L'éditeur fetch la note à jour (historyEnabled=true) → icône visible. La home gardait les données en cache (historyEnabled=false) → pas d'icône. Fix: emitNoteChange({ type: 'updated', note: { ...note, historyEnabled: true } }) dispatché après les 2 points d'appel dans note-document-info-panel.tsx. --- memento-note/components/note-document-info-panel.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/memento-note/components/note-document-info-panel.tsx b/memento-note/components/note-document-info-panel.tsx index da577dc..629008a 100644 --- a/memento-note/components/note-document-info-panel.tsx +++ b/memento-note/components/note-document-info-panel.tsx @@ -16,6 +16,7 @@ import { NoteHistoryModal } from './note-history-modal' import { NoteNetworkTab } from './note-network-tab' import { NoteEditorPropertiesPanel } from './structured-views/note-editor-properties-panel' import { enableNoteHistory, commitNoteHistory, getNoteHistory, deleteNoteHistoryEntry, restoreNoteVersion } from '@/app/actions/notes' +import { emitNoteChange } from '@/lib/note-change-sync' import { useEffect } from 'react' type Tab = 'info' | 'versions' | 'network' @@ -332,6 +333,7 @@ export function NoteDocumentInfoPanel({ note, content, onClose, onNoteRestored } await enableNoteHistory(note.id) setHistoryEnabled(true) setShowHistory(true) + emitNoteChange({ type: 'updated', note: { ...note, historyEnabled: true } }) }} > {t('documentInfo.enableHistory')} @@ -481,6 +483,7 @@ export function NoteDocumentInfoPanel({ note, content, onClose, onNoteRestored } onEnableHistory={async () => { await enableNoteHistory(note.id) setHistoryEnabled(true) + emitNoteChange({ type: 'updated', note: { ...note, historyEnabled: true } }) }} onRestored={(restored) => { setShowHistory(false)