Conversation
…-ios into settings-view
…c is embedded in the tab bar, so we use the same actions
| talkPagePreferencesFooter: WMFLocalizedString("account-talk-preferences-auto-sign-discussions-setting-explanation", value: "Auto-signing of discussions will use the signature defined in Signature settings", comment: "Text explaining how setting the auto-signing of talk page discussions preference works") | ||
| ) | ||
|
|
||
| // Migration: Check if old key exists and migrate to WMFData store |
There was a problem hiding this comment.
Not sure this area for migrating will work - would they have to open the Search settings for the migration to trigger? Just worried they would lose these settings and behavior until they dig into their Settings again. Maybe we can move it into the launch sequence?
|
|
||
|
|
||
| @MainActor | ||
| private func asyncDismissProfile() async { |
There was a problem hiding this comment.
I think this is unused.
| import WMFData | ||
|
|
||
| @objc public class WMFDonateDataControllerWrapper: NSObject { | ||
| @objc public class WMFDonateDataControllerWrapper: NSObject { // TODO - delete |
| // MARK: - ProfileCoordinatorDelegate Methods | ||
|
|
||
| public func handleProfileAction(_ action: ProfileAction) { | ||
| public func handleProfileAction(_ action: ProfileAction) async { |
There was a problem hiding this comment.
This may not need to be async.
| private func profileBarItem(item: ProfileListItem) -> some View { | ||
| Button(action: { | ||
| item.action() | ||
| Task { @MainActor in |
There was a problem hiding this comment.
Might be able to revert if asyncDismissProfile is unused.
| await buildSections() | ||
| } | ||
|
|
||
| private func getMainSection() async -> SettingsSection { |
There was a problem hiding this comment.
I notice all of the accessory labels don't update when you drill in, change, then tap back.
- Tap my languages
- Change primary app language
- Tap back
- My languages label still shows outdated primary app language.
Same goes for Explore feed on/off, Year in Review on/off, and App theme setting.
| item = SettingsItem( | ||
| image: WMFSFSymbolIcon.for(symbol: .personFilled), | ||
| color: WMFColor.gray100, | ||
| title: localizedStrings.accountTitle, |
There was a problem hiding this comment.
This string should say "Log in" if they are logged out.
|
|
||
| // MARK: - Storage and Syncing Settings View | ||
|
|
||
| public struct WMFStorageAndSyncingSettingsView: View { |
There was a problem hiding this comment.
I notice the old StorageAndSyncingSettingsViewController file is still in the project, can we remove?
| case .authorized, .provisional, .ephemeral: | ||
| permissionStatus = .authorized | ||
| // Load subscription status from UserDefaults | ||
| isPushEnabled = userDefaults.bool(forKey: "WMFIsSubscribedToEchoNotifications") |
There was a problem hiding this comment.
(Optional) Maybe let's just set a local immutable property to avoid the same literal string in this file.
private let userDefaultsKey = "WMFIsSubscribedToEchoNotifications"
Bonus would be if we could also migrate this one to the new user defaults store.
|
|
||
| public final class WMFSettingsHostingController: WMFComponentHostingController<WMFSettingsView> {} | ||
|
|
||
| @objc final class SettingsViewController: WMFCanvasViewController, WMFNavigationBarConfiguring, Themeable { |
There was a problem hiding this comment.
Maybe rename so that it's clear in what way this is distinct from the WMFComponents WMFSettingsViewController. I was confused at first.
|
|
||
| // MARK: - About | ||
| private func tappedAbout() { | ||
| dismissSettings { |
There was a problem hiding this comment.
I think About and Help and Feedback pushed on before, now it looks like it's dismissing Settings first before pushing which may be an unexpected change.
|
|
||
| // MARK: - Private methods - Actions | ||
|
|
||
| private func asyncDismissSettings() async { |
There was a problem hiding this comment.
I don't think this is used.
| @objc private func userAuthenticationStateDidChange() { | ||
| Task { @MainActor [weak self] in | ||
| guard let self = self else { return } | ||
|
|
||
| let username = self.dataStore?.authenticationManager.authStatePermanentUsername | ||
| let tempUsername = self.dataStore?.authenticationManager.authStateTemporaryUsername | ||
| let isTempAccount = WMFTempAccountDataController.shared.primaryWikiHasTempAccountsEnabled && | ||
| self.dataStore?.authenticationManager.authStateIsTemporary == true | ||
|
|
||
| await self.viewModel.updateAuthenticationState( | ||
| username: username, | ||
| tempUsername: tempUsername, | ||
| isTempAccount: isTempAccount | ||
| ) | ||
|
|
||
| updateProfileButton() | ||
| } | ||
| } |
There was a problem hiding this comment.
| @objc private func userAuthenticationStateDidChange() { | |
| Task { @MainActor [weak self] in | |
| guard let self = self else { return } | |
| let username = self.dataStore?.authenticationManager.authStatePermanentUsername | |
| let tempUsername = self.dataStore?.authenticationManager.authStateTemporaryUsername | |
| let isTempAccount = WMFTempAccountDataController.shared.primaryWikiHasTempAccountsEnabled && | |
| self.dataStore?.authenticationManager.authStateIsTemporary == true | |
| await self.viewModel.updateAuthenticationState( | |
| username: username, | |
| tempUsername: tempUsername, | |
| isTempAccount: isTempAccount | |
| ) | |
| updateProfileButton() | |
| } | |
| } | |
| @objc private func userAuthenticationStateDidChange() { | |
| let username = dataStore?.authenticationManager.authStatePermanentUsername | |
| let tempUsername = dataStore?.authenticationManager.authStateTemporaryUsername | |
| let isTempAccount = | |
| WMFTempAccountDataController.shared.primaryWikiHasTempAccountsEnabled && | |
| dataStore?.authenticationManager.authStateIsTemporary == true | |
| Task { @MainActor in | |
| guard let self = self else { return } | |
| await self.viewModel.updateAuthenticationState( | |
| username: username, | |
| tempUsername: tempUsername, | |
| isTempAccount: isTempAccount | |
| ) | |
| updateProfileButton() | |
| } | |
| } |
|
|
||
| @objc public static let rateTheAppTitle = WMFLocalizedString("main-menu-rate-app", value: "Rate the app", comment: "Button text for showing the app in the app store so user can rate the app") | ||
|
|
||
| @objc public static let helpAndfeedbackTitle = WMFLocalizedString("settings-help-and-feedback", value: "Help and feedback", comment: "Title for showing showing a screen that displays the FAQ and allows users to submit bug reports") |
There was a problem hiding this comment.
| @objc public static let helpAndfeedbackTitle = WMFLocalizedString("settings-help-and-feedback", value: "Help and feedback", comment: "Title for showing showing a screen that displays the FAQ and allows users to submit bug reports") | |
| @objc public static let helpAndfeedbackTitle = WMFLocalizedString("settings-help-and-feedback", value: "Help and feedback", comment: "Title for showing a screen that displays the FAQ and allows users to submit bug reports") |
| .listRowSeparator(.hidden) | ||
|
|
||
| case .icon: | ||
| Text("") // can't break |
There was a problem hiding this comment.
We can also use EmptyView() for placeholder instead empty text.
Phabricator: https://phabricator.wikimedia.org/T417322
Notes
Test Steps
Screenshots/Videos