Feature/per room notification channels - #7145
Conversation
|
Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:
|
6767740 to
639cef1
Compare
3d73fe6 to
26c9c3f
Compare
7de8a60 to
5829297
Compare
0f6bd80 to
f610e94
Compare
|
can someone may approve the workflow runs? maybe @ganfra ? |
Add a RoomNotificationChannelManager that creates room-scoped Android notification channels for noisy room notifications. Channels are grouped as Private chats or Rooms, skip silent notifications, respect PIN privacy by falling back to the shared channel, and preserve the shared noisy channel sound. The manager also prunes stale unmodified channels.
Route notification creation through RoomNotificationChannelManager. Reuse the existing conversation lifecycle hooks to delete room channels when rooms or sessions disappear, and to clear them when PIN privacy is enabled.
Refresh a room shortcut when the first incoming non-thread notification is received, not only when the user sends a message. This gives room channels an Android conversation shortcut, icon, and avatar before the user replies.
Split conversation updates into sent and received paths. Sent text and attachment messages refresh the shortcut and create a room channel only when the room notification mode is ALL_MESSAGES. Received messages still only refresh the shortcut; notification creation handles their per-event noisiness.
Add a room notification settings intent provider that opens the Android channel settings for a Matrix room. Use the conversation id on Android 11 and newer, fall back to channel settings on Android 8-10, and app settings before channels exist. Expose the entry point from the room notification settings screen and cover the API-level intent behavior with focused tests.
Publish the room shortcut before opening Android notification settings so the platform can resolve the conversation name and icon. Propagate room avatar metadata into shortcuts, add fallback icons, and keep shortcut and locus IDs aligned on room notifications.
Mark room channel creation as API 26-only so lint accepts the guarded NotificationChannel access. Remove stale preview exceptions from the Konsist test list.
f610e94 to
8bb5e49
Compare
|
Thanks for the contribution. I do personally like the the way you've grouped rooms and DMs and added options to create and customise conversations for rooms, but I'm not sure if we want the whole 'everything that receives a notification is now a conversation, but up to a max of X', which also adds extra complexity since we now have to track which channels are new/old or were modified. Also, the fact that this seems heavily vibe-coded makes me a bit uneasy. @mxandreas this PR seems promising, although I'm not sure if we want to keep the whole logic. To explain this a bit, this has the following pros:
And, at least in my opinion, a big con: For each notification you receive for a room you haven't been notified in before, a new notification channel is created, and it's marked as a conversation. This could flood the OS notification settings of the app with lots of conversations (at least on my Android 15 device I have now 10 conversations basically filling the whole screen space until I scroll down), and having them being added so easily feels a bit wrong. Also, it makes us need to have lots of logic to track which conversations/channels are outdated and should be replaced, which ones have been modified and we shouldn't touch, etc. I also think it's using the wrong storage location for that (a preferences text file instead of a proper database). I think we'd be interested in these changes, but instead of automatically adding the rooms as conversations as soon as you receive something, maybe we could have some toggle on the room notification settings screen to manually mark the room as a conversation on Android, and allow this customisation and prioritisation. I think it should be fairly easy with the code added in this PR. What do you think? This is an example of what could be customised, and how it works in this PR: Screen_recording_20260722_162641.mp4 |
|
Unfortunately, I currently do not have time to do a deep dive into this and give a more specific answer. However, at the conceptual level, the issue is that notifications overall aren't yet stable enough - we have seen challenges in various areas and levels - issues related to Android OS, issues related to the app notification settings, issues related to push rules complexity, issues specific to air-gapped networks, etc. Therefore, I think we should not yet introduce more options and flexibility into this area. |
Content
Automatically creates a per-room notification channel the first time a room notifies you, grouped under new "Private chats"/"Rooms" categories, so any room can appear as an Android Conversation and be marked Priority.
Motivation and context
You can prioritize certain chats and Element-X is closer integrated in the Android Conversation system.
Screenshots / GIFs
Tests
Tested devices
Checklist