From fbd85157a7bc2e1e04bb4b7c0d92b6f40c500a83 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 8 Jun 2025 13:07:06 +0100 Subject: [PATCH] refactor: remove alerts dropdown and link directly to alert management modal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Alert button now opens alert management modal directly instead of dropdown - Updated tooltip to "Click to manage alerts" - Provides more streamlined access to full alert management interface 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/public/js/alertsHandler.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/public/js/alertsHandler.js b/src/public/js/alertsHandler.js index ba0250fd9..c242d32fd 100644 --- a/src/public/js/alertsHandler.js +++ b/src/public/js/alertsHandler.js @@ -106,7 +106,7 @@ PulseApp.alerts = (() => { const alertsIndicator = document.createElement('div'); alertsIndicator.id = 'alerts-indicator'; alertsIndicator.className = 'text-xs px-1.5 py-0.5 rounded bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 cursor-pointer relative flex-shrink-0 transition-colors'; - alertsIndicator.title = 'Click to view alerts'; + alertsIndicator.title = 'Click to manage alerts'; alertsIndicator.textContent = '0'; // Subtle styling that matches the header aesthetic @@ -193,11 +193,11 @@ PulseApp.alerts = (() => { const clickedIndicator = indicator.contains(e.target); const clickedDropdown = dropdown.contains(e.target); - // If clicking the indicator (but not the dropdown), toggle dropdown + // If clicking the indicator, open alert management modal directly if (clickedIndicator && !clickedDropdown) { e.preventDefault(); e.stopPropagation(); - toggleDropdown(); + openAlertManagementModal(); return; } @@ -219,6 +219,15 @@ PulseApp.alerts = (() => { }); } + function openAlertManagementModal() { + // Open the alert management modal directly on the "Alerts > Current Alerts" tab + if (PulseApp.ui && PulseApp.ui.alertManagementModal) { + PulseApp.ui.alertManagementModal.openModal(); + } else { + console.error('Alert management modal not available'); + } + } + function toggleDropdown() { if (!alertDropdown) return;