Add Continue Watching toggle to sidebar settings

Exposes ContinueWatchingView as an opt-in main sidebar item,
hidden by default.
This commit is contained in:
Arkadiusz Fal
2026-04-17 21:22:25 +02:00
parent 2761fcbcfb
commit c0184712a9
4 changed files with 65 additions and 3 deletions

View File

@@ -38,6 +38,7 @@ struct UnifiedTabView: View {
@State private var settingsPath = NavigationPath()
@State private var openURLPath = NavigationPath()
@State private var remoteControlPath = NavigationPath()
@State private var continueWatchingPath = NavigationPath()
// Current selection - initial value is a placeholder; actual startup tab is applied in onAppear
@State private var selection: SidebarItem = .home
@@ -233,6 +234,16 @@ struct UnifiedTabView: View {
} label: {
Label(SidebarItem.remoteControl.title, systemImage: SidebarItem.remoteControl.systemImage)
}
case .continueWatching:
Tab(value: SidebarItem.continueWatching) {
NavigationStack(path: $continueWatchingPath) {
ContinueWatchingView()
.withNavigationDestinations()
}
} label: {
Label(SidebarItem.continueWatching.title, systemImage: SidebarItem.continueWatching.systemImage)
}
}
}
@@ -356,6 +367,7 @@ struct UnifiedTabView: View {
@State private var settingsPath = NavigationPath()
@State private var openURLPath = NavigationPath()
@State private var remoteControlPath = NavigationPath()
@State private var continueWatchingPath = NavigationPath()
// Current selection - initial value is a placeholder; actual startup tab is applied in onAppear
@State private var selection: SidebarItem = .home
@@ -529,6 +541,16 @@ struct UnifiedTabView: View {
} label: {
Label(SidebarItem.remoteControl.title, systemImage: SidebarItem.remoteControl.systemImage)
}
case .continueWatching:
Tab(value: SidebarItem.continueWatching) {
NavigationStack(path: $continueWatchingPath) {
ContinueWatchingView()
.withNavigationDestinations()
}
} label: {
Label(SidebarItem.continueWatching.title, systemImage: SidebarItem.continueWatching.systemImage)
}
}
}
@@ -608,6 +630,7 @@ struct UnifiedTabView: View {
@State private var settingsPath = NavigationPath()
@State private var openURLPath = NavigationPath()
@State private var remoteControlPath = NavigationPath()
@State private var continueWatchingPath = NavigationPath()
// Current selection - initial value is a placeholder; actual startup tab is applied in onAppear
@State private var selection: SidebarItem = .home
@@ -811,6 +834,16 @@ struct UnifiedTabView: View {
} label: {
Label(SidebarItem.remoteControl.title, systemImage: SidebarItem.remoteControl.systemImage)
}
case .continueWatching:
Tab(value: SidebarItem.continueWatching) {
NavigationStack(path: $continueWatchingPath) {
ContinueWatchingView()
.withNavigationDestinations()
}
} label: {
Label(SidebarItem.continueWatching.title, systemImage: SidebarItem.continueWatching.systemImage)
}
}
}
@@ -928,6 +961,8 @@ extension UnifiedTabView {
openURLPath.append(destination)
case .remoteControl:
remoteControlPath.append(destination)
case .continueWatching:
continueWatchingPath.append(destination)
}
navigationCoordinator?.clearPendingNavigation()
}