From 753cda96613c83593721921533533ceb73e92ce0 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Tue, 15 Sep 2026 09:02:18 +0200 Subject: [PATCH] Label the local context by where its data actually lives "Yattee (iCloud)" was hardcoded for the local data context even with iCloud sync disabled, when the data is purely on-device. The name now comes from DataContextValidator.localContextName, which checks iCloudSyncEnabled and falls back to "Yattee (This Device)". --- Yattee/Localizable.xcstrings | 10 ++++++++++ .../Subscriptions/DataContextValidator.swift | 13 +++++++++++-- .../Views/Components/DataContextSwitcherMenu.swift | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Yattee/Localizable.xcstrings b/Yattee/Localizable.xcstrings index 7f0e98dc..edb4f494 100644 --- a/Yattee/Localizable.xcstrings +++ b/Yattee/Localizable.xcstrings @@ -18439,6 +18439,16 @@ } } }, + "subscriptions.account.local.device" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Yattee (This Device)" + } + } + } + }, "subscriptions.account.pipedInstance %@" : { "localizations" : { "en" : { diff --git a/Yattee/Services/Subscriptions/DataContextValidator.swift b/Yattee/Services/Subscriptions/DataContextValidator.swift index 7249de36..b03409bf 100644 --- a/Yattee/Services/Subscriptions/DataContextValidator.swift +++ b/Yattee/Services/Subscriptions/DataContextValidator.swift @@ -259,16 +259,25 @@ final class DataContextValidator { func displayName(for context: DataContext) -> String { switch context { case .local: - return String(localized: "subscriptions.account.local") + return localContextName case let .account(id): guard let account = accountsManager.account(id: id) else { - return String(localized: "subscriptions.account.local") + return localContextName } return displayName(for: account) } } + /// "(iCloud)" only when the data actually syncs; otherwise it lives on + /// this device alone and the label says so. + var localContextName: String { + if appEnvironment?.settingsManager.iCloudSyncEnabled == true { + return String(localized: "subscriptions.account.local") + } + return String(localized: "subscriptions.account.local.device") + } + /// User-set label, else whatever the account falls back to. func displayName(for account: Account) -> String { if let name = account.displayName, !name.isEmpty { return name } diff --git a/Yattee/Views/Components/DataContextSwitcherMenu.swift b/Yattee/Views/Components/DataContextSwitcherMenu.swift index 7fbc18d5..57b5d1cb 100644 --- a/Yattee/Views/Components/DataContextSwitcherMenu.swift +++ b/Yattee/Views/Components/DataContextSwitcherMenu.swift @@ -99,7 +99,7 @@ enum DataContextSwitcherLabels { /// The context's name, plus whatever the user needs to tell it apart. @MainActor static func title(for context: DataContext, in appEnvironment: AppEnvironment?) -> String { - guard let appEnvironment else { return String(localized: "subscriptions.account.local") } + guard let appEnvironment else { return String(localized: "subscriptions.account.local.device") } return title( for: context,