From 947373e7f291700f442e1560935600d45b48622a Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 19 Aug 2025 17:11:18 +0300 Subject: [PATCH 1/2] Fix photo and document picker tint colors on dark mode. --- .../Sources/Screens/MediaPickerScreen/DocumentPicker.swift | 4 +++- .../Screens/MediaPickerScreen/PhotoLibraryPicker.swift | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ElementX/Sources/Screens/MediaPickerScreen/DocumentPicker.swift b/ElementX/Sources/Screens/MediaPickerScreen/DocumentPicker.swift index 67ab09b061..6a135c6a3f 100644 --- a/ElementX/Sources/Screens/MediaPickerScreen/DocumentPicker.swift +++ b/ElementX/Sources/Screens/MediaPickerScreen/DocumentPicker.swift @@ -40,7 +40,9 @@ struct DocumentPicker: UIViewControllerRepresentable { return documentPicker } - func updateUIViewController(_ uiViewController: UIDocumentPickerViewController, context: Context) { } + func updateUIViewController(_ uiViewController: UIDocumentPickerViewController, context: Context) { + uiViewController.view.tintColor = .compound.textActionAccent + } func makeCoordinator() -> Coordinator { Coordinator(self) diff --git a/ElementX/Sources/Screens/MediaPickerScreen/PhotoLibraryPicker.swift b/ElementX/Sources/Screens/MediaPickerScreen/PhotoLibraryPicker.swift index f927ed5c76..97b05f24d3 100644 --- a/ElementX/Sources/Screens/MediaPickerScreen/PhotoLibraryPicker.swift +++ b/ElementX/Sources/Screens/MediaPickerScreen/PhotoLibraryPicker.swift @@ -48,7 +48,9 @@ struct PhotoLibraryPicker: UIViewControllerRepresentable { return pickerViewController } - func updateUIViewController(_ uiViewController: PHPickerViewController, context: Context) { } + func updateUIViewController(_ uiViewController: PHPickerViewController, context: Context) { + uiViewController.view.tintColor = .compound.textActionAccent + } func makeCoordinator() -> Coordinator { Coordinator(self) From d2986902d3921f0d140ea6cd4e8d49d931a25475 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 19 Aug 2025 17:19:39 +0300 Subject: [PATCH 2/2] Remove the `multipleAttachmentUploadEnabled` feature flag. --- .../Sources/Application/Settings/AppSettings.swift | 5 ----- .../Sources/FlowCoordinators/RoomFlowCoordinator.swift | 1 - .../MediaPickerScreenCoordinator.swift | 10 +++------- .../RoomDetailsEditScreenCoordinator.swift | 1 - .../DeveloperOptionsScreenModels.swift | 1 - .../View/DeveloperOptionsScreen.swift | 8 +------- .../UserDetailsEditScreenCoordinator.swift | 1 - .../StartChatScreen/StartChatScreenCoordinator.swift | 1 - 8 files changed, 4 insertions(+), 24 deletions(-) diff --git a/ElementX/Sources/Application/Settings/AppSettings.swift b/ElementX/Sources/Application/Settings/AppSettings.swift index 4cfbd9401b..b6a99a0f34 100644 --- a/ElementX/Sources/Application/Settings/AppSettings.swift +++ b/ElementX/Sources/Application/Settings/AppSettings.swift @@ -22,7 +22,6 @@ protocol CommonSettingsProtocol { var enableKeyShareOnInvite: Bool { get } var threadsEnabled: Bool { get } var hideQuietNotificationAlerts: Bool { get } - var multipleAttachmentUploadEnabled: Bool { get } } /// Store Element specific app settings. @@ -60,7 +59,6 @@ final class AppSettings { case knockingEnabled case threadsEnabled case developerOptionsEnabled - case multipleAttachmentUploadEnabled // Doug's tweaks 🔧 case hideUnreadMessagesBadge @@ -376,9 +374,6 @@ final class AppSettings { @UserPreference(key: UserDefaultsKeys.hideQuietNotificationAlerts, defaultValue: false, storageType: .userDefaults(store)) var hideQuietNotificationAlerts - - @UserPreference(key: UserDefaultsKeys.multipleAttachmentUploadEnabled, defaultValue: isDevelopmentBuild, storageType: .userDefaults(store)) - var multipleAttachmentUploadEnabled } extension AppSettings: CommonSettingsProtocol { } diff --git a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift index b2fea711be..c48e1341ce 100644 --- a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift @@ -963,7 +963,6 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol { let stackCoordinator = NavigationStackCoordinator() let mediaPickerCoordinator = MediaPickerScreenCoordinator(mode: mode, - appSettings: appSettings, userIndicatorController: userIndicatorController, orientationManager: appMediator.windowManager) { [weak self] action in guard let self else { diff --git a/ElementX/Sources/Screens/MediaPickerScreen/MediaPickerScreenCoordinator.swift b/ElementX/Sources/Screens/MediaPickerScreen/MediaPickerScreenCoordinator.swift index 175510bf5e..f010221048 100644 --- a/ElementX/Sources/Screens/MediaPickerScreen/MediaPickerScreenCoordinator.swift +++ b/ElementX/Sources/Screens/MediaPickerScreen/MediaPickerScreenCoordinator.swift @@ -29,23 +29,19 @@ enum MediaPickerScreenCoordinatorAction { } class MediaPickerScreenCoordinator: CoordinatorProtocol { - private let orientationManager: OrientationManagerProtocol - private let userIndicatorController: UserIndicatorControllerProtocol private let mode: MediaPickerScreenMode + private let userIndicatorController: UserIndicatorControllerProtocol + private let orientationManager: OrientationManagerProtocol private let callback: (MediaPickerScreenCoordinatorAction) -> Void init(mode: MediaPickerScreenMode, - appSettings: AppSettings, userIndicatorController: UserIndicatorControllerProtocol, orientationManager: OrientationManagerProtocol, callback: @escaping (MediaPickerScreenCoordinatorAction) -> Void) { + self.mode = mode self.userIndicatorController = userIndicatorController self.orientationManager = orientationManager self.callback = callback - - // The users of the media picker chose their ideal selection type leaving - // the feature flag to only be checked and enforced on this level. - self.mode = appSettings.multipleAttachmentUploadEnabled ? mode : .init(source: mode.source, selectionType: .single) } func toPresentable() -> AnyView { diff --git a/ElementX/Sources/Screens/RoomDetailsEditScreen/RoomDetailsEditScreenCoordinator.swift b/ElementX/Sources/Screens/RoomDetailsEditScreen/RoomDetailsEditScreenCoordinator.swift index 3ac172d2bf..61979b7eba 100644 --- a/ElementX/Sources/Screens/RoomDetailsEditScreen/RoomDetailsEditScreenCoordinator.swift +++ b/ElementX/Sources/Screens/RoomDetailsEditScreen/RoomDetailsEditScreenCoordinator.swift @@ -68,7 +68,6 @@ final class RoomDetailsEditScreenCoordinator: CoordinatorProtocol { let stackCoordinator = NavigationStackCoordinator() let mediaPickerCoordinator = MediaPickerScreenCoordinator(mode: mode, - appSettings: parameters.appSettings, userIndicatorController: parameters.userIndicatorController, orientationManager: parameters.orientationManager) { [weak self] action in guard let self else { return } diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift index dc7ee9ad17..e89f6c4370 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift @@ -43,7 +43,6 @@ protocol DeveloperOptionsProtocol: AnyObject { var enableKeyShareOnInvite: Bool { get set } var threadsEnabled: Bool { get set } var hideQuietNotificationAlerts: Bool { get set } - var multipleAttachmentUploadEnabled: Bool { get set } var hideUnreadMessagesBadge: Bool { get set } var elementCallBaseURLOverride: URL? { get set } diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift index cf1e122102..3f8afe213b 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift @@ -51,13 +51,7 @@ struct DeveloperOptionsScreen: View { Text("Fuzzy searching") } } - - Section("Timeline") { - Toggle(isOn: $context.multipleAttachmentUploadEnabled) { - Text("Allow selecting multiple attachments for upload") - } - } - + Section("Join rules") { Toggle(isOn: $context.knockingEnabled) { Text("Knocking") diff --git a/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/UserDetailsEditScreenCoordinator.swift b/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/UserDetailsEditScreenCoordinator.swift index 58d896b8bf..4e7b3adaf7 100644 --- a/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/UserDetailsEditScreenCoordinator.swift +++ b/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/UserDetailsEditScreenCoordinator.swift @@ -57,7 +57,6 @@ final class UserDetailsEditScreenCoordinator: CoordinatorProtocol { let stackCoordinator = NavigationStackCoordinator() let mediaPickerCoordinator = MediaPickerScreenCoordinator(mode: mode, - appSettings: parameters.appSettings, userIndicatorController: parameters.userIndicatorController, orientationManager: parameters.orientationManager) { [weak self] action in guard let self else { return } diff --git a/ElementX/Sources/Screens/StartChatScreen/StartChatScreenCoordinator.swift b/ElementX/Sources/Screens/StartChatScreen/StartChatScreenCoordinator.swift index 95aad25258..78fb3e4162 100644 --- a/ElementX/Sources/Screens/StartChatScreen/StartChatScreenCoordinator.swift +++ b/ElementX/Sources/Screens/StartChatScreen/StartChatScreenCoordinator.swift @@ -144,7 +144,6 @@ final class StartChatScreenCoordinator: CoordinatorProtocol { let stackCoordinator = NavigationStackCoordinator() let mediaPickerCoordinator = MediaPickerScreenCoordinator(mode: mode, - appSettings: parameters.appSettings, userIndicatorController: parameters.userIndicatorController, orientationManager: parameters.orientationManager) { [weak self] action in guard let self else { return }