Fix sidebar toggle, ? shortcut, footer hint styling

- Sidebar: replace 32px overflow:hidden collapse with display:none — eliminates pointer-event/layout issues; button label toggles between 'Filters' and 'Show Filters'
- Keyboard shortcut ?: fix keydown handler to omit shift+ prefix for symbol keys (shift state already encoded in e.key), so '?' registration matches correctly
- Footer: add missing CSS for .lt-footer-hint, .lt-footer-key, .lt-footer-sep — resets button defaults so CFG/HELP render identically to link-style hints

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-06 23:52:06 -04:00
parent 424f3f9f95
commit 8e8a63fa7d
4 changed files with 46 additions and 36 deletions
+28 -5
View File
@@ -1449,11 +1449,7 @@ select option:checked {
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
transition: var(--transition-default); transition: var(--transition-default);
} }
.lt-sidebar.collapsed { width: 32px; overflow: hidden; } .lt-sidebar.collapsed { display: none; }
.lt-sidebar.collapsed .lt-sidebar-body { display: none; }
.lt-sidebar.collapsed .lt-sidebar-header { justify-content: center; padding: 0.5rem 0; border-bottom: none; }
.lt-sidebar.collapsed .lt-sidebar-header > span:first-child { display: none; }
.lt-sidebar.collapsed .lt-sidebar-toggle { font-size: 0.8rem; padding: 0.4rem; color: var(--accent-cyan); }
.lt-sidebar-header { .lt-sidebar-header {
display: flex; display: flex;
@@ -5589,6 +5585,33 @@ body.lt-is-offline .lt-main { margin-top: 2rem; transition: margin-top 0.25s eas
.lt-footer { flex-direction: column; align-items: flex-start; gap: 0.25rem; } .lt-footer { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
} }
.lt-footer-hints { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; }
.lt-footer-hint {
/* reset button defaults */
all: unset;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 0.25rem;
color: var(--text-muted);
font-size: 0.7rem;
font-family: var(--font-mono);
white-space: nowrap;
}
.lt-footer-hint:hover { color: var(--accent-cyan); }
.lt-footer-hint:focus-visible { outline: 1px dashed var(--accent-cyan); outline-offset: 2px; }
.lt-footer-key {
color: var(--accent-cyan);
opacity: 0.8;
}
.lt-footer-sep {
color: var(--border-dim);
user-select: none;
}
/* ================================================================ /* ================================================================
BLINKING CURSOR BLINKING CURSOR
<h1 class="lt-cursor">SYSTEM STATUS</h1> <h1 class="lt-cursor">SYSTEM STATUS</h1>
+4 -1
View File
@@ -391,7 +391,10 @@
let combo = ''; let combo = '';
if (e.ctrlKey || e.metaKey) combo += 'ctrl+'; if (e.ctrlKey || e.metaKey) combo += 'ctrl+';
if (e.altKey) combo += 'alt+'; if (e.altKey) combo += 'alt+';
if (e.shiftKey) combo += 'shift+'; // Only add shift+ for letter keys — for symbol keys (?, !, @, etc.) the shift state
// is already encoded in e.key itself, so adding shift+ would break registrations like '?'.
const isLetter = e.key.length === 1 && /[a-zA-Z]/.test(e.key);
if (e.shiftKey && isLetter) combo += 'shift+';
combo += e.key.toLowerCase(); combo += e.key.toLowerCase();
const alwaysFire = e.key === 'Escape' || e.ctrlKey || e.metaKey; const alwaysFire = e.key === 'Escape' || e.ctrlKey || e.metaKey;
if (inInput && !alwaysFire) return; if (inInput && !alwaysFire) return;
+11 -23
View File
@@ -3,15 +3,11 @@
*/ */
function toggleSidebar() { function toggleSidebar() {
const sidebar = document.getElementById('lt-sidebar'); const sidebar = document.getElementById('lt-sidebar');
const btn = document.getElementById('lt-sidebar-toggle-btn');
if (!sidebar) return; if (!sidebar) return;
const isCollapsed = sidebar.classList.toggle('collapsed'); const isHidden = sidebar.classList.toggle('collapsed');
const btn = sidebar.querySelector('.lt-sidebar-toggle'); localStorage.setItem('sidebarCollapsed', isHidden ? 'true' : 'false');
if (btn) { if (btn) btn.textContent = isHidden ? '\u22EE\u22EE Show Filters' : '\u22EE\u22EE Filters';
btn.textContent = isCollapsed ? '\u25B6' : '\u25C0';
btn.setAttribute('aria-label', isCollapsed ? 'Expand filter sidebar' : 'Collapse filter sidebar');
btn.setAttribute('aria-expanded', isCollapsed ? 'false' : 'true');
}
localStorage.setItem('sidebarCollapsed', isCollapsed ? 'true' : 'false');
} }
/** /**
@@ -76,28 +72,20 @@ function initMobileSidebar() {
} }
// Restore sidebar state and bind toggle button directly (no event delegation) // Restore sidebar state and bind toggle button
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
const savedState = localStorage.getItem('sidebarCollapsed'); const savedState = localStorage.getItem('sidebarCollapsed');
const sidebar = document.getElementById('lt-sidebar'); const sidebar = document.getElementById('lt-sidebar');
const toggleBtn = document.getElementById('lt-sidebar-toggle-btn');
if (savedState === 'true' && sidebar) { if (savedState === 'true' && sidebar) {
sidebar.classList.add('collapsed'); sidebar.classList.add('collapsed');
const btn = sidebar.querySelector('.lt-sidebar-toggle'); if (toggleBtn) toggleBtn.textContent = '\u22EE\u22EE Show Filters';
if (btn) {
btn.textContent = '\u25B6';
btn.setAttribute('aria-label', 'Expand filter sidebar');
btn.setAttribute('aria-expanded', 'false');
}
} }
// Bind directly — bypass event delegation entirely so it works if (toggleBtn) {
// regardless of isDashboard guard or overflow/clipping issues toggleBtn.addEventListener('click', toggleSidebar);
document.querySelectorAll('.lt-sidebar-toggle').forEach(function(btn) { }
btn.addEventListener('click', function(e) {
e.stopPropagation();
toggleSidebar();
});
});
}); });
// Main initialization // Main initialization
+2 -6
View File
@@ -409,12 +409,6 @@ include __DIR__ . '/layout_header.php';
<aside class="lt-sidebar" id="lt-sidebar" role="complementary" aria-label="Filter options"> <aside class="lt-sidebar" id="lt-sidebar" role="complementary" aria-label="Filter options">
<div class="lt-sidebar-header"> <div class="lt-sidebar-header">
<span>Filters</span> <span>Filters</span>
<button type="button" class="lt-sidebar-toggle"
data-action="toggle-sidebar"
data-sidebar-toggle="lt-sidebar"
aria-label="Collapse filter sidebar"
aria-expanded="true"
aria-controls="lt-sidebar">&#x25C0;</button>
</div> </div>
<div class="lt-sidebar-body" id="dashboardSidebar"> <div class="lt-sidebar-body" id="dashboardSidebar">
@@ -506,6 +500,8 @@ include __DIR__ . '/layout_header.php';
<!-- Toolbar: search + export + count --> <!-- Toolbar: search + export + count -->
<div class="lt-toolbar"> <div class="lt-toolbar">
<div class="lt-toolbar-left"> <div class="lt-toolbar-left">
<button type="button" id="lt-sidebar-toggle-btn" class="lt-btn lt-btn-ghost lt-btn-sm"
aria-label="Toggle filter sidebar" title="Toggle filters">&#x22EE;&#x22EE; Filters</button>
<form method="GET" action="" class="lt-search-form" role="search"> <form method="GET" action="" class="lt-search-form" role="search">
<?php foreach (['status','category','type','sort','dir'] as $p): ?> <?php foreach (['status','category','type','sort','dir'] as $p): ?>
<?php if (isset($_GET[$p])): ?> <?php if (isset($_GET[$p])): ?>