Turn the Messages rail into a real conversation list
Every channel and direct conversation is now its own row the way messengers work: avatar or channel glyph, name, last-message preview, relative time, and a true unread count from per-employee read state (the old badge showed total message count). Rows sort by latest activity and the newest conversation opens by default. Direct rows title themselves after the counterpart resolved from memberships; agent-to-agent conversations the board observes keep their two-name title, and opening one clears its unread because read state is per-employee bookkeeping, not access control. Conversation rows get their own .convo-item style instead of fighting the sidebar's single-line nav-item rules.
This commit is contained in:
1 parent
cab7b01831
commit
d528cd6f75
5 files changed
+231
-96
No files matched your search
@@ -212,7 +212,9 @@ export class ChatService {
|
||||
const employee = this.db.prepare("select id from employees where id = ? and org_id = ?")
|
||||
.get(input.employeeId, input.orgId) as { id: string } | undefined;
|
||||
if (!employee) throw new Error("Employee was not found.");
|
||||
this.requireMembership(input.spaceId, { type: "employee", id: input.employeeId });
|
||||
// Read state is per-employee bookkeeping, not access control: the board
|
||||
// observes every conversation in its org (agent↔agent directs included),
|
||||
// so opening one clears its unread count even without membership.
|
||||
const latest = this.db.prepare(`
|
||||
select id from chat_messages
|
||||
where space_id = ? and org_id = ?
|
||||
|
||||
Reference in new issue
Block a user