diff --git a/src/worldshaperStudio/toolWindowController.ts b/src/worldshaperStudio/toolWindowController.ts index 927ded9..28ccc8d 100644 --- a/src/worldshaperStudio/toolWindowController.ts +++ b/src/worldshaperStudio/toolWindowController.ts @@ -561,7 +561,20 @@ export function createToolWindowController(scope) { if (!entry) { return; } + const wasVisible = entry.visible === true; + const wasActive = scope.activeSidebarTab === normalizedKey; setActiveTool(normalizedKey); + if (!wasVisible) { + entry.visible = true; + syncPanels(); + persistPanelState(); + return; + } + if (!wasActive) { + syncPanels(); + persistPanelState(); + return; + } toggleEntryVisibility(entry); }