fix: last-seen backfill, report-style date filter, hover overflow (batch84)
#1 Last seen still read "Offline": last_seen is a NEW column, so every existing user was NULL until they happened to reconnect. Backfill it from the newest message each user sent (best evidence we already have), and also stamp it on message send — not just on connect/disconnect — so it stays fresh if a socket never closes cleanly. #3 Past-meetings filter is a report filter now: presets (Today, Yesterday, Last 7/30 days, This month, Year to date, All time) plus a Custom range that uses the SAME branded calendar popup as the scheduler. The raw <input type=date> looked foreign and behaved differently per browser. #4 Hover action row overflowed off-panel on SHORT received messages: it's wider than the bubble and was anchored to the bubble's right edge, so it ran off the left. Received bubbles now anchor it from the left (growing into the empty space); own messages keep the right anchor. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -228,6 +228,14 @@ try { db.exec('ALTER TABLE users ADD COLUMN bizgaze_user_id TEXT'); } catch (e)
|
||||
// #2: when this user was last connected (stamped on connect + on their last socket closing), so contacts
|
||||
// can show "last seen 10 minutes ago" instead of a bare "Offline".
|
||||
try { db.exec('ALTER TABLE users ADD COLUMN last_seen INTEGER'); } catch (e) { /* exists */ }
|
||||
// Backfill: the column is new, so every existing user was NULL and therefore still read as a bare
|
||||
// "Offline" until they happened to reconnect. Seed it from the last message they sent — the best
|
||||
// evidence we already have of when they were last around. Only fills rows that are still NULL.
|
||||
try {
|
||||
db.exec(`UPDATE users SET last_seen = (
|
||||
SELECT MAX(created_at) FROM messages WHERE messages.sender_id = users.id
|
||||
) WHERE last_seen IS NULL AND EXISTS (SELECT 1 FROM messages WHERE messages.sender_id = users.id)`);
|
||||
} catch (e) { /* messages table may not exist yet on a fresh db */ }
|
||||
// External (non-Connect) invitee emails on a scheduled meeting (#4) — JSON array. They get an emailed
|
||||
// guest join link instead of an in-app invite.
|
||||
try { db.exec('ALTER TABLE scheduled_meetings ADD COLUMN guest_emails TEXT'); } catch (e) { /* exists */ }
|
||||
|
||||
Reference in New Issue
Block a user