feat(web-core): implement unread counters and new-messages divider
Some checks failed
CI / test (push) Failing after 19s
Some checks failed
CI / test (push) Failing after 19s
backend: - add unread_count to ChatRead serialization - compute unread_count per chat using message_receipts and hidden messages web: - add unread badges in chat list - track unread boundary per chat in store - show 'New messages' divider in message list - update realtime flow to increment/clear unread on incoming events
This commit is contained in:
@@ -69,6 +69,9 @@ export function useRealtime() {
|
||||
ws.send(JSON.stringify({ event: "message_delivered", payload: { chat_id: chatId, message_id: message.id } }));
|
||||
if (chatId === chatStore.activeChatId) {
|
||||
ws.send(JSON.stringify({ event: "message_read", payload: { chat_id: chatId, message_id: message.id } }));
|
||||
chatStore.clearUnread(chatId);
|
||||
} else {
|
||||
chatStore.incrementUnread(chatId);
|
||||
}
|
||||
}
|
||||
if (!chatStore.chats.some((chat) => chat.id === chatId)) {
|
||||
|
||||
Reference in New Issue
Block a user