Track per-employee chat read state and surface real unread counts

Adds chat_read_state migration (employee_id + space_id, last read
message + timestamp) wired through ChatService.markSpaceRead, IPC
markChatSpaceRead, and an effect in ChatPage that flushes the active
space whenever the latest message id changes.

Shell.computeBadges now derives the Messages badge from
(message.createdAt > read_state.last_read_at) minus messages the viewer
sent, so the sidebar shows true unread instead of total throughput.
This commit is contained in:
ZacharyZhang-NY committed 2026-05-21 20:25:07 -04:00
1 parent b44e0e3657
commit 1f78ae6f2e
11 files changed
+100 -3

No files matched your search

+1
View File
@@ -17,6 +17,7 @@ const api: DesktopApi = {
decideApproval: (input) => invoke(IPC_CHANNELS.decideApproval, input),
createChatSpace: (input) => invoke(IPC_CHANNELS.createChatSpace, input),
sendMessage: (input) => invoke(IPC_CHANNELS.sendMessage, input),
markChatSpaceRead: (input) => invoke(IPC_CHANNELS.markChatSpaceRead, input),
saveProviderCredential: (input) => invoke(IPC_CHANNELS.saveProviderCredential, input),
createProviderResponse: (input) => invoke(IPC_CHANNELS.createProviderResponse, input),
importSkillDirectory: (input) => invoke(IPC_CHANNELS.importSkillDirectory, input),