fix: CRITICAL - Restore sidebar visibility in landscape mode
Fixed critical issue where sidebars were completely collapsed/hidden in landscape mode, showing only 33px accordion headers instead of full content. ROOT CAUSE: - Sidebar accordions (<details> elements) were collapsed by default - Native <details> browser behavior prevented CSS-only expansion - Sidebar content was present but hidden behind collapsed accordion SOLUTION: 1. JavaScript: Added handleLandscapeAccordions() to auto-open sidebar accordions when in landscape orientation (≤915px width) - Runs on DOMContentLoaded, orientationchange, and resize events - Uses matchMedia to detect landscape mode - Sets 'open' attribute on all .sidebar-accordion elements 2. CSS: Enhanced sidebar container styles in landscape mode - Set overflow: visible on sidebars (was hidden) - Set height: auto on sidebars and .actual-content wrappers - Forced accordion content visibility with !important rules - Made summary non-clickable in landscape (pointer-events: none) 3. Tests: Updated landscape test to validate sidebar visibility - Now checks sidebar visible/hidden state - Validates sidebar height (should be >100px, not 33px) - Added debug tests for troubleshooting RESULTS: - Sidebar height: 1387px (Android) / 1536px (iPhone) ✓ - Accordion state: OPEN ✓ - All sidebar content fully visible ✓ - No horizontal scroll ✓ Test files: - tests/mjs/54-landscape-mode-test.mjs (updated with sidebar checks) - tests/mjs/60-sidebar-content-debug.mjs (new debug test) - tests/mjs/61-sidebar-positioning-debug.mjs (positioning debug) - tests/mjs/62-sidebar-computed-height-debug.mjs (height debug) - tests/mjs/63-media-query-match-test.mjs (media query validation)
This commit is contained in:
@@ -937,9 +937,80 @@
|
||||
display: inline-flex !important;
|
||||
}
|
||||
|
||||
/* Reduce sidebar padding */
|
||||
.cv-sidebar {
|
||||
/* Fix sidebar to show all content in landscape */
|
||||
.cv-sidebar,
|
||||
.cv-sidebar-left,
|
||||
.cv-sidebar-right {
|
||||
padding: 0.75rem !important;
|
||||
overflow: visible !important; /* CRITICAL: Allow content to show */
|
||||
height: auto !important; /* CRITICAL: Remove fixed height */
|
||||
max-height: none !important;
|
||||
}
|
||||
|
||||
/* CRITICAL: Fix actual-content wrapper to expand with accordion content */
|
||||
.cv-sidebar .actual-content,
|
||||
.cv-sidebar-left .actual-content,
|
||||
.cv-sidebar-right .actual-content {
|
||||
height: auto !important;
|
||||
max-height: none !important;
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
/* CRITICAL: Force accordions open in landscape so sidebars are visible */
|
||||
/* Override <details> default collapsed behavior by completely neutralizing it */
|
||||
.sidebar-accordion,
|
||||
.sidebar-accordion[open],
|
||||
.sidebar-accordion:not([open]) {
|
||||
display: block !important; /* Override details display */
|
||||
overflow: visible !important;
|
||||
height: auto !important;
|
||||
max-height: none !important;
|
||||
min-height: 0 !important;
|
||||
}
|
||||
|
||||
/* Ensure all children of details are visible */
|
||||
.sidebar-accordion > * {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
/* Make the summary not clickable in landscape since accordion should stay open */
|
||||
.sidebar-accordion summary {
|
||||
pointer-events: none !important;
|
||||
list-style: none !important; /* Remove details arrow */
|
||||
}
|
||||
|
||||
.sidebar-accordion summary::-webkit-details-marker {
|
||||
display: none !important; /* Remove Chrome/Safari details marker */
|
||||
}
|
||||
|
||||
/* Show chevron as pointing down (expanded state) */
|
||||
.sidebar-accordion summary.sidebar-accordion-header .chevron {
|
||||
transform: rotate(0deg) !important; /* Chevron points down = expanded */
|
||||
}
|
||||
|
||||
/* Force accordion content visible regardless of [open] attribute */
|
||||
.sidebar-accordion .sidebar-accordion-content,
|
||||
.sidebar-accordion:not([open]) .sidebar-accordion-content {
|
||||
display: block !important;
|
||||
opacity: 1 !important;
|
||||
max-height: none !important;
|
||||
visibility: visible !important;
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
/* Show inner details elements as expanded too */
|
||||
.sidebar-accordion details {
|
||||
/* Make nested details also expanded */
|
||||
}
|
||||
|
||||
.sidebar-accordion details > summary::after {
|
||||
transform: rotate(0deg) !important;
|
||||
}
|
||||
|
||||
.sidebar-accordion details .sidebar-content {
|
||||
display: block !important;
|
||||
max-height: none !important;
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
/* Compact accordion headers in landscape */
|
||||
|
||||
Reference in New Issue
Block a user