mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Room list notifications tweaks (#6106)
We decided against changing how unread activity is rendered in the room list, so the experiment and its developer option are no longer needed. we have also added a notification settings entry for hiding the room list gray dots.
This commit is contained in:
-1
@@ -57,7 +57,6 @@ protocol DeveloperOptionsProtocol: AnyObject {
|
||||
var hideQuietNotificationAlerts: Bool { get set }
|
||||
var focusEventOnNotificationTap: Bool { get set }
|
||||
|
||||
var roomListActivityVisibility: RoomListActivityVisibility { get set }
|
||||
var elementCallBaseURLOverride: URL? { get set }
|
||||
|
||||
var fuzzyRoomListSearchEnabled: Bool { get set }
|
||||
|
||||
-7
@@ -60,13 +60,6 @@ struct DeveloperOptionsScreen: View {
|
||||
}
|
||||
|
||||
Section("Room List") {
|
||||
Picker("Room list activity visibility", selection: $context.roomListActivityVisibility) {
|
||||
ForEach(RoomListActivityVisibility.allCases, id: \.self) { visibility in
|
||||
Text(visibility.rawValue.capitalized)
|
||||
.tag(visibility)
|
||||
}
|
||||
}
|
||||
|
||||
Toggle(isOn: $context.fuzzyRoomListSearchEnabled) {
|
||||
Text("Fuzzy searching")
|
||||
}
|
||||
|
||||
+2
@@ -40,6 +40,7 @@ struct NotificationSettingsScreenViewStateBindings {
|
||||
var roomMentionsEnabled = false
|
||||
var callsEnabled = false
|
||||
var invitationsEnabled = false
|
||||
var showAllRoomListActivity = true
|
||||
var alertInfo: AlertInfo<NotificationSettingsScreenErrorType>?
|
||||
var shouldShowAlertSounds = false
|
||||
var shouldShowCustomAlertTonePicker = false
|
||||
@@ -93,6 +94,7 @@ enum NotificationSettingsScreenViewAction {
|
||||
case roomMentionChanged
|
||||
case callsChanged
|
||||
case invitationsChanged
|
||||
case showAllRoomListActivityChanged
|
||||
case close
|
||||
case fixConfigurationMismatchTapped
|
||||
case selectAlertTone(NotificationTone)
|
||||
|
||||
+4
-1
@@ -38,7 +38,8 @@ class NotificationSettingsScreenViewModel: NotificationSettingsScreenViewModelTy
|
||||
notificationTonePreviewer = AudioPlayer()
|
||||
self.notificationToneManager = notificationToneManager
|
||||
|
||||
let bindings = NotificationSettingsScreenViewStateBindings(enableNotifications: appSettings.enableNotifications)
|
||||
let bindings = NotificationSettingsScreenViewStateBindings(enableNotifications: appSettings.enableNotifications,
|
||||
showAllRoomListActivity: appSettings.showAllRoomListActivity)
|
||||
super.init(initialViewState: NotificationSettingsScreenViewState(bindings: bindings,
|
||||
isModallyPresented: isModallyPresented,
|
||||
selectedAlertTone: appSettings.selectedNotificationTone ?? NotificationToneManager.defaultElementXMessageTone,
|
||||
@@ -102,6 +103,8 @@ class NotificationSettingsScreenViewModel: NotificationSettingsScreenViewModelTy
|
||||
return
|
||||
}
|
||||
Task { await enableInvitations(state.bindings.invitationsEnabled) }
|
||||
case .showAllRoomListActivityChanged:
|
||||
appSettings.showAllRoomListActivity = state.bindings.showAllRoomListActivity
|
||||
case .close:
|
||||
actionsSubject.send(.close)
|
||||
case .fixConfigurationMismatchTapped:
|
||||
|
||||
+15
-1
@@ -26,7 +26,11 @@ struct NotificationSettingsScreen: View {
|
||||
|
||||
if context.enableNotifications {
|
||||
roomsNotificationSection
|
||||
|
||||
}
|
||||
|
||||
roomListActivitySection
|
||||
|
||||
if context.enableNotifications {
|
||||
if context.viewState.showCallsSettings, context.viewState.settings?.callsEnabled != nil {
|
||||
callsSection
|
||||
}
|
||||
@@ -139,6 +143,16 @@ struct NotificationSettingsScreen: View {
|
||||
}
|
||||
}
|
||||
|
||||
private var roomListActivitySection: some View {
|
||||
Section {
|
||||
ListRow(label: .plain(title: L10n.screenNotificationSettingsShowAllActivity),
|
||||
kind: .toggle($context.showAllRoomListActivity))
|
||||
.onChange(of: context.showAllRoomListActivity) {
|
||||
context.send(viewAction: .showAllRoomListActivityChanged)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var callsSection: some View {
|
||||
Section {
|
||||
ListRow(label: .plain(title: L10n.screenNotificationSettingsCallsLabel),
|
||||
|
||||
Reference in New Issue
Block a user