Record sent chats in messages repo and blur gallery by default

Threads MessagesRepository through ChatService so first outgoing chat
messages are persisted for stats, and extends the repo + DB client to
support chat-room-keyed lookups. Adds tests covering the new behavior.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
jjbruntonandClaude Opus 4.7 committed 2026-05-22 18:48:14 +01:00
1 parent 2260388dc8
commit 05c95db6bd
10 files changed
+197 -6

No files matched your search

+52
View File
@@ -1515,6 +1515,39 @@
filter: none;
}
.media-grid.revealed-all .media-card img {
filter: none;
}
.unblur-all-btn {
padding: 7px 13px;
border-radius: var(--r-pill);
background: var(--card);
color: var(--ink-soft);
border-color: var(--rule);
font-size: 12px;
font-family: var(--f-body);
font-weight: 500;
cursor: pointer;
box-shadow: var(--shadow-sm);
transition: transform .15s ease, background .2s ease, box-shadow .2s ease, color .2s ease;
display: inline-flex;
align-items: center;
gap: 5px;
white-space: nowrap;
}
.unblur-all-btn:hover {
background: var(--card-2);
color: var(--ink);
}
.unblur-all-btn.active {
background: var(--terracotta-soft);
color: var(--terracotta-deep);
border-color: rgba(201, 123, 94, .35);
}
.media-meta {
padding: 11px 13px;
display: flex;
@@ -2340,6 +2373,10 @@
title="Walks every joined chat from scratch and re-downloads all history + media. Slow (~1–2 min). Use after long absences, missing rooms, or to rebuild the cache."
>Full sync</button>
<button class="refresh-btn" onclick="fetchMedia()" id="refresh-media-btn" style="margin-left: 8px;">Refresh view</button>
<button class="unblur-all-btn" id="unblur-all-btn" onclick="toggleUnblurAll()" title="Toggle blur on all gallery images">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>
Unblur all
</button>
</div>
<div class="panel-content media-grid" id="media-grid">
<div class="empty-state">No media cached yet</div>
@@ -3091,6 +3128,21 @@
}
}
let isUnblurAll = false;
function toggleUnblurAll() {
isUnblurAll = !isUnblurAll;
const grid = document.getElementById('media-grid');
const btn = document.getElementById('unblur-all-btn');
if (isUnblurAll) {
grid.classList.add('revealed-all');
btn.classList.add('active');
} else {
grid.classList.remove('revealed-all');
btn.classList.remove('active');
}
}
// Timer Logic
let timerState = {
nextMessageAvailableAt: null,