Mobile follow up number 4 #77
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gtfs.zone/coloring-book#77
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Follow-up polish pass on mobile support (#74). Three remaining issues: (1) Desktop right-panel scroll container collapses to near-zero height because DaisyUI v5's
.tabscomponent setsheight: auto, breaking theheight: 100%chain for all descendants. The Phase 2 fix (#right-panel .tab-content { height: 100%; }in@layer components) may also lose to DaisyUI's layers. Fix: add unlayered CSS to give.tabsa definite height — this unblocks the entire height chain. (2) The three basemap control buttons (basemap FAB, projection toggle, shape toggle) are visually behind the mobile dock because they useposition: absoluterelative to the MapLibre map container. Switching toposition: fixed(same mechanism as the dock) makes them viewport-relative and immune to any parent container sizing/overflow issues. (3) On mobile there are 1-2px of x and y scrollability.overflow: hiddenis only set onbody, nothtml. Adding it to both seals the gap.Approach: all three changes are in
src/styles/main.cssonly. No JS changes.Relevant Context
src/styles/main.css:13-16— the existinghtml, body { overscroll-behavior: none; }rule to extendsrc/styles/main.css:29-69— the@media (max-width: 767px)block;.basemap-controlrule is at lines 38-41src/styles/main.css:71-81—@layer componentsblock containing#right-panel .tab-content { height: 100%; }at lines 73-75src/modules/basemap-control.ts:144-156—createControl()sets inlinestyle.cssText = 'position: absolute; bottom: 40px; right: 10px; ...'; our CSS!importantrule overrides these on mobile.tabs:display: flex; flex-wrap: wrap; height: var(--tabs-height)where--tabs-height: auto. Tab inputs are flex row 1;.tab-contenthasorder: 1; width: 100%; height: calc(100% - var(--tab-height)). The100%in that calc resolves against.tabs' height — which isauto, causing the entire chain to collapse to 0 in strict CSS implementations..dock: usesposition: fixed; bottom: 0; z-index: 50(the stable positioning the user is referencing)Phase 1: Fix Web Scroll Container Height
Goal: Make the right-panel scroll container fill the full available height on desktop.
Root cause:
.tabshasheight: auto(set by DaisyUI via--tabs-height: auto). Children'sheight: 100%orheight: calc(100% - ...)cannot resolve against anautoparent, so the scroll container collapses to content height. The Phase 2 fix in@layer componentsmay also be overridden by DaisyUI's own layer declarations.src/styles/main.cssOutside any
@layerblock (unlayered CSS wins over all layered CSS), add:Place it immediately after the
@layer componentsblock (around line 82). Unlayered rules always beat layered rules, so this overrides DaisyUI'sheight: var(--tabs-height) = autowith a definite100%(which resolves against#right-panel's grid-determined height). Once.tabshas a definite height, DaisyUI's built-inheight: calc(100% - var(--tab-height))on.tab-contentresolves correctly.No change needed to the existing
#right-panel .tab-content { height: 100%; }in@layer components— it remains as belt-and-suspenders for mobile (where DaisyUI's tab-height calc may differ).Gotcha: on desktop the drag handle is
md:hidden, so.tabsis effectively the only child of#right-panelandheight: 100%fills it exactly. On mobile the drag handle is visible (~32px), but#right-panelhasoverflow: hiddenwhich clips any overflow at the bottom of.tabs. Mobile scroll still works because the tab-content has its ownoverflow-y: auto.Phase 2: Fix Basemap Buttons Beneath Dock
Goal: Ensure the three basemap control buttons (basemap FAB, projection toggle, shape toggle) are always visible above the dock on mobile.
Root cause: The control uses
position: absoluterelative to MapLibre's map container (set in inlinestyle.cssText). Even thoughbottom: calc(var(--dock-height) + 10px)is correct,position: absoluteinside a potentially-clipping map container is fragile. The dock itself uses DaisyUI'sposition: fixed; bottom: 0(viewport-relative), which is why it's stable.src/styles/main.css@media (max-width: 767px)block, update the.basemap-controlrule to useposition: fixed: Addingposition: fixed !importantoverrides the inlineposition: absolute(CSS!importantbeats inline styles). Addingright: 10px !importantmakes it explicit (was already set inline, but now declared in CSS alongside the other layout properties). Thebottomandz-indexlines are unchanged from before.Gotcha:
position: fixedelements are removed from the map container's stacking context — this is intentional. The control stacks in the root stacking context atz-index: 40, which is below the dock (z-50) and right panel (z-50). When the bottom sheet opens at full height, it correctly overlays the buttons.Gotcha:
rebuildControl()inbasemap-control.tsre-appends the container tomapContainer. Withposition: fixed, being insidemapContainerhas no effect on visual position — the element is always viewport-relative. No JS change needed.Gotcha: this
@mediarule already has!importantonbottomandz-index, so the pattern is consistent.Phase 3: Fix Mobile Micro-Scrollability
Goal: Eliminate the 1-2px x and y scrollability on mobile.
Root cause:
overflow: hiddenis only set onbody. Thehtmlelement is not constrained. On mobile browsers, thehtmlelement can be slightly scrollable even whenbodyis clipped.src/styles/main.csshtml, bodyrule at lines 13-16 to includeoverflow: hidden: One line addition.overscroll-behavior: noneprevents rubberbanding/swipe-to-refresh;overflow: hiddenprevents any actual scroll from happening on either element.