Stabilize mobile map height and debounce invalidateMapSize (fix dvh flicker)#227
Open
badjoke-lab wants to merge 12 commits into
Open
Stabilize mobile map height and debounce invalidateMapSize (fix dvh flicker)#227badjoke-lab wants to merge 12 commits into
badjoke-lab wants to merge 12 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
100dvhand triggering repeated Leafletresizecalls that cause full-screen flicker.Description
100dvhheight on.cpm-map-rootwith a stable CSS variable driven bywindow.innerHeightby adding a client-only effect that writes--cpm-app-vhand updates onresizeandvisualViewportwith a 120ms debounce, and useheight: calc(var(--cpm-app-vh, 1vh) * 100 - var(--cpm-header-h, 64px))(incomponents/map/MapClient.tsx).invalidateMapSize(reason)to aggregate calls into a single execution within a 150ms window, treat theopenreason specially (300ms delayed single call), and ignore duplicatevisualViewportResizeevents within the debounce window (incomponents/map/MapClient.tsx).components/map/MapClient.tsx).components/map/MobileBottomSheet.tsxandcomponents/GlobalHeader.tsx).Testing
npm run buildcompleted successfully (build + typecheck; Next warnings only). (success)npm run devand served/maplocally. (success)/map(mobile viewport, pin tap → sheet open → 10s wait) captured HUD output and a screenshot; HUD shows no repeated Leaflet resize (captured output:leaflet resize count: 0). (success)Codex Task