From 366d236900dd460d10a6246b508a9189b84435a9 Mon Sep 17 00:00:00 2001 From: Timon Date: Tue, 5 May 2026 16:04:41 +0000 Subject: [PATCH] Fix missing welcome panel after closing all documents Closing all documents left the Welcome panel as the only tab, but the old active document index could still point to a tab that no longer existed. The fix is to reset it to 0 when the document list becomes empty. --- frontend/src/stores/portfolio.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/stores/portfolio.ts b/frontend/src/stores/portfolio.ts index be3799c9ff..5c838b7e0a 100644 --- a/frontend/src/stores/portfolio.ts +++ b/frontend/src/stores/portfolio.ts @@ -66,6 +66,7 @@ export function createPortfolioStore(subscriptions: SubscriptionsRouter, editor: subscriptions.subscribeFrontendMessage("UpdateOpenDocumentsList", (data) => { update((state) => { state.documents = data.openDocuments; + if (state.documents.length === 0) state.activeDocumentIndex = 0; return state; }); });