fix(settings): force detail pane teardown when opening/closing Settings
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.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user