mirror of
https://github.com/yattee/yattee.git
synced 2026-11-02 18:07:19 +00:00
Put the account switcher where the data is, and retire the old setting
Switching accounts was buried in Subscriptions settings behind a picker and a confirmation dialog, and it wrote two stores that could disagree. One shared switcher now sits in the Subscriptions and Playlists toolbars, the macOS sidebar footer and the Settings root, and every path goes through AppEnvironment.switchDataContext(to:) so a switch behaves the same wherever it is made. Switching is one tap: it is reversible, so there is nothing to confirm. Rows come from DataContextValidator.availableContexts, name themselves through displayName(for:), and carry a status suffix when the account is not signed in — plus the instance host when two accounts share a name. tvOS gets the same rows as a full-screen picker. Subscriptions also explains itself when the selected account cannot answer: a thin banner names the cause and says the data below is local. This is the first consumer of the validator's unavailability, and correctIfContextRemoved() now runs on foreground activation, where SubscriptionAccountValidator used to auto-correct any selection it could not immediately verify. With the switcher reading the context directly, the legacy subscriptionAccount setting has no readers left: the setting, its validator, the mirror that kept it in step and the feed cache's instance-keyed fallbacks all go. The cache invalidation the mirror also carried stays, under its own name. AccountsManager still reads the raw legacy key for the one-way context migration.
This commit is contained in:
@@ -293,6 +293,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"accounts.switcher.title" : {
|
||||
"comment" : "Label of the control that switches the selected account",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Account"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"accounts.useThisAccount" : {
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
@@ -17961,6 +17972,72 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"subscriptions.banner.checking" : {
|
||||
"comment" : "Banner shown while the selected account cannot be used yet",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Waiting for iCloud before your account can be used. Showing local data."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"subscriptions.banner.credentialMissing" : {
|
||||
"comment" : "Banner shown while the selected account cannot be used yet",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Sign in to this account on this device to see its data. Showing local data."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"subscriptions.banner.credentialRejected" : {
|
||||
"comment" : "Banner shown while the selected account cannot be used yet",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "This account needs to be signed in again. Showing local data."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"subscriptions.banner.instanceDisabled" : {
|
||||
"comment" : "Banner shown while the selected account cannot be used yet",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "This account's source is switched off. Showing local data."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"subscriptions.banner.instancePending" : {
|
||||
"comment" : "Banner shown while the selected account cannot be used yet",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "This account's source has not arrived from iCloud yet. Showing local data."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"subscriptions.banner.unreachable" : {
|
||||
"comment" : "Banner shown while the selected account cannot be used yet",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "This account's server could not be reached. Showing local data."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"subscriptions.channels.empty" : {
|
||||
"comment" : "Empty state for channels",
|
||||
"localizations" : {
|
||||
|
||||
Reference in New Issue
Block a user