diff --git a/ElementX/Sources/Application/Settings/AppSettings.swift b/ElementX/Sources/Application/Settings/AppSettings.swift index f3dce4b71..42d78aa17 100644 --- a/ElementX/Sources/Application/Settings/AppSettings.swift +++ b/ElementX/Sources/Application/Settings/AppSettings.swift @@ -75,7 +75,7 @@ final class AppSettings { case enableKeyShareOnInvite case knockingEnabled case threadsEnabled - case developerOptionsEnabled + case roomThreadListEnabled case linkPreviewsEnabled case focusEventOnNotificationTap case linkNewDeviceEnabled @@ -85,6 +85,8 @@ final class AppSettings { // Doug's tweaks 🔧 case hideUnreadMessagesBadge case hideQuietNotificationAlerts + + case developerOptionsEnabled } private static var suiteName: String = InfoPlistReader.main.appGroupIdentifier @@ -429,6 +431,9 @@ final class AppSettings { @UserPreference(key: UserDefaultsKeys.threadsEnabled, defaultValue: false, storageType: .userDefaults(store)) var threadsEnabled + @UserPreference(key: UserDefaultsKeys.roomThreadListEnabled, defaultValue: false, storageType: .userDefaults(store)) + var roomThreadListEnabled + @UserPreference(key: UserDefaultsKeys.focusEventOnNotificationTap, defaultValue: false, storageType: .userDefaults(store)) var focusEventOnNotificationTap diff --git a/ElementX/Sources/Screens/RoomScreen/RoomScreenModels.swift b/ElementX/Sources/Screens/RoomScreen/RoomScreenModels.swift index 375ef6f8d..01700b196 100644 --- a/ElementX/Sources/Screens/RoomScreen/RoomScreenModels.swift +++ b/ElementX/Sources/Screens/RoomScreen/RoomScreenModels.swift @@ -62,6 +62,7 @@ struct RoomScreenViewState: BindableState { isCallingEnabled && !isParticipatingInOngoingCall // Hide the join call button when already in the call } + var roomThreadListEnabled = false var isKnockingEnabled = false var isKnockableRoom = false var canAcceptKnocks = false diff --git a/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift b/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift index a8040f3bc..605e06368 100644 --- a/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift @@ -164,6 +164,10 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol // MARK: - Private private func setupSubscriptions(ongoingCallRoomIDPublisher: CurrentValuePublisher) { + appSettings.$roomThreadListEnabled + .weakAssign(to: \.state.roomThreadListEnabled, on: self) + .store(in: &cancellables) + appSettings.$knockingEnabled .weakAssign(to: \.state.isKnockingEnabled, on: self) .store(in: &cancellables) diff --git a/ElementX/Sources/Screens/RoomScreen/View/RoomScreen.swift b/ElementX/Sources/Screens/RoomScreen/View/RoomScreen.swift index 3091d3153..88e46d896 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/RoomScreen.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/RoomScreen.swift @@ -179,6 +179,8 @@ struct RoomScreen: View { } } } + + if context.viewState.roomThreadListEnabled { if #available(iOS 26, *) { ToolbarSpacer(.fixed, placement: .primaryAction) } @@ -190,6 +192,7 @@ struct RoomScreen: View { CompoundIcon(\.threads) } } + } } @ViewBuilder diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift index 4614e63d7..00bf01681 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift @@ -71,6 +71,8 @@ protocol DeveloperOptionsProtocol: AnyObject { var liveLocationSharingEnabled: Bool { get set } var floatingTimelineDateEnabled: Bool { get set } + + var roomThreadListEnabled: Bool { get set } } extension AppSettings: DeveloperOptionsProtocol { } diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift index bb3c5fb24..454c49384 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift @@ -69,7 +69,11 @@ struct DeveloperOptionsScreen: View { } } - Section("Timeline") { + Section("Room") { + Toggle(isOn: $context.roomThreadListEnabled) { + Text("Room thread list") + } + Toggle(isOn: $context.linkPreviewsEnabled) { Text("Link previews") Text("Follows the timeline media visibility settings.") @@ -80,14 +84,12 @@ struct DeveloperOptionsScreen: View { Toggle(isOn: $context.liveLocationSharingEnabled) { Text("Live location sharing") } - + Toggle(isOn: $context.floatingTimelineDateEnabled) { Text("Floating timeline date") Text("Shows a floating date badge while scrolling the timeline.") } - } - - Section("Join rules") { + Toggle(isOn: $context.knockingEnabled) { Text("Knocking") Text("Ask to join rooms")