feat(chat): unread badges, last-message previews, relative timestamps

Sidebar now shows:
- aggregate unread count banner at top
- per-thread last-message preview (You: prefix when self-sent)
- relative timestamp on each thread (just now / Xm ago / Xh ago / Xd ago)
- amber unread dot + bold name for threads with new messages from others

Read state stored in localStorage per-user (fm.canvas.chat.read.<email>).
Auto-marked read when a thread is opened. Pure client-side; no extra EA2
writes beyond the existing listMessages calls.
This commit is contained in:
2026-06-14 14:58:21 +04:00
parent 15ab8ededa
commit 0266c77875
2 changed files with 105 additions and 11 deletions
+17
View File
@@ -2009,3 +2009,20 @@ select.studio-input { background: var(--bp-paper); }
.hub-queue-row.active { background: color-mix(in srgb, var(--bp-amber) 30%, var(--bp-paper)); border-color: var(--bp-navy); }
.hub-queue-name { flex: 1; }
@media (max-width: 900px) { .hub-split { grid-template-columns: 1fr; } }
.chat-unread-summary {
padding: 8px 12px;
background: color-mix(in srgb, var(--bp-amber) 25%, var(--bp-paper));
border-bottom: 1px solid var(--bp-navy);
font-family: var(--bp-mono); font-size: 10px; letter-spacing: 0.08em;
color: var(--bp-navy); text-transform: uppercase;
}
.chat-thread-row { position: relative; }
.chat-thread-row.unread .chat-thread-name { font-weight: 700; }
.chat-thread-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chat-thread-time { font-family: var(--bp-mono); font-size: 9px; color: var(--bp-muted); flex-shrink: 0; }
.chat-unread-dot {
position: absolute; right: 8px; top: 8px;
width: 6px; height: 6px; border-radius: 50%;
background: var(--bp-amber);
}