Contacts move back as smoothly as they move on

A snapshot timeline may declare spanMs: each record of a snapshot at a
time then carries its own fixes from spanMs before the time to spanMs
after it. Flights, military flights and vessels following the clock are
placed on those fixes, so a seek or a move back within the fixes loaded
is no jump: nothing is cleared and play does not wait. The step there is
asked for once and stands in for every contact; those it has keep their
place. Fixes are merged across snapshots at least 20 s apart, at most
240 a contact, and a contact is not drawn more than a minute before its
first fix.
This commit is contained in:
Sameh Khamis committed 2026-11-15 09:27:31 -08:00
1 parent b8a320edce
commit 2b5fb51684
27 files changed
+1377 -182

No files matched your search

+15 -1
View File
@@ -1983,7 +1983,7 @@ layer's existing lifecycle and selection guards continue to reject late work.
### Following the world clock
A source may declare a timeline: it can answer a snapshot at a given time.
`source.timeline` is `{ coverage(), stepMs, subscribe? }`, validated by
`source.timeline` is `{ coverage(), stepMs, spanMs?, subscribe? }`, validated by
`readSnapshotTimeline` (`src/sources/live/contract.js`): `coverage()` returns
the span `{ start, end }` in epoch ms it can answer, or null while it does not
know yet; `stepMs` is the spacing of its snapshots; the optional
@@ -2017,6 +2017,20 @@ the older is aborted before a newer starts. Moving the view while vessels follow
area at the same time. Back at live the contacts are cleared and the layer
polls at once.
A timeline may also declare `spanMs`: each record of a snapshot at a time then
carries `fixes`, `{ atMs, lat, lon, altitudeM? }` in time order, its own track
from `spanMs` before the time to `spanMs` after it
(`src/time/timelineFixes.js`). The layer places each contact on its fixes at
the clock's time, so a seek or a move back that stays within the fixes the
loaded snapshots carry is no jump: nothing is cleared, play does not wait,
and contacts move to the time smoothly. The snapshot at a step before the
newest loaded is asked for once and then stands in for every contact: it
brings back any that had left after it and drops those not there yet, while
those it has keep their place, as their fixes put them. Paused, a time nearing
the end of the fixes after the newest asks for the snapshot there. A contact is not drawn more than a minute before its first
fix, as it was not there yet. Each contact keeps at most 240 fixes, at least
20 seconds apart, and the loaded snapshot times span at most 20 minutes.
A snapshot at `atMs` describes the world as it stood then: `observedAtMs` is
at or before `atMs`, no record is observed later than `atMs`, freshness and
staleness are judged against `atMs`, `atMs` is echoed back, and a vessel