From 27f135c921b335203a4add88cdd3b5927ce90fae Mon Sep 17 00:00:00 2001 From: Nazim Date: Thu, 26 Mar 2026 17:21:39 +0000 Subject: [PATCH] dashboard: show all notifications with action taken, filter dismissals from activity - Notifications table: show ALL (not just pending), add ACTION TAKEN column showing dismiss reason or pending status. Dismissed rows slightly dimmed. - Activity section: filters out 'dismiss' entries, only shows real actions (reviews, comments, fixes) --- dashboard/index.html | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/dashboard/index.html b/dashboard/index.html index ceb1c44..e391a7f 100644 --- a/dashboard/index.html +++ b/dashboard/index.html @@ -271,7 +271,7 @@ const yesterday = new Date(Date.now() - 86400000).toISOString(); const activity = await fetchData('activity_log', - `SELECT COUNT(*) as c FROM activity_log WHERE timestamp > '${yesterday}'`); + `SELECT COUNT(*) as c FROM activity_log WHERE timestamp > '${yesterday}' AND action != 'dismiss'`); document.getElementById('activity-count').textContent = activity[0]?.c || 0; const escalations = await fetchData('escalations', @@ -287,16 +287,19 @@ `(last poll ${timeAgo(p.polled_at)} — ${p.new_count} new)`; } - // Notifications table — show pending (non-dismissed) by default + // Notifications table — show ALL notifications with action taken const notifications = await fetchData('notifications', - 'SELECT * FROM notifications WHERE dismissed = 0 AND processing = 0 ORDER BY seen_at DESC LIMIT 30'); + `SELECT n.*, a.detail as action_detail, a.action as action_type + FROM notifications n + LEFT JOIN activity_log a ON a.github_url = n.url + ORDER BY n.seen_at DESC LIMIT 30`); if (notifications.length === 0) { document.getElementById('notifications-table').innerHTML = - '
No pending notifications. ✨
'; + '
No notifications yet. ✨
'; } else { let html = ` - + `; for (const n of notifications) { const ownTag = n.is_own_pr ? '🔵 ' : ''; @@ -315,22 +318,30 @@ n.reason === 'author' ? 'success' : n.reason === 'review_requested' ? 'warning' : ''; const reasonBadge = `${n.reason}`; - const filterShort = (n.filter_reason || '').replace(/^KEEP: /, ''); - html += ` + // Action taken column + let actionText = ''; + if (n.action_detail) { + actionText = n.action_detail; + } else if (n.dismissed && n.filter_reason) { + actionText = `dismissed: ${n.filter_reason.replace(/^KEEP \(rule\): /, '')}`; + } else if (!n.dismissed) { + actionText = 'pending'; + } + html += ` - + `; } html += '
TIMEISSUEREASONTITLEFILTER
TIMEISSUEREASONTITLEACTION TAKEN
${timeAgo(n.seen_at)} ${issue} ${reasonBadge} ${ownTag}${n.title || '-'}${ciTag}${filterShort}${actionText}
'; document.getElementById('notifications-table').innerHTML = html; } - // Activity table + // Activity table — filter out dismissals, show only real actions const activityLog = await fetchData('activity_log', - 'SELECT * FROM activity_log ORDER BY timestamp DESC LIMIT 10'); + "SELECT * FROM activity_log WHERE action != 'dismiss' ORDER BY timestamp DESC LIMIT 10"); if (activityLog.length === 0) { document.getElementById('activity-table').innerHTML =