fix(map): actually drop mobile Features panel below sidebar drawer (#3532)#3582
Conversation
…3532) The #3548 fix added `.map-controls { z-index: 997 }` inside the `@media (max-width: 768px)` block (nodes.css ~L1336), intending to let the Features panel yield to the Sources sidebar drawer (z-index 999) on mobile. It never took effect. The base `.map-controls { z-index: 1000 }` rule is declared LATER in the file (~L2242, top level). Media queries add no specificity, so with equal specificity the later base rule wins the cascade even on mobile — `z-index` resolved to 1000, still above the drawer. The base `top:10px/right:10px` also clobbered the mobile `top:16px/right:8px`; only `left`/`max-width` (which the base doesn't set) survived. Move the mobile `.map-controls` override into a media block placed AFTER the base rule so it actually wins source order. Leave a breadcrumb comment at the old location explaining why the override can't live there. Verified on mobile (390x844): with the Sources drawer open, the Features panel now sits behind the drawer backdrop and the source Connect buttons are fully accessible. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJPe6J5vKrcbwzt6vCdtrt
|
Claude finished @Yeraze's task —— View job PR Review
SummaryThe fix is correct and well-reasoned. The root cause analysis in the PR description is accurate: CSS media queries add no specificity, so source order is the tiebreaker — and the earlier mobile override was losing to the later base rule. Code AnalysisThe fix ( The cascade problem was:
Both selectors have identical specificity ( The fix moves the mobile override to after the base rule (~L2257–2270), which correctly wins the cascade: /* Map Controls */
.map-controls {
...
z-index: 1000; /* base */
}
/* Map Controls (mobile override) - AFTER base, wins source order */
@media (max-width: 768px) {
.map-controls {
z-index: 997; /* correctly overrides the base */
}
}Z-index hierarchy (verified against
The hierarchy is coherent. On desktop, Breadcrumb comment at old location (L1335–1339): Excellent addition — it explains why the override isn't there, preventing future regressions where someone might move it back. Comment on the new block (L2251–2256): Also well done — explains both the position choice and the reasoning about #3532. Potential IssuesNone found. A few minor observations:
Testing
VerdictApproved. The CSS cascade root cause is correctly diagnosed and properly fixed. The explanation comments are high quality and will prevent regression. No security, performance, or logic concerns. |
Summary
Re-fixes #3532. The earlier fix (#3548) was inert — the mobile map Features panel still painted on top of the slide-in Sources sidebar drawer on mobile portrait, blocking the source Connect buttons.
Why the previous fix did nothing
#3548 added
.map-controls { z-index: 997 }inside the@media (max-width: 768px)block (nodes.css~L1336), to drop the panel below the sidebar drawer (z-index: 999).But the base
.map-controls { z-index: 1000 }rule is declared later in the file (~L2242, top-level, not in any media query). Media queries add no specificity, so with equal specificity (.map-controls= 0,0,1,0) the later base rule wins the cascade — even on mobile.z-indexresolved to 1000, still above the drawer. (The basetop:10px/right:10pxlikewise clobbered the mobiletop:16px/right:8px; onlyleft/max-widthsurvived since the base doesn't set them.).dashboard-sidebar(mobile drawer).dashboard-sidebar-backdrop.map-controlsmobile override.map-controlsbase (later in source)Fix
Move the mobile
.map-controlsoverride into a@media (max-width: 768px)block placed after the base rule, so it wins source order. A breadcrumb comment at the old location explains why the override can't live there.CSS-only, no JS/state coupling.
Testing
tsc --noEmit: no errors.🤖 Generated with Claude Code