Leave the macOS toolbars to the sidebar's account switcher

This commit is contained in:
Arkadiusz Fal
2026-09-13 20:38:26 +02:00
parent 69d22cdc98
commit f2c4721e5a
4 changed files with 16 additions and 13 deletions

View File

@@ -331,11 +331,15 @@ struct HistoryListView: View {
ToolbarSpacer(.flexible, placement: .primaryAction)
}
#endif
// No switcher on macOS: the sidebar row is the one persistent
// switcher surface there.
#if !os(macOS)
if DataContextSwitcherVisibility.showsPickers(in: appEnvironment) {
ToolbarItem(placement: viewOptionsPlacement) {
DataContextSwitcherMenu()
}
}
#endif
// View options button (always visible)
ToolbarItem(placement: viewOptionsPlacement) {
Button {

View File

@@ -147,17 +147,6 @@ struct HomeView: View {
appEnvironment?.settingsManager.listStyle ?? .inset
}
#if !os(tvOS)
/// Same edge the switcher sits on in Subscriptions/History/Playlists:
/// leading on macOS, trailing elsewhere.
private var switcherPlacement: ToolbarItemPlacement {
#if os(macOS)
.navigation
#else
.primaryAction
#endif
}
#endif
var body: some View {
// Split from `chrome` so the modifier chain stays within what the
@@ -177,9 +166,11 @@ struct HomeView: View {
.toolbarTitleDisplayMode(.inlineLarge)
#endif
.toolbar {
#if !os(tvOS)
// No switcher on macOS: the sidebar row is the one persistent
// switcher surface there.
#if !os(tvOS) && !os(macOS)
if DataContextSwitcherVisibility.showsPickers(in: appEnvironment) {
ToolbarItem(placement: switcherPlacement) {
ToolbarItem(placement: .primaryAction) {
DataContextSwitcherMenu()
}
}

View File

@@ -229,11 +229,15 @@ struct PlaylistsListView: View {
ToolbarSpacer(.flexible, placement: .primaryAction)
}
#endif
// No switcher on macOS: the sidebar row is the one persistent
// switcher surface there.
#if !os(macOS)
if DataContextSwitcherVisibility.showsPickers(in: appEnvironment) {
ToolbarItem(placement: viewOptionsPlacement) {
DataContextSwitcherMenu()
}
}
#endif
ToolbarItem(placement: viewOptionsPlacement) {
Button {
showViewOptions = true

View File

@@ -492,11 +492,15 @@ struct SubscriptionsView: View {
.toolbarTitleDisplayMode(.inlineLarge)
#endif
.toolbar {
// No switcher on macOS: the sidebar row is the one persistent
// switcher surface there.
#if !os(macOS)
if DataContextSwitcherVisibility.showsPickers(in: appEnvironment) {
ToolbarItem(placement: viewOptionsPlacement) {
DataContextSwitcherMenu()
}
}
#endif
ToolbarItem(placement: viewOptionsPlacement) {
Button {
showViewOptions = true