From c81d9e1aabe8ea1693502b6699963724d31cac8f Mon Sep 17 00:00:00 2001 From: Arnaud Bellemare Date: Fri, 10 Jul 2026 00:23:15 -0400 Subject: [PATCH] Make Ask Loci toggle work outside the workspace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The toolbar button, option-command-I menu item, and command palette action post lociToggleNotebookInspector, whose only listener lives inside ChatWorkspaceView — a view that exists only while Ask Loci is already open, so the controls silently did nothing elsewhere. Listen at the shell level and enter the workspace the way the sidebar row does; inside Ask Loci the existing listener still toggles the chat panel. Co-Authored-By: Claude Fable 5 --- Sources/Loci/ContentView.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Sources/Loci/ContentView.swift b/Sources/Loci/ContentView.swift index f899deb..d81cac7 100644 --- a/Sources/Loci/ContentView.swift +++ b/Sources/Loci/ContentView.swift @@ -133,6 +133,19 @@ struct LociShell: View { isShowingCommandPalette = true } } + .onReceive(NotificationCenter.default.publisher(for: .lociToggleNotebookInspector)) { _ in + // ChatWorkspaceView owns this toggle while Ask Loci is open; + // from every other filter it has no listener, so enter the + // workspace the same way the sidebar row does. + guard store.selectedFilter != .chat else { return } + UserDefaults.standard.set(true, forKey: "LociNotebookInspectorVisible") + var transaction = Transaction() + transaction.animation = nil + transaction.disablesAnimations = true + withTransaction(transaction) { + store.selectedFilter = .chat + } + } .onAppear { DispatchQueue.main.asyncAfter(deadline: .now() + 0.20) { store.warmCommonReferenceFilters()