diff --git a/Yattee/Views/Components/DataContextSwitcherMenu.swift b/Yattee/Views/Components/DataContextSwitcherMenu.swift index b95d46b7..1b12a344 100644 --- a/Yattee/Views/Components/DataContextSwitcherMenu.swift +++ b/Yattee/Views/Components/DataContextSwitcherMenu.swift @@ -395,6 +395,39 @@ struct DataContextSwitcherMenu: View { #endif +#if os(iOS) +/// The iPad sidebar pill's presentation: just the icon and the current +/// account's name, centered. The pill's placement already says what the +/// control is, so the "Account" caption the settings rows carry is dropped; +/// assistive technology still gets it as the label. +struct DataContextSwitcherSidebarRow: View { + @Environment(\.appEnvironment) private var appEnvironment + + var body: some View { + Menu { + DataContextSwitcherRows() + } label: { + HStack(spacing: 6) { + DataContextSwitcherIcon() + Text(contextTitle) + .lineLimit(1) + .truncationMode(.tail) + } + } + .accessibilityLabel(Text(String(localized: "accounts.switcher.title"))) + .accessibilityValue(Text(contextTitle)) + } + + private var contextTitle: String { + DataContextSwitcherLabels.title(for: currentContext, in: appEnvironment) + } + + private var currentContext: DataContext { + appEnvironment?.accountsManager.currentContext ?? .local + } +} +#endif + /// A settings row naming the current context, with the switcher attached. struct DataContextSwitcherSettingsRow: View { @Environment(\.appEnvironment) private var appEnvironment diff --git a/Yattee/Views/Navigation/UnifiedTabView.swift b/Yattee/Views/Navigation/UnifiedTabView.swift index aa62085d..7312ecc5 100644 --- a/Yattee/Views/Navigation/UnifiedTabView.swift +++ b/Yattee/Views/Navigation/UnifiedTabView.swift @@ -76,10 +76,11 @@ struct UnifiedTabView: View { // The bottom bar pins over the list without a background of its // own, so sidebar rows scrolled to the end show through the // switcher. A pill of its own keeps what's beneath it blurred. - DataContextSwitcherSettingsRow() + DataContextSwitcherSidebarRow() .padding(.horizontal, 14) .padding(.vertical, 10) .sidebarBottomBarPill() + .frame(maxWidth: .infinity) } } .iOS26TabFeatures(shouldShowAccessory: shouldShowAccessory, settingsManager: appEnvironment?.settingsManager)