Conversation
Co-authored-by: nbali <581927+nbali@users.noreply.github.com>
Co-authored-by: nbali <581927+nbali@users.noreply.github.com>
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved issues were identified, and the review supports approval.
Review effort: Lite
Findings: None
What changed in this PR
Prevents Leaflet’s bottom-left controls from overlapping multi-line attribution on narrow screens.
Changes:
- Tracks attribution height with
ResizeObserver. - Offsets bottom-left controls using a CSS variable.
| File | Description |
|---|---|
res/huroutes.js |
Updates the attribution-height CSS variable dynamically. |
res/huroutes.css |
Applies the variable to bottom-left Leaflet controls. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } | ||
|
|
||
| /* Keeps the bottom-left controls above the variable-height attribution (see initCtrls) */ | ||
| .leaflet-bottom.leaflet-left { |
There was a problem hiding this comment.
This selector looks too brittle to me. Please update to this to make sure it applies to all bottom-placed controls except the one that has attribution, but controls only:
.leaflet-control-container .leaflet-bottom:not(:has(.leaflet-control-attribution))
There was a problem hiding this comment.
Wouldn't this break the UI as it would apply on the right as well?
There was a problem hiding this comment.
No, it has :not(:has(.leaflet-control-attribution)), so it doesn't apply this for any controls that have an attribution within
On narrow screens, the multi-line Leaflet attribution can cover the bottom of the layer selector. The fix mirrors the attribution height into a CSS variable and offsets the bottom-left control stack accordingly.
ResizeObserver.--attribution-heighton the map container..leaflet-bottom.leaflet-left.