Dismiss tvOS sidebar detail pages when sidebar selection changes

tvOS's sidebarAdaptable TabView leaves the previously-pushed detail view
visible after the user picks another sidebar item, until they manually
press Menu. Broadcast a notification on tab change so any pushed
TVSidebarDetailContainer dismisses itself, and reset each tab's
NavigationPath. Also drop a redundant inner NavigationStack in the tvOS
SettingsView so subpages register on the tab's outer stack.
This commit is contained in:
Arkadiusz Fal
2026-05-08 19:35:36 +02:00
parent 10bd7d09af
commit 5b9cd8c521
3 changed files with 58 additions and 4 deletions

View File

@@ -107,9 +107,8 @@ struct SettingsView: View {
#if os(tvOS)
private var tvOSSettings: some View {
NavigationStack {
List {
if let appEnvironment {
List {
if let appEnvironment {
NavigationLink {
SourcesListView()
} label: {
@@ -201,7 +200,6 @@ struct SettingsView: View {
.allowsHitTesting(false)
}
.accessibilityIdentifier("settings.view")
}
}
#endif