Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

simplify: single-pass severity counts, remove unused dot property

Adam Eivycd529920bfa7
diff --git a/client/src/components/ProactiveAlertsWidget.jsx b/client/src/components/ProactiveAlertsWidget.jsx
index a19a9cbcf6..5cff8c9ae8 100644
--- a/client/src/components/ProactiveAlertsWidget.jsx
+++ b/client/src/components/ProactiveAlertsWidget.jsx
@@ -15,9 +15,9 @@ import * as api from '../services/api';
import { useAutoRefetch } from '../hooks/useAutoRefetch';
const SEVERITY_STYLES = {
- critical: { bg: 'bg-port-error/10', text: 'text-port-error', border: 'border-port-error/30', dot: 'bg-port-error' },
- high: { bg: 'bg-port-warning/10', text: 'text-port-warning', border: 'border-port-warning/30', dot: 'bg-port-warning' },
- medium: { bg: 'bg-port-accent/10', text: 'text-port-accent', border: 'border-port-accent/30', dot: 'bg-port-accent' }
+ critical: { bg: 'bg-port-error/10', text: 'text-port-error', border: 'border-port-error/30' },
+ high: { bg: 'bg-port-warning/10', text: 'text-port-warning', border: 'border-port-warning/30' },
+ medium: { bg: 'bg-port-accent/10', text: 'text-port-accent', border: 'border-port-accent/30' }
};
const TYPE_ICONS = {
diff --git a/server/services/proactiveAlerts.js b/server/services/proactiveAlerts.js
index bbce7f7e30..5e7b3a32d7 100644
--- a/server/services/proactiveAlerts.js
+++ b/server/services/proactiveAlerts.js
@@ -182,19 +182,16 @@ export async function generateAlerts() {
const severityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
all.sort((a, b) => (severityOrder[a.severity] ?? 3) - (severityOrder[b.severity] ?? 3));
+ // Single-pass severity counts
+ const counts = { total: all.length, critical: 0, high: 0, medium: 0 };
+ for (const a of all) {
+ if (counts[a.severity] !== undefined) counts[a.severity]++;
+ }
+
const durationMs = Date.now() - startMs;
- console.log(`🔔 Proactive alerts: ${all.length} alert${all.length !== 1 ? 's' : ''} generated in ${durationMs}ms`);
+ console.log(`🔔 Proactive alerts: ${counts.total} (critical: ${counts.critical}, high: ${counts.high}) in ${durationMs}ms`);
- return {
- alerts: all,
- counts: {
- total: all.length,
- critical: all.filter(a => a.severity === 'critical').length,
- high: all.filter(a => a.severity === 'high').length,
- medium: all.filter(a => a.severity === 'medium').length
- },
- checkedAt: new Date().toISOString()
- };
+ return { alerts: all, counts, checkedAt: new Date().toISOString() };
}
/**