fix: one playback driver per map, and a full dwell after each date's tiles land - #238
Merged
Merged
Conversation
…tiles land Two Timelines are always mounted, one per legend breakpoint with one hidden by CSS, and each one drove playback. On main that meant two intervals nearly in phase and frequent double steps: a date requested, 16 of its 24 tiles abandoned, the next date requested 50 ms later. The tile-readiness gate from OEMC-443 hid most of it but a 200 ms double step still slipped through. The step interval also started at the previous step, so load time counted against it. With slow tiles (3.2 s per date) the next date was requested 130 ms after the current one appeared: the map sat frozen on the old date, swapped, and froze again. Only the Timeline that claims timelinePlaybackOwnerAtom steps now; the other stays passive and takes over if the owner unmounts. And the dwell starts when the map goes idle after a step, so every date is on screen for the full interval. Cadence is tile load time + 2.5 s: measured 2.8 s with cached tiles (was 2.5 s, or 1.8 s on main with the double steps) and 5.8 s with 1.5 s tiles, no double steps in either case.
|
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.
Overview
Follow-up to #229 (OEMC-443), prompted by the report that playback on
mainfelt smooth and ondevelopdid not. Measured both with the same harness (layerl15, monitorm11, 30 s of playback, perDIM_DATE: first tile request, last tile response, gap to the next date's first request).Two problems fall out of that.
Two Timelines drive playback. The legend is rendered once per breakpoint, desktop and mobile, with one copy hidden by CSS, so two
Timelineinstances are mounted at all widths and each ran its own interval. Onmainthey were nearly in phase: frequent double steps, a date requested and abandoned after 16 of its 24 tiles, the next one requested 50 ms later, mean interval 1.8 s instead of 2.5 s. The tile-readiness gate from #229 hides most of it, but a 200 ms double step still showed up in 30 s.The interval started at the previous step. Load time counted against it, so with slow tiles the next date was requested 130 ms after the current one appeared. The map sat frozen on the old date for 3.2 s, swapped, and froze again.
mainoverlapped requests instead (−0.7 s gap), which reads as a continuous crossfade but is exactly the GeoServer waste OEMC-443 removes.Changes, all in
src/hooks/timeline.tsplus one atom insrc/app/store.tsx, so both Timeline copies pick them up and nothing collides with #237:timelinePlaybackOwnerAtomsteps. The other stays passive and takes over if the owner unmounts.Result with the same harness:
Cadence with cached tiles goes from 2.5 s to 2.8 s (the ~150 ms tile load plus effect latency, on top of the 2.5 s dwell). Flag it if that matters; the constant is
TIMELINE_STEP_DURATION.Note for the store: with
strictoff,atom<string | null>(null)resolves to jotai's read-only overload and the setter types asnever, so the owner atom isatom<string>()withundefinedmeaning "no owner".Designs
N/A
Testing instructions
/explore/monitor/m11, activate a layer with a time dimension, let playback run. Dates advance one at a time, roughly every 2.8 s; none is skipped.GetMap. Each date's 24 tiles complete before the next date is requested; no batch is abandoned half way.Feature relevant tickets
OEMC-443 (follow-up to #229)
Checklist before submitting
develop.deploying to staging/production, please add brief testing instructions
to the deploy checklist