mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:31:27 +00:00
Add a Mentions room list filter (#5885)
* Add a Mentions room list filter Adds a new filter chip to the room list that shows only rooms with unread mentions, using the new mentions room list filter from the Rust SDK (matrix-org/matrix-rust-sdk branch matthew/mentions-filter). The SDK version needs bumping to a release that includes the new filter kind before this can build against the released components. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Order the room list filters by expected usage Move Favourites ahead of People and Rooms so the more commonly used filters (Unreads, Mentions, Favourites) sit first in the chip row — Rooms and Invites are used rarely enough that it's fine for them to wrap off the side. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uk8aPxHn3BHCe52L226jdG * update the SDK and use the appropriate rust filter types * preview tests + app settings flag for mentions --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Mauro Romito <mauro.romito@element.io>
This commit is contained in:
@@ -17,9 +17,10 @@ enum RoomListFilter: Int, CaseIterable, Identifiable {
|
||||
}
|
||||
|
||||
case unreads
|
||||
case mentions
|
||||
case favourites
|
||||
case people
|
||||
case rooms
|
||||
case favourites
|
||||
case invites
|
||||
case lowPriority
|
||||
|
||||
@@ -35,6 +36,8 @@ enum RoomListFilter: Int, CaseIterable, Identifiable {
|
||||
return L10n.screenRoomlistFilterRooms
|
||||
case .unreads:
|
||||
return L10n.screenRoomlistFilterUnreads
|
||||
case .mentions:
|
||||
return L10n.screenRoomlistFilterMention
|
||||
case .favourites:
|
||||
return L10n.screenRoomlistFilterFavourites
|
||||
case .invites:
|
||||
@@ -52,10 +55,12 @@ enum RoomListFilter: Int, CaseIterable, Identifiable {
|
||||
return [.people, .invites]
|
||||
case .unreads:
|
||||
return [.invites]
|
||||
case .mentions:
|
||||
return [.invites]
|
||||
case .favourites:
|
||||
return [.invites, .lowPriority]
|
||||
case .invites:
|
||||
return [.rooms, .people, .unreads, .favourites, .lowPriority]
|
||||
return [.rooms, .people, .unreads, .mentions, .favourites, .lowPriority]
|
||||
case .lowPriority:
|
||||
return [.favourites, .invites]
|
||||
}
|
||||
@@ -68,7 +73,9 @@ enum RoomListFilter: Int, CaseIterable, Identifiable {
|
||||
case .rooms:
|
||||
return .all(filters: [.category(expect: .group), .joined])
|
||||
case .unreads:
|
||||
return .all(filters: [.unread, .joined])
|
||||
return .all(filters: [.readReceipts(expect: .notifications), .joined])
|
||||
case .mentions:
|
||||
return .all(filters: [.readReceipts(expect: .mentions), .joined])
|
||||
case .favourites:
|
||||
return .all(filters: [.favourite, .joined])
|
||||
case .invites:
|
||||
@@ -96,6 +103,10 @@ struct RoomListFiltersState {
|
||||
availableFilters.remove(.lowPriority)
|
||||
}
|
||||
|
||||
if !appSettings.mentionsFilterEnabled {
|
||||
availableFilters.remove(.mentions)
|
||||
}
|
||||
|
||||
for filter in activeFilters {
|
||||
availableFilters.remove(filter)
|
||||
filter.incompatibleFilters.forEach { availableFilters.remove($0) }
|
||||
|
||||
@@ -16,6 +16,8 @@ struct RoomListFiltersEmptyStateView: View {
|
||||
switch state.activeFilters[0] {
|
||||
case .unreads:
|
||||
return L10n.screenRoomlistFilterUnreadsEmptyStateTitle
|
||||
case .mentions:
|
||||
return L10n.screenRoomlistFilterMentionEmptyStateTitle
|
||||
case .people:
|
||||
return L10n.screenRoomlistFilterPeopleEmptyStateTitle
|
||||
case .rooms:
|
||||
|
||||
+1
@@ -63,6 +63,7 @@ protocol DeveloperOptionsProtocol: AnyObject {
|
||||
|
||||
var fuzzyRoomListSearchEnabled: Bool { get set }
|
||||
var lowPriorityFilterEnabled: Bool { get set }
|
||||
var mentionsFilterEnabled: Bool { get set }
|
||||
var knockingEnabled: Bool { get set }
|
||||
|
||||
var linkPreviewsEnabled: Bool { get set }
|
||||
|
||||
+4
@@ -75,6 +75,10 @@ struct DeveloperOptionsScreen: View {
|
||||
Text("Low priority filter")
|
||||
}
|
||||
|
||||
Toggle(isOn: $context.mentionsFilterEnabled) {
|
||||
Text("Mentions filter")
|
||||
}
|
||||
|
||||
Toggle(isOn: $context.automaticBackPaginationEnabled) {
|
||||
Text("Automatic back pagination")
|
||||
Text("Requires app reboot")
|
||||
|
||||
Reference in New Issue
Block a user