Skip to content

fix(map): actually drop mobile Features panel below sidebar drawer (#3532)#3582

Merged
Yeraze merged 1 commit into
mainfrom
fix/3532-map-controls-zindex-order
Jun 20, 2026
Merged

fix(map): actually drop mobile Features panel below sidebar drawer (#3532)#3582
Yeraze merged 1 commit into
mainfrom
fix/3532-map-controls-zindex-order

Conversation

@Yeraze

@Yeraze Yeraze commented Jun 20, 2026

Copy link
Copy Markdown
Owner

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-index resolved to 1000, still above the drawer. (The base top:10px/right:10px likewise clobbered the mobile top:16px/right:8px; only left/max-width survived since the base doesn't set them.)

Element z-index Result before fix
.dashboard-sidebar (mobile drawer) 999
.dashboard-sidebar-backdrop 998
.map-controls mobile override 997 (L1336) overridden
.map-controls base (later in source) 1000 (L2242) wins → paints over drawer

Fix

Move the mobile .map-controls override 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.
  • Full Vitest suite: 6784 passed / 0 failed (0 failed suites).
  • Manual visual verification at mobile 390×844 (the step that was missing last time): deployed the dev container, opened the Dashboard, opened the Sources drawer, opened the Features panel. The Features panel now sits behind the drawer backdrop and the source Connect / "Open →" buttons are fully accessible. Screenshot attached in the PR thread / linked issue.

🤖 Generated with Claude Code

…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
@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown

Claude finished @Yeraze's task —— View job


PR Review

  • Read changed CSS file
  • Analyze the cascade fix
  • Provide review feedback

Summary

The 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 Analysis

The fix (src/styles/nodes.css)

The cascade problem was:

  1. @media (max-width: 768px) { .map-controls { z-index: 997 } } at ~L1336
  2. .map-controls { z-index: 1000 } (base rule) at ~L2239

Both selectors have identical specificity (0,0,1,0), so the later declaration wins. The mobile override at L1336 was silently losing — z-index resolved to 1000 in all cases.

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 dashboard.css):

Element z-index
.dashboard-sidebar (mobile drawer) 999
.dashboard-sidebar-backdrop 998
.map-controls (mobile) 997
.map-controls (desktop base) 1000

The hierarchy is coherent. On desktop, .dashboard-sidebar has no z-index (it's a flex child, not positioned), so the 1000 doesn't conflict.

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 Issues

None found. A few minor observations:

  1. left: auto and max-width at the old location (L1350–1353) remain in the earlier media block. These left/max-width properties are not overridden by the base .map-controls rule (which doesn't set them), so they were already working correctly at L1336 even before this fix. The new mobile block at L2257 also explicitly sets left: auto and max-width, so there's slight duplication — but it's harmless and the old block's remaining properties (.map-controls.collapsed reset) are separate concerns. This is fine as-is.

  2. top: 16px and right: 8px — The PR description notes these were also being clobbered by the base rule's top: 10px / right: 10px. This fix resolves that too.

Testing

  • TypeScript: tsc --noEmit clean ✓
  • Vitest: 6784 passed / 0 failed ✓
  • Manual visual verification at 390×844 ✓

Verdict

Approved. 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.

@Yeraze Yeraze merged commit 7b39d72 into main Jun 20, 2026
15 checks passed
@Yeraze Yeraze deleted the fix/3532-map-controls-zindex-order branch June 20, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Map features menu blocks sidebar connect button on mobile

1 participant