From 6954d23ebf4ee72bfc1e8554a1bfc64255b0e80c Mon Sep 17 00:00:00 2001 From: Doug Date: Wed, 30 Oct 2024 09:46:41 +0000 Subject: [PATCH 1/6] Enable the Optimised Media Uploads feature. (Well move the toggle from Developer Options to Advanced Settings) --- .../AdvancedSettingsScreenModels.swift | 2 ++ .../View/AdvancedSettingsScreen.swift | 11 ++++++++++- .../DeveloperOptionsScreenModels.swift | 1 - .../View/DeveloperOptionsScreen.swift | 6 ------ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenModels.swift b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenModels.swift index 35f0e8148e..1809eab8e1 100644 --- a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenModels.swift @@ -32,6 +32,8 @@ protocol AdvancedSettingsProtocol: AnyObject { var viewSourceEnabled: Bool { get set } var appAppearance: AppAppearance { get set } var sharePresence: Bool { get set } + + var optimizeMediaUploads: Bool { get set } } extension AppSettings: AdvancedSettingsProtocol { } diff --git a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift index 17436c310a..626e0d1494 100644 --- a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift +++ b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift @@ -18,13 +18,22 @@ struct AdvancedSettingsScreen: View { kind: .picker(selection: $context.appAppearance, items: AppAppearance.allCases.map { (title: $0.name, tag: $0) })) - ListRow(label: .plain(title: L10n.actionViewSource), + ListRow(label: .plain(title: L10n.actionViewSource, + description: L10n.screenAdvancedSettingsViewSourceDescription), kind: .toggle($context.viewSourceEnabled)) ListRow(label: .plain(title: L10n.screenAdvancedSettingsSharePresence, description: L10n.screenAdvancedSettingsSharePresenceDescription), kind: .toggle($context.sharePresence)) } + + Section { + ListRow(label: .plain(title: L10n.screenAdvancedSettingsMediaCompressionDescription), + kind: .toggle($context.optimizeMediaUploads)) + } header: { + Text(L10n.screenAdvancedSettingsMediaCompressionTitle) + .compoundListSectionHeader() + } } .compoundList() .navigationTitle(L10n.commonAdvancedSettings) diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift index 62e4d7f9b0..f8523ff3c1 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift @@ -46,7 +46,6 @@ protocol DeveloperOptionsProtocol: AnyObject { var hideUnreadMessagesBadge: Bool { get set } var fuzzyRoomListSearchEnabled: Bool { get set } var hideTimelineMedia: Bool { get set } - var optimizeMediaUploads: Bool { get set } var enableOnlySignedDeviceIsolationMode: Bool { get set } var elementCallBaseURLOverride: URL? { get set } var knockingEnabled: Bool { get set } diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift index bf4ed095aa..d9e6f2a6cd 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift @@ -62,12 +62,6 @@ struct DeveloperOptionsScreen: View { } } - Section("Media") { - Toggle(isOn: $context.optimizeMediaUploads) { - Text("Optimise for upload") - } - } - Section { Toggle(isOn: $context.enableOnlySignedDeviceIsolationMode) { Text("Exclude insecure devices when sending/receiving messages") From 417c637b9e15fea9e87cfa61050a158e41feb308 Mon Sep 17 00:00:00 2001 From: Doug Date: Wed, 30 Oct 2024 09:52:08 +0000 Subject: [PATCH 2/6] Add OptimizeMediaUploads analytics. --- ElementX.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- .../SettingsFlowCoordinator.swift | 6 ++++-- .../UserSessionFlowCoordinator.swift | 3 ++- .../AdvancedSettingsScreenCoordinator.swift | 9 +++++++-- .../AdvancedSettingsScreenModels.swift | 4 +++- .../AdvancedSettingsScreenViewModel.swift | 16 ++++++++++++---- .../View/AdvancedSettingsScreen.swift | 6 +++++- project.yml | 2 +- 9 files changed, 37 insertions(+), 15 deletions(-) diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index 88da35f4a1..a0c529c6ef 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -7874,7 +7874,7 @@ repositoryURL = "https://github.com/matrix-org/matrix-analytics-events"; requirement = { kind = upToNextMinorVersion; - minimumVersion = 0.27.0; + minimumVersion = 0.28.0; }; }; C13F55E4518415CB4C278E73 /* XCRemoteSwiftPackageReference "DTCoreText" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 97e4b2e1c1..4751bc7db7 100644 --- a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -131,8 +131,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/matrix-org/matrix-analytics-events", "state" : { - "revision" : "9bd3c57e84f87d56b69862369f3b9da714d1d151", - "version" : "0.27.0" + "revision" : "632f4266d5ebd5b87b9eb52522f5117723fcd338", + "version" : "0.28.0" } }, { diff --git a/ElementX/Sources/FlowCoordinators/SettingsFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/SettingsFlowCoordinator.swift index 7e031a0005..3ae3d31cfa 100644 --- a/ElementX/Sources/FlowCoordinators/SettingsFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/SettingsFlowCoordinator.swift @@ -27,6 +27,7 @@ struct SettingsFlowCoordinatorParameters { let appSettings: AppSettings let navigationSplitCoordinator: NavigationSplitCoordinator let userIndicatorController: UserIndicatorControllerProtocol + let analytics: AnalyticsService } class SettingsFlowCoordinator: FlowCoordinatorProtocol { @@ -174,7 +175,7 @@ class SettingsFlowCoordinator: FlowCoordinatorProtocol { private func presentAnalyticsScreen() { let coordinator = AnalyticsSettingsScreenCoordinator(parameters: .init(appSettings: parameters.appSettings, - analytics: ServiceLocator.shared.analytics)) + analytics: parameters.analytics)) navigationStackCoordinator?.push(coordinator) } @@ -221,7 +222,8 @@ class SettingsFlowCoordinator: FlowCoordinatorProtocol { } private func presentAdvancedSettings() { - let coordinator = AdvancedSettingsScreenCoordinator() + let coordinator = AdvancedSettingsScreenCoordinator(parameters: .init(appSettings: parameters.appSettings, + analytics: parameters.analytics)) navigationStackCoordinator.push(coordinator) } diff --git a/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift index 012c26dfb9..8e2431e541 100644 --- a/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift @@ -99,7 +99,8 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol { secureBackupController: userSession.clientProxy.secureBackupController, appSettings: appSettings, navigationSplitCoordinator: navigationSplitCoordinator, - userIndicatorController: ServiceLocator.shared.userIndicatorController)) + userIndicatorController: ServiceLocator.shared.userIndicatorController, + analytics: analytics)) onboardingFlowCoordinator = OnboardingFlowCoordinator(userSession: userSession, appLockService: appLockService, diff --git a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenCoordinator.swift b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenCoordinator.swift index 20715a393f..1094a14a12 100644 --- a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenCoordinator.swift +++ b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenCoordinator.swift @@ -8,11 +8,16 @@ import Combine import SwiftUI +struct AdvancedSettingsScreenCoordinatorParameters { + let appSettings: AppSettings + let analytics: AnalyticsService +} + final class AdvancedSettingsScreenCoordinator: CoordinatorProtocol { private var viewModel: AdvancedSettingsScreenViewModelProtocol - init() { - viewModel = AdvancedSettingsScreenViewModel(advancedSettings: ServiceLocator.shared.settings) + init(parameters: AdvancedSettingsScreenCoordinatorParameters) { + viewModel = AdvancedSettingsScreenViewModel(advancedSettings: parameters.appSettings, analytics: parameters.analytics) } func toPresentable() -> AnyView { diff --git a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenModels.swift b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenModels.swift index 1809eab8e1..2003ae6688 100644 --- a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenModels.swift @@ -26,7 +26,9 @@ struct AdvancedSettingsScreenViewStateBindings { } } -enum AdvancedSettingsScreenViewAction { } +enum AdvancedSettingsScreenViewAction { + case optimizeMediaUploadsChanged +} protocol AdvancedSettingsProtocol: AnyObject { var viewSourceEnabled: Bool { get set } diff --git a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenViewModel.swift b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenViewModel.swift index cc7e51a561..a7a05932a1 100644 --- a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenViewModel.swift +++ b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenViewModel.swift @@ -11,12 +11,20 @@ import SwiftUI typealias AdvancedSettingsScreenViewModelType = StateStoreViewModel class AdvancedSettingsScreenViewModel: AdvancedSettingsScreenViewModelType, AdvancedSettingsScreenViewModelProtocol { - init(advancedSettings: AdvancedSettingsProtocol) { - let bindings = AdvancedSettingsScreenViewStateBindings(advancedSettings: advancedSettings) - let state = AdvancedSettingsScreenViewState(bindings: bindings) + private let analytics: AnalyticsService + + init(advancedSettings: AdvancedSettingsProtocol, analytics: AnalyticsService) { + self.analytics = analytics + let state = AdvancedSettingsScreenViewState(bindings: .init(advancedSettings: advancedSettings)) super.init(initialViewState: state) } - override func process(viewAction: AdvancedSettingsScreenViewAction) { } + override func process(viewAction: AdvancedSettingsScreenViewAction) { + switch viewAction { + case .optimizeMediaUploadsChanged: + // Note: Using a view action here as sinking the AppSettings publisher tracks the initial value. + analytics.trackInteraction(name: state.bindings.optimizeMediaUploads ? .MobileSettingsOptimizeMediaUploadsEnabled : .MobileSettingsOptimizeMediaUploadsDisabled) + } + } } diff --git a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift index 626e0d1494..08645eb923 100644 --- a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift +++ b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift @@ -30,6 +30,9 @@ struct AdvancedSettingsScreen: View { Section { ListRow(label: .plain(title: L10n.screenAdvancedSettingsMediaCompressionDescription), kind: .toggle($context.optimizeMediaUploads)) + .onChange(of: context.optimizeMediaUploads) { + context.send(viewAction: .optimizeMediaUploadsChanged) + } } header: { Text(L10n.screenAdvancedSettingsMediaCompressionTitle) .compoundListSectionHeader() @@ -57,7 +60,8 @@ private extension AppAppearance { // MARK: - Previews struct AdvancedSettingsScreen_Previews: PreviewProvider, TestablePreview { - static let viewModel = AdvancedSettingsScreenViewModel(advancedSettings: ServiceLocator.shared.settings) + static let viewModel = AdvancedSettingsScreenViewModel(advancedSettings: ServiceLocator.shared.settings, + analytics: ServiceLocator.shared.analytics) static var previews: some View { NavigationStack { AdvancedSettingsScreen(context: viewModel.context) diff --git a/project.yml b/project.yml index 3e2e9dac54..aeae881b60 100644 --- a/project.yml +++ b/project.yml @@ -68,7 +68,7 @@ packages: # path: ../compound-ios AnalyticsEvents: url: https://github.com/matrix-org/matrix-analytics-events - minorVersion: 0.27.0 + minorVersion: 0.28.0 # path: ../matrix-analytics-events Emojibase: url: https://github.com/matrix-org/emojibase-bindings From 9add62447485c667e1052de81fbda2325ed028b9 Mon Sep 17 00:00:00 2001 From: Doug Date: Wed, 30 Oct 2024 12:02:14 +0000 Subject: [PATCH 3/6] Final strings. --- .../Localizations/en.lproj/Localizable.strings | 4 ++-- ElementX/Sources/Generated/Strings.swift | 4 ++-- .../View/AdvancedSettingsScreen.swift | 10 +++------- .../test_advancedSettingsScreen-iPad-en-GB.1.png | 4 ++-- .../test_advancedSettingsScreen-iPad-pseudo.1.png | 4 ++-- .../test_advancedSettingsScreen-iPhone-16-en-GB.1.png | 4 ++-- .../test_advancedSettingsScreen-iPhone-16-pseudo.1.png | 4 ++-- 7 files changed, 15 insertions(+), 19 deletions(-) diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index e5a5651e2e..68c3ed0f7b 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -390,8 +390,8 @@ "screen_account_provider_signup_title" = "You’re about to create an account on %@"; "screen_advanced_settings_developer_mode" = "Developer mode"; "screen_advanced_settings_developer_mode_description" = "Enable to have access to features and functionality for developers."; -"screen_advanced_settings_media_compression_description" = "Optimize for upload"; -"screen_advanced_settings_media_compression_title" = "Media"; +"screen_advanced_settings_media_compression_description" = "Upload photos and videos faster and reduce data usage⁦"; +"screen_advanced_settings_media_compression_title" = "Optimise media quality"; "screen_advanced_settings_rich_text_editor_description" = "Disable the rich text editor to type Markdown manually."; "screen_advanced_settings_send_read_receipts" = "Read receipts"; "screen_advanced_settings_send_read_receipts_description" = "If turned off, your read receipts won't be sent to anyone. You will still receive read receipts from other users."; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index 573a347c04..e51c144be4 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -842,9 +842,9 @@ internal enum L10n { internal static var screenAdvancedSettingsElementCallBaseUrlDescription: String { return L10n.tr("Localizable", "screen_advanced_settings_element_call_base_url_description") } /// Invalid URL, please make sure you include the protocol (http/https) and the correct address. internal static var screenAdvancedSettingsElementCallBaseUrlValidationError: String { return L10n.tr("Localizable", "screen_advanced_settings_element_call_base_url_validation_error") } - /// Optimize for upload + /// Upload photos and videos faster and reduce data usage⁦ internal static var screenAdvancedSettingsMediaCompressionDescription: String { return L10n.tr("Localizable", "screen_advanced_settings_media_compression_description") } - /// Media + /// Optimise media quality internal static var screenAdvancedSettingsMediaCompressionTitle: String { return L10n.tr("Localizable", "screen_advanced_settings_media_compression_title") } /// Disable the rich text editor to type Markdown manually. internal static var screenAdvancedSettingsRichTextEditorDescription: String { return L10n.tr("Localizable", "screen_advanced_settings_rich_text_editor_description") } diff --git a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift index 08645eb923..1c2e9fb29e 100644 --- a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift +++ b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift @@ -25,17 +25,13 @@ struct AdvancedSettingsScreen: View { ListRow(label: .plain(title: L10n.screenAdvancedSettingsSharePresence, description: L10n.screenAdvancedSettingsSharePresenceDescription), kind: .toggle($context.sharePresence)) - } - - Section { - ListRow(label: .plain(title: L10n.screenAdvancedSettingsMediaCompressionDescription), + + ListRow(label: .plain(title: L10n.screenAdvancedSettingsMediaCompressionTitle, + description: L10n.screenAdvancedSettingsMediaCompressionDescription), kind: .toggle($context.optimizeMediaUploads)) .onChange(of: context.optimizeMediaUploads) { context.send(viewAction: .optimizeMediaUploadsChanged) } - } header: { - Text(L10n.screenAdvancedSettingsMediaCompressionTitle) - .compoundListSectionHeader() } } .compoundList() diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-en-GB.1.png index c6d1158f0a..d68d9f3bb3 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-en-GB.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:484136606f2b3dd8cdc29f5b4f943622c2e770672c5a1980ff0e7db55a499c09 -size 114860 +oid sha256:41db5b6eb7726d8da1147477e8a377be17c17eb9f6124eebc76acd51a2a6b267 +size 138479 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-pseudo.1.png index 2ffab2fc07..63a0b6fe49 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-pseudo.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bdfd7ebbf5f14f045bdaf416aa405d277edce74fdd3f7040f82b488e60074dc1 -size 126470 +oid sha256:20de5ef319c9abd5cb40fae4d79c9d94a11f826fab3d7ab9652bb2b44e91f0b7 +size 159248 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-en-GB.1.png index 2dfdb18eb5..ee7838639e 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-en-GB.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:987c192f5c1ab4c07fc198c190b3867843d9b459e6edf71a5057102853fe9941 -size 66997 +oid sha256:114545af38cd699bd9b15076930d43e3b4087731f6a2adc7373c122f2f1a9a9c +size 88913 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-pseudo.1.png index e1f4810213..9124272dc9 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-pseudo.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fd509058af6af0c07b4350bf19e33dc16ca76c977be0c99d03614f4810374235 -size 84485 +oid sha256:2ffa4375714921017ea1cf16c2a10a2035993f3284b05455e6e35e8fef05ad9a +size 126664 From 57acffc6ff5c3758a409221fd9f963585699a3cb Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 31 Oct 2024 09:43:30 +0000 Subject: [PATCH 4/6] =?UTF-8?q?Upload=20reduced=20quality=20media=20by=20d?= =?UTF-8?q?efault=20=F0=9F=98=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the setting out of the feature flags section in the file. --- ElementX/Sources/Application/AppSettings.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ElementX/Sources/Application/AppSettings.swift b/ElementX/Sources/Application/AppSettings.swift index c759358e23..40b0d76bfe 100644 --- a/ElementX/Sources/Application/AppSettings.swift +++ b/ElementX/Sources/Application/AppSettings.swift @@ -32,6 +32,7 @@ final class AppSettings { case pusherProfileTag case logLevel case viewSourceEnabled + case optimizeMediaUploads case appAppearance case sharePresence case hideUnreadMessagesBadge @@ -42,7 +43,6 @@ final class AppSettings { // Feature flags case slidingSyncDiscovery - case optimizeMediaUploads case publicSearchEnabled case fuzzyRoomListSearchEnabled case enableOnlySignedDeviceIsolationMode @@ -237,6 +237,9 @@ final class AppSettings { @UserPreference(key: UserDefaultsKeys.viewSourceEnabled, defaultValue: isDevelopmentBuild, storageType: .userDefaults(store)) var viewSourceEnabled + + @UserPreference(key: UserDefaultsKeys.optimizeMediaUploads, defaultValue: true, storageType: .userDefaults(store)) + var optimizeMediaUploads // MARK: - Element Call @@ -275,9 +278,6 @@ final class AppSettings { @UserPreference(key: UserDefaultsKeys.slidingSyncDiscovery, defaultValue: .native, storageType: .userDefaults(store)) var slidingSyncDiscovery: SlidingSyncDiscovery - @UserPreference(key: UserDefaultsKeys.optimizeMediaUploads, defaultValue: false, storageType: .userDefaults(store)) - var optimizeMediaUploads - @UserPreference(key: UserDefaultsKeys.knockingEnabled, defaultValue: false, storageType: .userDefaults(store)) var knockingEnabled From c1ffd3a5567b0ab20771e3746747ae2f9ec764e8 Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 31 Oct 2024 10:19:28 +0000 Subject: [PATCH 5/6] Fix unit tests now the default has changed. --- UnitTests/Sources/MediaUploadingPreprocessorTests.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/UnitTests/Sources/MediaUploadingPreprocessorTests.swift b/UnitTests/Sources/MediaUploadingPreprocessorTests.swift index 68734fada8..93ae732697 100644 --- a/UnitTests/Sources/MediaUploadingPreprocessorTests.swift +++ b/UnitTests/Sources/MediaUploadingPreprocessorTests.swift @@ -17,6 +17,7 @@ final class MediaUploadingPreprocessorTests: XCTestCase { override func setUp() { AppSettings.resetAllSettings() appSettings = AppSettings() + appSettings.optimizeMediaUploads = false ServiceLocator.shared.register(appSettings: appSettings) mediaUploadingPreprocessor = MediaUploadingPreprocessor(appSettings: appSettings) } From 47b280126d3fc3ca2a4256c389896fcec4763887 Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 31 Oct 2024 11:36:40 +0000 Subject: [PATCH 6/6] Pull in updated string, fix snapshots. --- ElementX/Resources/Localizations/en.lproj/Localizable.strings | 2 +- ElementX/Sources/Generated/Strings.swift | 2 +- .../PreviewTests/test_advancedSettingsScreen-iPad-en-GB.1.png | 4 ++-- .../test_advancedSettingsScreen-iPad-pseudo.1.png | 4 ++-- .../test_advancedSettingsScreen-iPhone-16-en-GB.1.png | 4 ++-- .../test_advancedSettingsScreen-iPhone-16-pseudo.1.png | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 68c3ed0f7b..0d723cc593 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -390,7 +390,7 @@ "screen_account_provider_signup_title" = "You’re about to create an account on %@"; "screen_advanced_settings_developer_mode" = "Developer mode"; "screen_advanced_settings_developer_mode_description" = "Enable to have access to features and functionality for developers."; -"screen_advanced_settings_media_compression_description" = "Upload photos and videos faster and reduce data usage⁦"; +"screen_advanced_settings_media_compression_description" = "Upload photos and videos faster and reduce data usage"; "screen_advanced_settings_media_compression_title" = "Optimise media quality"; "screen_advanced_settings_rich_text_editor_description" = "Disable the rich text editor to type Markdown manually."; "screen_advanced_settings_send_read_receipts" = "Read receipts"; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index e51c144be4..b2b8ccb77a 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -842,7 +842,7 @@ internal enum L10n { internal static var screenAdvancedSettingsElementCallBaseUrlDescription: String { return L10n.tr("Localizable", "screen_advanced_settings_element_call_base_url_description") } /// Invalid URL, please make sure you include the protocol (http/https) and the correct address. internal static var screenAdvancedSettingsElementCallBaseUrlValidationError: String { return L10n.tr("Localizable", "screen_advanced_settings_element_call_base_url_validation_error") } - /// Upload photos and videos faster and reduce data usage⁦ + /// Upload photos and videos faster and reduce data usage internal static var screenAdvancedSettingsMediaCompressionDescription: String { return L10n.tr("Localizable", "screen_advanced_settings_media_compression_description") } /// Optimise media quality internal static var screenAdvancedSettingsMediaCompressionTitle: String { return L10n.tr("Localizable", "screen_advanced_settings_media_compression_title") } diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-en-GB.1.png index d68d9f3bb3..3f41508339 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-en-GB.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:41db5b6eb7726d8da1147477e8a377be17c17eb9f6124eebc76acd51a2a6b267 -size 138479 +oid sha256:7dbc230120926d73fde55e42c43e36ef868bd893e600e749c66f979daa3f5659 +size 139055 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-pseudo.1.png index 63a0b6fe49..ee91d09f82 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-pseudo.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPad-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:20de5ef319c9abd5cb40fae4d79c9d94a11f826fab3d7ab9652bb2b44e91f0b7 -size 159248 +oid sha256:e71fa4df1e53f4fde23993f2242cc6c1cf239a78bf4a9b46aa1f982f32ae680d +size 159915 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-en-GB.1.png index ee7838639e..169636eac9 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-en-GB.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:114545af38cd699bd9b15076930d43e3b4087731f6a2adc7373c122f2f1a9a9c -size 88913 +oid sha256:a505289fc465bfdb3a40660c5fff6828c528574669cd4967fd9c63ce810043f8 +size 89637 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-pseudo.1.png index 9124272dc9..e46e2828f5 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-pseudo.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_advancedSettingsScreen-iPhone-16-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2ffa4375714921017ea1cf16c2a10a2035993f3284b05455e6e35e8fef05ad9a -size 126664 +oid sha256:94b8e86129726c0f05a02136b7afa70cb0ae080896d4bc67841dbfa81e7fc3ac +size 127155