Show message counts on room list notification badges

This commit is contained in:
Stefan Ceriu
2026-09-03 20:46:48 +03:00
parent 327ca090c5
commit ac183daff8
13 changed files with 55 additions and 14 deletions
@@ -106,6 +106,8 @@ struct HomeScreenViewState: BindableState {
var roomListActivityVisibility: RoomListActivityVisibility = .current
var roomListNotificationCountEnabled = false
var reportRoomEnabled = false
var shouldShowSpaceFilters = false
@@ -193,6 +195,7 @@ struct HomeScreenRoom: Identifiable, Equatable {
let badges: Badges
struct Badges: Equatable {
let isDotShown: Bool
let notificationCount: UInt
let isMentionShown: Bool
let isMuteShown: Bool
let callBadgeType: CallBadgeType
@@ -237,7 +240,7 @@ struct HomeScreenRoom: Identifiable, Equatable {
HomeScreenRoom(id: UUID().uuidString,
roomID: nil,
type: .placeholder,
badges: .init(isDotShown: false, isMentionShown: false, isMuteShown: false, callBadgeType: .none),
badges: .init(isDotShown: false, notificationCount: 0, isMentionShown: false, isMuteShown: false, callBadgeType: .none),
name: "Placeholder room name",
isDirect: false,
isHighlighted: false,
@@ -287,6 +290,7 @@ extension HomeScreenRoom {
roomID: summary.id,
type: type,
badges: .init(isDotShown: isDotShown,
notificationCount: summary.unreadNotificationsCount,
isMentionShown: isMentionShown,
isMuteShown: isMuteShown,
callBadgeType: callBadge),