From 00f66cfb496fc087a75130e571bbdb7211f238c1 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 10 Mar 2026 18:22:09 +0200 Subject: [PATCH] fix(popup_editor): note content no longer rendering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit f44b47ec added a hasTabBeenActive guard in NoteDetail that defers rendering until the tab has been active at least once. It initializes via noteContext?.isActive() and then listens for activeNoteChanged events. The popup editor creates its own NoteContext("_popup-editor") which is never the activeNtxId in the tab manager — isActive() always returns false, and activeNoteChanged never fires for it. So hasTabBeenActive stays false forever, and the if (!type || !hasTabBeenActive) return guard at NoteDetail.tsx:64 prevents the note type widget from ever loading. --- apps/client/src/widgets/NoteDetail.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/client/src/widgets/NoteDetail.tsx b/apps/client/src/widgets/NoteDetail.tsx index a466af7d77..ea43851359 100644 --- a/apps/client/src/widgets/NoteDetail.tsx +++ b/apps/client/src/widgets/NoteDetail.tsx @@ -41,7 +41,9 @@ export default function NoteDetail() { const hasFixedTree = note && noteContext?.hoistedNoteId === "_lbMobileRoot" && isMobile() && note.noteId.startsWith("_lbMobile"); // Defer loading for tabs that haven't been active yet (e.g. on app refresh). - const [ hasTabBeenActive, setHasTabBeenActive ] = useState(() => noteContext?.isActive() ?? false); + // Special contexts (ntxId starting with "_", e.g. popup editor) are always considered active. + const isSpecialContext = ntxId?.startsWith("_") ?? false; + const [ hasTabBeenActive, setHasTabBeenActive ] = useState(() => isSpecialContext || (noteContext?.isActive() ?? false)); useEffect(() => { if (!hasTabBeenActive && noteContext?.isActive()) { setHasTabBeenActive(true);