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
+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