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);
transition: var(--transition-default);
}
.lt-sidebar.collapsed { width: 32px; overflow: hidden; }
.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.collapsed { display: none; }
.lt-sidebar-header {
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-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
<h1 class="lt-cursor">SYSTEM STATUS</h1>
+4 -1
View File
@@ -391,7 +391,10 @@
let combo = '';
if (e.ctrlKey || e.metaKey) combo += 'ctrl+';
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();
const alwaysFire = e.key === 'Escape' || e.ctrlKey || e.metaKey;
if (inInput && !alwaysFire) return;
+12 -24
View File
@@ -3,15 +3,11 @@
*/
function toggleSidebar() {
const sidebar = document.getElementById('lt-sidebar');
const btn = document.getElementById('lt-sidebar-toggle-btn');
if (!sidebar) return;
const isCollapsed = sidebar.classList.toggle('collapsed');
const btn = sidebar.querySelector('.lt-sidebar-toggle');
if (btn) {
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');
const isHidden = sidebar.classList.toggle('collapsed');
localStorage.setItem('sidebarCollapsed', isHidden ? 'true' : 'false');
if (btn) btn.textContent = isHidden ? '\u22EE\u22EE Show Filters' : '\u22EE\u22EE Filters';
}
/**
@@ -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() {
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) {
sidebar.classList.add('collapsed');
const btn = sidebar.querySelector('.lt-sidebar-toggle');
if (btn) {
btn.textContent = '\u25B6';
btn.setAttribute('aria-label', 'Expand filter sidebar');
btn.setAttribute('aria-expanded', 'false');
}
if (toggleBtn) toggleBtn.textContent = '\u22EE\u22EE Show Filters';
}
// Bind directly — bypass event delegation entirely so it works
// regardless of isDashboard guard or overflow/clipping issues
document.querySelectorAll('.lt-sidebar-toggle').forEach(function(btn) {
btn.addEventListener('click', function(e) {
e.stopPropagation();
toggleSidebar();
});
});
if (toggleBtn) {
toggleBtn.addEventListener('click', toggleSidebar);
}
});
// Main initialization