From 82ff3b49ff3a34395d483f6cdf350edf45c03e3f Mon Sep 17 00:00:00 2001 From: psavarmattas Date: Sat, 15 Aug 2026 01:10:29 +0100 Subject: [PATCH] fix(settings): force detail pane teardown when opening/closing Settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Opening Settings while a document was pushed left the document visible in the detail pane even though the sidebar correctly switched to the settings list — NavigationSplitView on macOS doesn't reliably replace the detail pane's content on an implicit branch change alone between very different subtrees (a NavigationStack with a real push history vs. a plain view). An explicit .id() keyed to isShowingSettings forces a real teardown/remount; documentPath itself is untouched, so returning via Done still lands back on the same document. --- Outpost/Features/Collections/ContentView_macOS.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Outpost/Features/Collections/ContentView_macOS.swift b/Outpost/Features/Collections/ContentView_macOS.swift index 53b1a8f..5cefa75 100644 --- a/Outpost/Features/Collections/ContentView_macOS.swift +++ b/Outpost/Features/Collections/ContentView_macOS.swift @@ -66,6 +66,14 @@ struct ContentView_macOS: View { .navigationSplitViewColumnWidth(min: 220, ideal: 260) } detail: { detail + // NavigationSplitView on macOS doesn't reliably tear down the + // detail pane's previous content when swapping between very + // different subtrees (a NavigationStack with a document + // pushed vs. plain SettingsView) off an implicit branch + // alone — an explicit identity change forces a real + // teardown/remount instead of it silently leaving the old + // document visible underneath. + .id(navigation.isShowingSettings) } // Empty rather than a real value: with one, the native title rendered // in the same toolbar row as the custom `.navigation` pill below,