From 8464d995899c84917aad8d085a967776568748fc Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 3 Jun 2026 07:05:28 -0400 Subject: [PATCH] fix: Intermitent document highlighted (#12566) closes #12554 --- app/stores/UiStore.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/stores/UiStore.ts b/app/stores/UiStore.ts index 3c604a4157..5ecf48c046 100644 --- a/app/stores/UiStore.ts +++ b/app/stores/UiStore.ts @@ -264,6 +264,12 @@ class UiStore { @computed get activeCollectionId(): string | undefined { + // Derive from the active document so it resolves even if the collection + // loads after the document became active. + const activeDocument = this.getPrimaryActiveModel(Document); + if (activeDocument?.isActive && activeDocument.collectionId) { + return activeDocument.collectionId; + } return this.getPrimaryActiveModel(Collection)?.id; }