fix: Unread notificaitons on startup

This commit is contained in:
2026-06-04 18:18:22 +02:00
parent 161f57f52e
commit 6d021a296b
6 changed files with 227 additions and 6 deletions

View File

@@ -25,6 +25,13 @@ Durable rules for AI agents working on this project. Read this file at session s
## Lessons
### Re-clear visible notification channels after recompute [notifications] [startup]
- **Trigger:** fixing startup unread badges by only changing read-marker writes or initial hydration.
- **Rule:** also check later `loadMessagesSuccess` and `syncMessages` recomputes, and re-clear the focused visible channel after applying derived unread counts.
- **Why:** the startup-selected server can load or sync messages after it was marked read, reintroducing a channel unread badge even though the user is viewing that channel.
- **Example:** `NotificationsService.refreshRoomUnreadFromMessages(...)` should clear `activeChannelId` for `currentRoom` after recalculating counts from a startup message batch.
### Disambiguate nested chat cards [chat] [ui]
- **Trigger:** removing a visual treatment from chat history when a system message has both an outer row wrapper and an inner pill/card.