-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Feature Request
Summary
The matrix-js-sdk provides dedicated thread-specific notification APIs that should be used to properly separate thread notifications from main timeline notifications. Currently, the thread implementation tracks unread status by comparing read receipts, but doesn't leverage the SDK's built-in notification counting.
Available SDK APIs
The matrix-js-sdk Room class provides several thread-specific notification methods:
room.getThreadUnreadNotificationCount(threadId?: string, type?: NotificationCountType)- Get unread notification count for a specific thread or all threadsroom.hasThreadUnreadNotification(threadId?: string)- Check if thread has unread notificationsroom.threadsAggregateNotificationType- Property indicating the aggregate notification type across all threads
These methods properly handle:
- Distinction between mentions/highlights vs regular messages
- Aggregate counts across all threads
- Per-thread notification states
- Integration with Matrix's notification rules
Current Implementation
The current thread implementation (PR #123) uses:
const readUpToId = thread.getEventReadUpTo(userId, false);
if (!readUpToId || readUpToId !== lastEventId) {
unreadCount += 1;
}This works for basic unread tracking but doesn't:
- Distinguish between notification types (highlight vs regular)
- Respect user notification preferences
- Integrate with Matrix notification rules
- Handle muted threads
Proposed Enhancement
- Replace read receipt comparison with
room.getThreadUnreadNotificationCount()for badge counts - Use
room.hasThreadUnreadNotification()to determine badge visibility - Consider
room.threadsAggregateNotificationTypefor badge styling (red for mentions, gray for regular) - Add support for per-thread notification muting using SDK methods
Benefits
- More accurate notification counts respecting Matrix notification rules
- Better UX with highlight distinction (mentions/keywords)
- Consistency with how other Matrix clients handle thread notifications
- Foundation for future features like per-thread notification settings
References
- matrix-js-sdk Room class documentation
- PR feat(threads): implement thread side panel with full functionality #123 (current thread implementation)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request