fix: remove diagnostics modal icon from UI

- Removed diagnostics icon button from header
- Removed JavaScript code that managed icon visibility
- Removed event listener for diagnostics icon click
- Diagnostics functionality remains available in settings menu

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
courtmanr@gmail.com
2025-05-31 21:16:19 +01:00
parent 9e4f8134d5
commit bba5e6be09
2 changed files with 0 additions and 67 deletions
-62
View File
@@ -455,12 +455,6 @@
<span class="text-lg font-medium text-gray-800 dark:text-gray-200">Pulse</span>
</div>
<div class="header-controls flex justify-end items-center gap-4 md:flex-1">
<button id="diagnostics-icon" type="button" class="hidden p-1 rounded-md text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 focus:outline-none relative" title="Run Diagnostics" aria-label="Run diagnostics">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
</svg>
<span id="diagnostics-badge" class="absolute -top-1 -right-1 h-2 w-2 bg-red-500 rounded-full hidden animate-pulse"></span>
</button>
<button id="settings-button" type="button" class="p-1 h-11 w-11 sm:h-auto sm:w-auto rounded-md text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 focus:outline-none" title="Settings" aria-label="Open settings">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle>
@@ -922,62 +916,6 @@
<!-- <script src="/app.js" defer></script> -->
<script src="/js/config.js" defer></script>
<script>
// Diagnostic icon visibility checker
(function() {
const checkDiagnostics = async () => {
try {
const response = await fetch('/api/diagnostics/check');
if (response.ok) {
const data = await response.json();
const icon = document.getElementById('diagnostics-icon');
const badge = document.getElementById('diagnostics-badge');
if (data.hasIssues) {
icon.classList.remove('hidden');
if (data.severity === 'error') {
badge.classList.remove('hidden');
} else {
badge.classList.add('hidden');
}
// Update tooltip with issue count
if (data.issueCount) {
icon.title = `Run Diagnostics (${data.issueCount} issue${data.issueCount > 1 ? 's' : ''} detected)`;
}
} else {
icon.classList.add('hidden');
}
}
} catch (error) {
console.error('Failed to check diagnostics:', error);
}
};
// Check immediately after DOM loads
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', checkDiagnostics);
} else {
checkDiagnostics();
}
// Check periodically
setInterval(checkDiagnostics, 300000); // Every 5 minutes
// Also check when socket reconnects
if (window.io) {
const checkOnConnect = () => {
const socket = window.PulseApp?.socket;
if (socket) {
socket.on('connect', () => {
setTimeout(checkDiagnostics, 5000); // Check 5 seconds after connection
});
} else {
setTimeout(checkOnConnect, 100);
}
};
checkOnConnect();
}
})();
</script>
<script src="/js/state.js" defer></script>
<script src="/js/debounce.js" defer></script>
-5
View File
@@ -22,11 +22,6 @@ PulseApp.ui.settings = (() => {
settingsButton.addEventListener('click', openModal);
}
// Set up diagnostics button
const diagnosticsButton = document.getElementById('diagnostics-icon');
if (diagnosticsButton) {
diagnosticsButton.addEventListener('click', () => openModalWithTab('diagnostics'));
}
if (closeButton) {
closeButton.addEventListener('click', closeModal);