fixes: scratchpad, zen ESC, chat time, tooltip safety, collab sync race
- Scratchpad: card-scoped private notes in editor (toggle vs preview), smaller font, cleared via button, stored in cards.scratchpad - Zen mode: ESC exits zen before closing detail, Z toggles zen - Chat: always show absolute time (hh:mm, yesterday, or date+time) - Backspace/Delete also deletes focused card (not just selected) - Selected + focused cards use brand accent (not accent2) - Tooltip: guard against non-element targets - Collab sync: skip poll while editor is open, 2s push debounce - Rrule test: only check geburtstag tag, not title format Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
2169c1de1b
commit
7e2b130434
11 files changed
+92
-30
No files matched your search
+13
-1
@@ -722,7 +722,7 @@ async function loadChatHistory(peer, quiet = false) {
|
||||
container.innerHTML = messages.map(m => `
|
||||
<div class="chat-msg ${m.mine ? 'mine' : 'theirs'}">
|
||||
<div>${escapeHtml(m.body)}</div>
|
||||
<div class="msg-time">${formatRelTime(m.created_at)}${m.mine && m.seen ? ' <i class="ph ph-checks"></i>' : ''}</div>
|
||||
<div class="msg-time">${formatChatTime(m.created_at)}${m.mine && m.seen ? ' <i class="ph ph-checks"></i>' : ''}</div>
|
||||
</div>
|
||||
`).join('');
|
||||
|
||||
@@ -750,6 +750,18 @@ $('chat-input')?.addEventListener('keydown', e => {
|
||||
if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); sendChatMessage(); }
|
||||
});
|
||||
|
||||
function formatChatTime(sqliteUtc) {
|
||||
if (!sqliteUtc) return '';
|
||||
const t = new Date(sqliteUtc.replace(' ', 'T') + 'Z');
|
||||
if (isNaN(t.getTime())) return sqliteUtc;
|
||||
const now = new Date();
|
||||
const time = t.toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' });
|
||||
if (t.toDateString() === now.toDateString()) return time;
|
||||
const yesterday = new Date(now); yesterday.setDate(yesterday.getDate() - 1);
|
||||
if (t.toDateString() === yesterday.toDateString()) return 'yesterday ' + time;
|
||||
return t.toLocaleDateString(undefined, { month: 'short', day: 'numeric' }) + ' ' + time;
|
||||
}
|
||||
|
||||
function formatRelTime(sqliteUtc) {
|
||||
if (!sqliteUtc) return '';
|
||||
// Parse SQLite's "YYYY-MM-DD HH:MM:SS" as UTC by appending Z
|
||||
|
||||
Reference in new issue
Block a user