mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
Add a feature flag for the new RoomThreadList screen.
This commit is contained in:
committed by
Stefan Ceriu
parent
e7e1e990db
commit
9406148689
@@ -75,7 +75,7 @@ final class AppSettings {
|
|||||||
case enableKeyShareOnInvite
|
case enableKeyShareOnInvite
|
||||||
case knockingEnabled
|
case knockingEnabled
|
||||||
case threadsEnabled
|
case threadsEnabled
|
||||||
case developerOptionsEnabled
|
case roomThreadListEnabled
|
||||||
case linkPreviewsEnabled
|
case linkPreviewsEnabled
|
||||||
case focusEventOnNotificationTap
|
case focusEventOnNotificationTap
|
||||||
case linkNewDeviceEnabled
|
case linkNewDeviceEnabled
|
||||||
@@ -85,6 +85,8 @@ final class AppSettings {
|
|||||||
// Doug's tweaks 🔧
|
// Doug's tweaks 🔧
|
||||||
case hideUnreadMessagesBadge
|
case hideUnreadMessagesBadge
|
||||||
case hideQuietNotificationAlerts
|
case hideQuietNotificationAlerts
|
||||||
|
|
||||||
|
case developerOptionsEnabled
|
||||||
}
|
}
|
||||||
|
|
||||||
private static var suiteName: String = InfoPlistReader.main.appGroupIdentifier
|
private static var suiteName: String = InfoPlistReader.main.appGroupIdentifier
|
||||||
@@ -429,6 +431,9 @@ final class AppSettings {
|
|||||||
@UserPreference(key: UserDefaultsKeys.threadsEnabled, defaultValue: false, storageType: .userDefaults(store))
|
@UserPreference(key: UserDefaultsKeys.threadsEnabled, defaultValue: false, storageType: .userDefaults(store))
|
||||||
var threadsEnabled
|
var threadsEnabled
|
||||||
|
|
||||||
|
@UserPreference(key: UserDefaultsKeys.roomThreadListEnabled, defaultValue: false, storageType: .userDefaults(store))
|
||||||
|
var roomThreadListEnabled
|
||||||
|
|
||||||
@UserPreference(key: UserDefaultsKeys.focusEventOnNotificationTap, defaultValue: false, storageType: .userDefaults(store))
|
@UserPreference(key: UserDefaultsKeys.focusEventOnNotificationTap, defaultValue: false, storageType: .userDefaults(store))
|
||||||
var focusEventOnNotificationTap
|
var focusEventOnNotificationTap
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ struct RoomScreenViewState: BindableState {
|
|||||||
isCallingEnabled && !isParticipatingInOngoingCall // Hide the join call button when already in the call
|
isCallingEnabled && !isParticipatingInOngoingCall // Hide the join call button when already in the call
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var roomThreadListEnabled = false
|
||||||
var isKnockingEnabled = false
|
var isKnockingEnabled = false
|
||||||
var isKnockableRoom = false
|
var isKnockableRoom = false
|
||||||
var canAcceptKnocks = false
|
var canAcceptKnocks = false
|
||||||
|
|||||||
@@ -164,6 +164,10 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
|||||||
// MARK: - Private
|
// MARK: - Private
|
||||||
|
|
||||||
private func setupSubscriptions(ongoingCallRoomIDPublisher: CurrentValuePublisher<String?, Never>) {
|
private func setupSubscriptions(ongoingCallRoomIDPublisher: CurrentValuePublisher<String?, Never>) {
|
||||||
|
appSettings.$roomThreadListEnabled
|
||||||
|
.weakAssign(to: \.state.roomThreadListEnabled, on: self)
|
||||||
|
.store(in: &cancellables)
|
||||||
|
|
||||||
appSettings.$knockingEnabled
|
appSettings.$knockingEnabled
|
||||||
.weakAssign(to: \.state.isKnockingEnabled, on: self)
|
.weakAssign(to: \.state.isKnockingEnabled, on: self)
|
||||||
.store(in: &cancellables)
|
.store(in: &cancellables)
|
||||||
|
|||||||
@@ -179,6 +179,8 @@ struct RoomScreen: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if context.viewState.roomThreadListEnabled {
|
||||||
if #available(iOS 26, *) {
|
if #available(iOS 26, *) {
|
||||||
ToolbarSpacer(.fixed, placement: .primaryAction)
|
ToolbarSpacer(.fixed, placement: .primaryAction)
|
||||||
}
|
}
|
||||||
@@ -190,6 +192,7 @@ struct RoomScreen: View {
|
|||||||
CompoundIcon(\.threads)
|
CompoundIcon(\.threads)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
|
|||||||
+2
@@ -71,6 +71,8 @@ protocol DeveloperOptionsProtocol: AnyObject {
|
|||||||
var liveLocationSharingEnabled: Bool { get set }
|
var liveLocationSharingEnabled: Bool { get set }
|
||||||
|
|
||||||
var floatingTimelineDateEnabled: Bool { get set }
|
var floatingTimelineDateEnabled: Bool { get set }
|
||||||
|
|
||||||
|
var roomThreadListEnabled: Bool { get set }
|
||||||
}
|
}
|
||||||
|
|
||||||
extension AppSettings: DeveloperOptionsProtocol { }
|
extension AppSettings: DeveloperOptionsProtocol { }
|
||||||
|
|||||||
+7
-5
@@ -69,7 +69,11 @@ struct DeveloperOptionsScreen: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Section("Timeline") {
|
Section("Room") {
|
||||||
|
Toggle(isOn: $context.roomThreadListEnabled) {
|
||||||
|
Text("Room thread list")
|
||||||
|
}
|
||||||
|
|
||||||
Toggle(isOn: $context.linkPreviewsEnabled) {
|
Toggle(isOn: $context.linkPreviewsEnabled) {
|
||||||
Text("Link previews")
|
Text("Link previews")
|
||||||
Text("Follows the timeline media visibility settings.")
|
Text("Follows the timeline media visibility settings.")
|
||||||
@@ -80,14 +84,12 @@ struct DeveloperOptionsScreen: View {
|
|||||||
Toggle(isOn: $context.liveLocationSharingEnabled) {
|
Toggle(isOn: $context.liveLocationSharingEnabled) {
|
||||||
Text("Live location sharing")
|
Text("Live location sharing")
|
||||||
}
|
}
|
||||||
|
|
||||||
Toggle(isOn: $context.floatingTimelineDateEnabled) {
|
Toggle(isOn: $context.floatingTimelineDateEnabled) {
|
||||||
Text("Floating timeline date")
|
Text("Floating timeline date")
|
||||||
Text("Shows a floating date badge while scrolling the timeline.")
|
Text("Shows a floating date badge while scrolling the timeline.")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Section("Join rules") {
|
|
||||||
Toggle(isOn: $context.knockingEnabled) {
|
Toggle(isOn: $context.knockingEnabled) {
|
||||||
Text("Knocking")
|
Text("Knocking")
|
||||||
Text("Ask to join rooms")
|
Text("Ask to join rooms")
|
||||||
|
|||||||
Reference in New Issue
Block a user