Show the unread notification count on the chats tab

Set the chats tab's badge count from the same value used for the app badge.
The tab bar already renders it through the .badge modifier but that has no
effect outside of a TabView or List, so the iPad tab rail now overlays a
small NotificationCountBadge instead.
This commit is contained in:
Stefan Ceriu
2026-10-08 14:30:33 +03:00
parent ab39d8de06
commit 46eb23fa64
2 changed files with 8 additions and 1 deletions
@@ -447,7 +447,12 @@ struct TabRailView<Tag: Hashable>: View {
}
.buttonStyle(TabButtonStyle(isSelected: isSelected))
.accessibilityAddTraits(isSelected ? .isSelected : [])
.badge(10) // TODO: Check if this works.
.overlay(alignment: .topTrailing) {
if module.details.badgeCount > 0 {
NotificationCountBadge(count: module.details.badgeCount, size: .small)
.allowsHitTesting(false)
}
}
}
}
.padding(.horizontal, 8)
@@ -540,6 +540,8 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
let badgeCount = Int(userSession.clientProxy.totalUnreadNotifications)
chatsTabDetails.badgeCount = badgeCount
await flowParameters.notificationManager.removeDeliveredNotificationsForFullyReadRooms(roomSummaries)
await flowParameters.notificationManager.updateAppBadgeCount(badgeCount)
}